diff options
author | Anna Thomas <anna@azul.com> | 2017-07-04 15:09:09 +0000 |
---|---|---|
committer | Anna Thomas <anna@azul.com> | 2017-07-04 15:09:09 +0000 |
commit | a66a98cc740f3eaafa3482615e4cb2001ce35ffd (patch) | |
tree | 333fa891704a6370ec804ccd4b519ed798d4707b /llvm/lib/CodeGen | |
parent | 2e5c46cbac22a699da3fd77e969d322a0fdfe317 (diff) | |
download | bcm5719-llvm-a66a98cc740f3eaafa3482615e4cb2001ce35ffd.tar.gz bcm5719-llvm-a66a98cc740f3eaafa3482615e4cb2001ce35ffd.zip |
[FastISel][SelectionDAG]Teach fastISel about GC intrinsics
Summary:
We are crashing in LLC at O0 when gc intrinsics are present in the block.
The reason being FastISel performs basic block ISel by modifying GC.relocates
to be the first instruction in the block. This can cause us to visit the GC
relocate before it's corresponding GC.statepoint is visited, which is incorrect.
When we lower the statepoint, we record the base and derived pointers, along
with the gc.relocates. After this we can visit the gc.relocate.
This patch avoids fastISel from incorrectly creating the block with gc.relocate
as the first instruction.
Reviewers: qcolombet, skatkov, qikon, reames
Reviewed by: skatkov
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D34421
llvm-svn: 307084
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index f711ca71f79..72b1b39a524 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -1507,7 +1507,11 @@ void SelectionDAGISel::SelectAllBasicBlocks(const Function &Fn) { } // Then handle certain instructions as single-LLVM-Instruction blocks. - if (isa<CallInst>(Inst)) { + // We cannot separate out GCrelocates to their own blocks since we need + // to keep track of gc-relocates for a particular gc-statepoint. This is + // done by SelectionDAGBuilder::LowerAsSTATEPOINT, called before + // visitGCRelocate. + if (isa<CallInst>(Inst) && !isStatepoint(Inst) && !isGCRelocate(Inst)) { OptimizationRemarkMissed R("sdagisel", "FastISelFailure", Inst->getDebugLoc(), LLVMBB); |