Skip to content

Conversation

@aparshin-intel
Copy link
Contributor

SPIRV Lower OCL blocks pass does not have getPassName implementation. This commit adds one

@CLAassistant
Copy link

CLAassistant commented May 20, 2020

CLA assistant check
All committers have signed the CLA.

@AlexeySachkov AlexeySachkov merged commit caa3d88 into KhronosGroup:master May 20, 2020
zahiraam pushed a commit to zahiraam/SPIRV-LLVM-Translator that referenced this pull request May 26, 2020
…roup#539)

Enable strict rules to set ContractionOFF (KhronosGroup#521)

This patch makes several improvements to enable correct setting for
ContractionOFF:

  1) Plain `fadd' or `fsub' instruction trigger ContractionOFF to
     avoid optimizations that may fold them to an FMA.

  2) `contract' flag is recognized on `fadd' and `fsub', and it allows
     to suppress (1).

  3) Undefined (external) functions, function pointers and inline asm
     calls force ContractionOFF flag.

  4) Contraction information is now propagated up the call stack until
     an entry point.

Signed-off-by: Andrew Savonichev <[email protected]>

Add missing implementation of getPassName for SPIRVLowerOCLBlocks (KhronosGroup#543)

[NFC] Refactor logic of memory scopes, orders and flags translation

There are several OpenCL built-ins which accept cl_mem_fence_flags,
memory_scope and memory_order arguments (like barriers, fences or atomics) and
representation of that info is different between OpenCL and SPIR-V:
different values for enumerations and bitmasks, different arguments for
OpenCL built-ins and SPIR-V instructions.

To avoid code duplication, refactored all common code for translation
aforementioned entities into helper functions.

Simplified interface of getOrCreateSwithFunc helper: `llvm::Module`
argument is now infered from `InsertPoint` argument.

Improve handling of OpMemoryBarrier

Added support for non-constant 'Semantics' operand

Clang, due to some ABI constraints needs to generate llvm.trap
intrinsics. According to the LangRef documentation a trap instruction
is lowered to a target's trap instruction or to an abort() function
if the target doesn't have a trap instruction. SPIRV has neither a
trap nor an abort instruction and no current opcode has the semantics
of an abort/trap.
Currently the IR to SPIRV translator is crashing when it finds an
llvm.trap intrinsic. The solution will require some thoughts on the
SPIRV side to decide how to implement an abort instruction.
This patch changes the translator so it doesn't crash. This will be
revised when a decision is taken.

NOTE: clang could eventually not generate an llvm.trap instruction in
the current case (non-base destructor of an abstract class needs to be
emmitted) but keep in mind that clang might generate an llvm.trap
intrinsic some other ways and we might stumble into this issue again.
An alternative to this, could be to add an LLVM pass that will get rid
of the llvm.trap intrisincs in the code before the SPIRV translator.
But having the translator solve this issue is a preferred solution.

The translator crashes when it find an llvm trap instruction.

Clang, due to some ABI constraints needs to generate llvm.trap
intrinsics. According to the LangRef documentation a trap instruction
is lowered to a target's trap instruction or to an abort() function
if the target doesn't have a trap instruction. SPIRV has neither a
trap nor an abort instruction and no current opcode has the semantics
of an abort/trap.
Currently the IR to SPIRV translator is crashing when it finds an
llvm.trap intrinsic. The solution will require some thoughts on the
SPIRV side to decide how to implement an abort instruction.
This patch changes the translator so it doesn't crash. This will be
revised when a decision is taken.

NOTE: clang could eventually not generate an llvm.trap instruction in
the current case (non-base destructor of an abstract class needs to be
emmitted) but keep in mind that clang might generate an llvm.trap
intrinsic some other ways and we might stumble into this issue again.
An alternative to this, could be to add an LLVM pass that will get rid
of the llvm.trap intrisincs in the code before the SPIRV translator.
But having the translator solve this issue is a preferred solution.

Signed-off-by: Zahira Ammarguellat <[email protected]>

The translator crashes when it find an llvm trap instruction.

Clang, due to some ABI constraints needs to generate llvm.trap
intrinsics. According to the LangRef documentation a trap instruction
is lowered to a target's trap instruction or to an abort() function
if the target doesn't have a trap instruction. SPIRV has neither a
trap nor an abort instruction and no current opcode has the semantics
of an abort/trap.
Currently the IR to SPIRV translator is crashing when it finds an
llvm.trap intrinsic. The solution will require some thoughts on the
SPIRV side to decide how to implement an abort instruction.
This patch changes the translator so it doesn't crash. This will be
revised when a decision is taken.

NOTE: clang could eventually not generate an llvm.trap instruction in
the current case (non-base destructor of an abstract class needs to be
emmitted) but keep in mind that clang might generate an llvm.trap
intrinsic some other ways and we might stumble into this issue again.
An alternative to this, could be to add an LLVM pass that will get rid
of the llvm.trap intrisincs in the code before the SPIRV translator.
But having the translator solve this issue is a preferred solution.

Signed-off-by: Zahira Ammarguellat <[email protected]>

Clang, due to some ABI constraints needs to generate llvm.trap
intrinsics. According to the LangRef documentation a trap instruction
is lowered to a target's trap instruction or to an abort() function
if the target doesn't have a trap instruction. SPIRV has neither a
trap nor an abort instruction and no current opcode has the semantics
of an abort/trap.
Currently the IR to SPIRV translator is crashing when it finds an
llvm.trap intrinsic. The solution will require some thoughts on the
SPIRV side to decide how to implement an abort instruction.
This patch changes the translator so it doesn't crash. This will be
revised when a decision is taken.

NOTE: clang could eventually not generate an llvm.trap instruction in
the current case (non-base destructor of an abstract class needs to be
emmitted) but keep in mind that clang might generate an llvm.trap
intrinsic some other ways and we might stumble into this issue again.
An alternative to this, could be to add an LLVM pass that will get rid
of the llvm.trap intrisincs in the code before the SPIRV translator.
But having the translator solve this issue is a preferred solution.
AlexeySotkin pushed a commit that referenced this pull request Jun 26, 2020
Change-Id: I4292aa2126a11986958f15afd8dddfe73eaae249
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants