[PATCH] D60184: [FastISel] Fix crash for gc.relocate lowring
Serguei Katkov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 4 22:41:11 PDT 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL357742: [FastISel] Fix crash for gc.relocate lowring (authored by skatkov, committed by ).
Herald added a project: LLVM.
Changed prior to commit:
https://reviews.llvm.org/D60184?vs=193671&id=193834#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D60184/new/
https://reviews.llvm.org/D60184
Files:
llvm/trunk/lib/CodeGen/SelectionDAG/StatepointLowering.h
llvm/trunk/test/CodeGen/X86/fast-isel-gc-intrinsics.ll
Index: llvm/trunk/lib/CodeGen/SelectionDAG/StatepointLowering.h
===================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/StatepointLowering.h
+++ llvm/trunk/lib/CodeGen/SelectionDAG/StatepointLowering.h
@@ -66,13 +66,18 @@
/// 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");
Index: llvm/trunk/test/CodeGen/X86/fast-isel-gc-intrinsics.ll
===================================================================
--- llvm/trunk/test/CodeGen/X86/fast-isel-gc-intrinsics.ll
+++ llvm/trunk/test/CodeGen/X86/fast-isel-gc-intrinsics.ll
@@ -29,6 +29,8 @@
%safepoint_token = tail call token (i64, i32, i1 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_i1f(i64 0, i32 0, i1 ()* @return_i1, i32 0, i32 0, i32 0, i32 0, i8 addrspace(1)* %v)
%call1 = call zeroext i1 @llvm.experimental.gc.result.i1(token %safepoint_token)
%vnew = call i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token %safepoint_token, i32 7, i32 7)
+ br label %exit
+exit:
ret i1 %call1
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60184.193834.patch
Type: text/x-patch
Size: 1821 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190405/6ad89e0b/attachment.bin>
More information about the llvm-commits
mailing list