[llvm] r269764 - [RewriteStatepointsForGC] Remove obsolete assertion

Igor Laevsky via llvm-commits llvm-commits at lists.llvm.org
Tue May 17 06:54:10 PDT 2016


Author: igor.laevsky
Date: Tue May 17 08:54:10 2016
New Revision: 269764

URL: http://llvm.org/viewvc/llvm-project?rev=269764&view=rev
Log:
[RewriteStatepointsForGC] Remove obsolete assertion

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)

Differential Revision: http://reviews.llvm.org/D20293


Modified:
    llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
    llvm/trunk/test/Transforms/RewriteStatepointsForGC/constants.ll

Modified: llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp?rev=269764&r1=269763&r2=269764&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp Tue May 17 08:54:10 2016
@@ -1055,14 +1055,6 @@ findBasePointers(const StatepointLiveSet
             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.");
   }
 }
 

Modified: llvm/trunk/test/Transforms/RewriteStatepointsForGC/constants.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/RewriteStatepointsForGC/constants.ll?rev=269764&r1=269763&r2=269764&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/RewriteStatepointsForGC/constants.ll (original)
+++ llvm/trunk/test/Transforms/RewriteStatepointsForGC/constants.ll Tue May 17 08:54:10 2016
@@ -95,3 +95,25 @@ entry:
   %res = extractelement <2 x i8 addrspace(1)*> <i8 addrspace(1)* @G, i8 addrspace(1)* @G>, i32 0
   ret i8 addrspace(1)* %res
 }
+
+define i8 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 = getelementptr i8, i8 addrspace(1)* null, i64 %arg
+  call void @foo() [ "deopt"() ]
+  ret i8 addrspace(1)* %load_addr
+}
+
+define i8 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 = getelementptr i8, i8 addrspace(1)* inttoptr (i64 15 to i8 addrspace(1)*), i64 %arg
+  call void @foo() [ "deopt"() ]
+  ret i8 addrspace(1)* %load_addr
+}




More information about the llvm-commits mailing list