[PATCH] D60182: [FastISel] Fix the crash in gc.result lowering

Serguei Katkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 2 23:49:55 PDT 2019


skatkov updated this revision to Diff 193438.

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60182/new/

https://reviews.llvm.org/D60182

Files:
  lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
  test/CodeGen/X86/fast-isel-gc-intrinsics.ll


Index: test/CodeGen/X86/fast-isel-gc-intrinsics.ll
===================================================================
--- test/CodeGen/X86/fast-isel-gc-intrinsics.ll
+++ test/CodeGen/X86/fast-isel-gc-intrinsics.ll
@@ -17,6 +17,8 @@
 entry:
   %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)
   %call1 = call zeroext i1 @llvm.experimental.gc.result.i1(token %safepoint_token)
+  br label %exit
+exit:
   ret i1 %call1
 }
 
Index: lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
===================================================================
--- lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -1721,7 +1721,8 @@
         // 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)) {
+        if (isa<CallInst>(Inst) && !isStatepoint(Inst) && !isGCRelocate(Inst) &&
+            !isGCResult(Inst)) {
           OptimizationRemarkMissed R("sdagisel", "FastISelFailure",
                                      Inst->getDebugLoc(), LLVMBB);
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60182.193438.patch
Type: text/x-patch
Size: 1311 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190403/b9428866/attachment.bin>


More information about the llvm-commits mailing list