diff options
author | Serguei Katkov <serguei.katkov@azul.com> | 2019-04-05 05:41:08 +0000 |
---|---|---|
committer | Serguei Katkov <serguei.katkov@azul.com> | 2019-04-05 05:41:08 +0000 |
commit | c39636cc2c6d17453bca3d76cdaba4a458b45ae3 (patch) | |
tree | 93490822b7f440a89b74c0bd7f07e46e81bd4858 /llvm/lib/CodeGen | |
parent | 7d1ec7b07ee1494659ecdc519c18e8c53cabe189 (diff) | |
download | bcm5719-llvm-c39636cc2c6d17453bca3d76cdaba4a458b45ae3.tar.gz bcm5719-llvm-c39636cc2c6d17453bca3d76cdaba4a458b45ae3.zip |
[FastISel] Fix crash for gc.relocate lowring
Lowering safepoint checks that all gc.relocaes observed in safepoint
must be lowered. However Fast-Isel is able to skip dead gc.relocate.
To resolve this issue we just ignore dead gc.relocate in the check.
Reviewers: reames
Reviewed By: reames
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D60184
llvm-svn: 357742
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/StatepointLowering.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.h b/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.h index a4fdce515b9..70507932681 100644 --- a/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.h +++ b/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.h @@ -66,13 +66,18 @@ public: /// before the next statepoint. If we don't see it, we'll report /// an assertion. void scheduleRelocCall(const CallInst &RelocCall) { - PendingGCRelocateCalls.push_back(&RelocCall); + // We are not interested in lowering dead instructions. + if (!RelocCall.use_empty()) + PendingGCRelocateCalls.push_back(&RelocCall); } /// Remove this gc_relocate from the list we're expecting to see /// before the next statepoint. If we weren't expecting to see /// it, we'll report an assertion. void relocCallVisited(const CallInst &RelocCall) { + // We are not interested in lowering dead instructions. + if (RelocCall.use_empty()) + return; auto I = llvm::find(PendingGCRelocateCalls, &RelocCall); assert(I != PendingGCRelocateCalls.end() && "Visited unexpected gcrelocate call"); |