[PATCH] D20293: [RewriteStatepointsForGC] Remove obsolete assertion

Igor Laevsky via llvm-commits llvm-commits at lists.llvm.org
Mon May 16 11:31:30 PDT 2016


igor-laevsky created this revision.
igor-laevsky added a reviewer: reames.
igor-laevsky added a subscriber: llvm-commits.
Herald added a subscriber: sanjoy.

This is assertion is no longer necessary since we never record constants in the live set anyway. (They are never recorded in the initial live set, and constant bases are removed near line 2119)

http://reviews.llvm.org/D20293

Files:
  lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
  test/Transforms/RewriteStatepointsForGC/constants.ll

Index: test/Transforms/RewriteStatepointsForGC/constants.ll
===================================================================
--- test/Transforms/RewriteStatepointsForGC/constants.ll
+++ test/Transforms/RewriteStatepointsForGC/constants.ll
@@ -95,3 +95,27 @@
   %res = extractelement <2 x i8 addrspace(1)*> <i8 addrspace(1)* @G, i8 addrspace(1)* @G>, i32 0
   ret i8 addrspace(1)* %res
 }
+
+define i32 addrspace(1)* @test6(i64 %arg) gc "statepoint-example" {
+entry:
+  ; Don't fail any assertions and don't record null as a live value
+  ; CHECK-LABEL: test6
+  ; CHECK: gc.statepoint
+  ; CHECK-NOT: call {{.*}}gc.relocate
+  %load_addr.i.i.i7 = getelementptr i8, i8 addrspace(1)* null, i64 %arg
+  call void @foo() [ "deopt"() ]
+  %res = bitcast i8 addrspace(1)* %load_addr.i.i.i7 to i32 addrspace(1)*
+  ret i32 addrspace(1)* %res
+}
+
+define i32 addrspace(1)* @test7(i64 %arg) gc "statepoint-example" {
+entry:
+  ; Same as test7 but use regular constant instead of a null
+  ; CHECK-LABEL: test7
+  ; CHECK: gc.statepoint
+  ; CHECK-NOT: call {{.*}}gc.relocate
+  %load_addr.i.i.i7 = getelementptr i8, i8 addrspace(1)* inttoptr (i64 15 to i8 addrspace(1)*), i64 %arg
+  call void @foo() [ "deopt"() ]
+  %res = bitcast i8 addrspace(1)* %load_addr.i.i.i7 to i32 addrspace(1)*
+  ret i32 addrspace(1)* %res
+}
Index: lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
===================================================================
--- lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
+++ lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
@@ -1055,14 +1055,6 @@
             DT->dominates(cast<Instruction>(base)->getParent(),
                           cast<Instruction>(ptr)->getParent())) &&
            "The base we found better dominate the derived pointer");
-
-    // If you see this trip and like to live really dangerously, the code should
-    // be correct, just with idioms the verifier can't handle.  You can try
-    // disabling the verifier at your own substantial risk.
-    assert(!isa<ConstantPointerNull>(base) &&
-           "the relocation code needs adjustment to handle the relocation of "
-           "a null pointer constant without causing false positives in the "
-           "safepoint ir verifier.");
   }
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20293.57377.patch
Type: text/x-patch
Size: 2254 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160516/36b96fcf/attachment.bin>


More information about the llvm-commits mailing list