llvm-project/llvm/lib/Target/NVPTX
Justin Lebar 49fac56ea3 [NVPTX] Allow libcalls that are defined in the current module.
The patch adds a possibility to make library calls on NVPTX.

An important thing about library functions - they must be defined within
the current module. This basically should guarantee that we produce a
valid PTX assembly (without calls to not defined functions). The one who
wants to use the libcalls is probably will have to link against
compiler-rt or any other implementation.

Currently, it's completely impossible to make library calls because of
error LLVM ERROR: Cannot select: i32 = ExternalSymbol '...'. But we can
lower ExternalSymbol to TargetExternalSymbol and verify if the function
definition is available.

Also, there was an issue with a DAG during legalisation. When we expand
instruction into libcall, the inner call-chain isn't being "integrated"
into outer chain. Since the last "data-flow" (call retval load) node is
located in call-chain earlier than CALLSEQ_END node, the latter becomes
a leaf and therefore a dead node (and is being removed quite fast).
Proposed here solution relies on another data-flow pseudo nodes
(ProxyReg) which purpose is only to keep CALLSEQ_END at legalisation and
instruction selection phases - we remove the pseudo instructions before
register scheduling phase.

Patch by Denys Zariaiev!

Differential Revision: https://reviews.llvm.org/D34708

llvm-svn: 350069
2018-12-26 19:12:31 +00:00
..
InstPrinter
MCTargetDesc [DEBUGINFO, NVPTX]Emit last debugging directives. 2018-12-06 16:02:09 +00:00
TargetInfo
CMakeLists.txt [NVPTX] Allow libcalls that are defined in the current module. 2018-12-26 19:12:31 +00:00
LLVMBuild.txt
ManagedStringPool.h
NVPTX.h [NVPTX] Allow libcalls that are defined in the current module. 2018-12-26 19:12:31 +00:00
NVPTX.td [CUDA] Added basic support for compiling with CUDA-10.0 2018-09-24 23:10:44 +00:00
NVPTXAllocaHoisting.cpp [TI removal] Make variables declared as `TerminatorInst` and initialized 2018-10-15 10:04:59 +00:00
NVPTXAllocaHoisting.h
NVPTXAsmPrinter.cpp [NVPTX] Allow libcalls that are defined in the current module. 2018-12-26 19:12:31 +00:00
NVPTXAsmPrinter.h [NVPTX] do not rely on cached subtarget info. 2018-12-12 18:31:04 +00:00
NVPTXAssignValidGlobalNames.cpp Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
NVPTXFrameLowering.cpp [DEBUGINFO, NVPTX] Emit correct debug information for local variables. 2018-07-26 16:29:52 +00:00
NVPTXFrameLowering.h [DEBUGINFO, NVPTX] Emit correct debug information for local variables. 2018-07-26 16:29:52 +00:00
NVPTXGenericToNVVM.cpp
NVPTXISelDAGToDAG.cpp [SDAG] Remove the reliance on MI's allocation strategy for 2018-08-14 23:30:32 +00:00
NVPTXISelDAGToDAG.h [NVPTX] Delete dead code 2018-06-28 20:05:35 +00:00
NVPTXISelLowering.cpp [NVPTX] Allow libcalls that are defined in the current module. 2018-12-26 19:12:31 +00:00
NVPTXISelLowering.h [NVPTX] Allow libcalls that are defined in the current module. 2018-12-26 19:12:31 +00:00
NVPTXImageOptimizer.cpp Remove trailing space 2018-07-30 19:41:25 +00:00
NVPTXInstrFormats.td
NVPTXInstrInfo.cpp [NVPTX] Delete dead code 2018-06-28 20:05:35 +00:00
NVPTXInstrInfo.h [NVPTX] Delete dead code 2018-06-28 20:05:35 +00:00
NVPTXInstrInfo.td [NVPTX] Allow libcalls that are defined in the current module. 2018-12-26 19:12:31 +00:00
NVPTXIntrinsics.td [TableGen] Support multi-alternative pattern fragments 2018-07-13 13:18:00 +00:00
NVPTXLowerAggrCopies.cpp
NVPTXLowerAggrCopies.h
NVPTXLowerAlloca.cpp
NVPTXLowerArgs.cpp
NVPTXMCExpr.cpp
NVPTXMCExpr.h
NVPTXMachineFunctionInfo.h Remove trailing space 2018-07-30 19:41:25 +00:00
NVPTXPeephole.cpp
NVPTXPrologEpilogPass.cpp [DEBUG_INFO][NVPTX]Fix processing of DBG_VALUES. 2018-10-25 14:27:27 +00:00
NVPTXProxyRegErasure.cpp [NVPTX] Allow libcalls that are defined in the current module. 2018-12-26 19:12:31 +00:00
NVPTXRegisterInfo.cpp
NVPTXRegisterInfo.h
NVPTXRegisterInfo.td
NVPTXReplaceImageHandles.cpp
NVPTXSubtarget.cpp
NVPTXSubtarget.h [NVPTX] Delete dead code 2018-06-28 20:05:35 +00:00
NVPTXTargetMachine.cpp [NVPTX] Allow libcalls that are defined in the current module. 2018-12-26 19:12:31 +00:00
NVPTXTargetMachine.h [NVPTX] Added a feature to use short pointers for const/local/shared AS. 2018-05-09 23:46:19 +00:00
NVPTXTargetObjectFile.h Revert "Temporarily revert "[DEBUG] Initial adaptation of NVPTX target for debug info emission."" 2018-05-18 03:13:08 +00:00
NVPTXTargetTransformInfo.cpp
NVPTXTargetTransformInfo.h [NVPTX] Implement isLegalToVectorizeLoadChain 2018-08-27 17:29:43 +00:00
NVPTXUtilities.cpp
NVPTXUtilities.h
NVVMIntrRange.cpp
NVVMReflect.cpp [NVPTX] Handle __nvvm_reflect("__CUDA_ARCH"). 2018-08-03 18:05:24 +00:00
cl_common_defines.h