llvm-project/llvm/lib/CodeGen/SelectionDAG
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
..
CMakeLists.txt Remove trailing whitespace to trigger re-cmaking 2017-10-02 21:54:38 +00:00
DAGCombiner.cpp [DAGCombiner] limit shuffle to extend transform (PR40146) 2018-12-23 20:48:31 +00:00
FastISel.cpp FastIsel: take care to update iterators when removing instructions. 2018-12-17 17:25:53 +00:00
FunctionLoweringInfo.cpp AMDGPU: Fix various issues around the VirtReg2Value mapping 2018-11-30 22:55:29 +00:00
InstrEmitter.cpp [SDAG] Clarify the origin of chain in REG_SEQUENCE in comment, NFC 2018-12-17 20:30:20 +00:00
InstrEmitter.h [DebugInfo] Convert intrinsic llvm.dbg.label to MachineInstr. 2018-05-09 02:41:08 +00:00
LLVMBuild.txt
LegalizeDAG.cpp [TargetLowering] Add ISD::ROTL/ROTR vector expansion 2018-12-13 11:20:48 +00:00
LegalizeFloatTypes.cpp [NFC] Rename minnan and maxnan to minimum and maximum 2018-10-24 22:49:55 +00:00
LegalizeIntegerTypes.cpp [SelectionDAG] Always use the version of computeKnownBits that returns a value. NFCI. 2018-12-21 14:56:18 +00:00
LegalizeTypes.cpp [DAG] Don't map a TableId to itself in the ReplacedValues map 2018-06-20 16:06:09 +00:00
LegalizeTypes.h [Intrinsic] Signed Fixed Point Multiplication Intrinsic 2018-12-12 06:29:14 +00:00
LegalizeTypesGeneric.cpp [LegalizeTypes] Fix bad indentation. NFC 2018-09-23 21:17:55 +00:00
LegalizeVectorOps.cpp [TargetLowering] Add ISD::ROTL/ROTR vector expansion 2018-12-13 11:20:48 +00:00
LegalizeVectorTypes.cpp [SelectionDAG][X86] Fix [US](ADD|SUB)SAT vector legalization, add tests 2018-12-18 13:22:53 +00:00
ResourcePriorityQueue.cpp Silence a bunch of implicit fallthrough warnings 2017-12-19 22:05:25 +00:00
SDNodeDbgValue.h [DebugInfo] Emit undef DBG_VALUEs when SDNodes are optimised out 2018-12-10 11:20:47 +00:00
ScheduleDAGFast.cpp [DebugInfo] Emit undef DBG_VALUEs when SDNodes are optimised out 2018-12-10 11:20:47 +00:00
ScheduleDAGRRList.cpp ScheduleDAG: Cleanup dumping code; NFC 2018-09-19 00:23:35 +00:00
ScheduleDAGSDNodes.cpp [DebugInfo] Emit undef DBG_VALUEs when SDNodes are optimised out 2018-12-10 11:20:47 +00:00
ScheduleDAGSDNodes.h ScheduleDAG: Cleanup dumping code; NFC 2018-09-19 00:23:35 +00:00
ScheduleDAGVLIW.cpp ScheduleDAG: Cleanup dumping code; NFC 2018-09-19 00:23:35 +00:00
SelectionDAG.cpp [NVPTX] Allow libcalls that are defined in the current module. 2018-12-26 19:12:31 +00:00
SelectionDAGAddressAnalysis.cpp [SelectionDAG] Teach BaseIndexOffset::match to unwrap the base after looking through an add/or 2018-11-26 20:16:33 +00:00
SelectionDAGBuilder.cpp [SelectionDAGBuilder] Use ::precise LocationSizes; NFC 2018-12-24 05:34:21 +00:00
SelectionDAGBuilder.h [IR] Add a dedicated FNeg IR Instruction 2018-11-13 18:15:47 +00:00
SelectionDAGDumper.cpp [Intrinsic] Signed Fixed Point Multiplication Intrinsic 2018-12-12 06:29:14 +00:00
SelectionDAGISel.cpp [SelectionDAG] Always use the version of computeKnownBits that returns a value. NFCI. 2018-12-21 14:56:18 +00:00
SelectionDAGPrinter.cpp Rename DEBUG macro to LLVM_DEBUG. 2018-05-14 12:53:11 +00:00
SelectionDAGTargetInfo.cpp
StatepointLowering.cpp [CodeGen] Prefer static frame index for STATEPOINT liveness args 2018-11-30 16:22:41 +00:00
StatepointLowering.h [IR][CodeGen] Remove dependency on EVT from IR/Function.cpp. Move EVT to CodeGen layer. 2018-03-29 17:21:10 +00:00
TargetLowering.cpp [SelectionDAG] Always use the version of computeKnownBits that returns a value. NFCI. 2018-12-21 14:56:18 +00:00