From af3b6beef3296d83052609d7d9b41ef7bc586fdb Mon Sep 17 00:00:00 2001 From: Igor Laevsky Date: Tue, 17 May 2016 13:54:10 +0000 Subject: [PATCH] [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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269764 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/RewriteStatepointsForGC.cpp | 8 -------- .../RewriteStatepointsForGC/constants.ll | 22 ++++++++++++++++++++++ 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp b/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp index 1a2c6eedc1b..991147aeb04 100644 --- a/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp +++ b/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp @@ -1055,14 +1055,6 @@ findBasePointers(const StatepointLiveSetTy &live, DT->dominates(cast(base)->getParent(), cast(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(base) && - "the relocation code needs adjustment to handle the relocation of " - "a null pointer constant without causing false positives in the " - "safepoint ir verifier."); } } diff --git a/test/Transforms/RewriteStatepointsForGC/constants.ll b/test/Transforms/RewriteStatepointsForGC/constants.ll index 0ae0380c38e..68d6fd13934 100644 --- a/test/Transforms/RewriteStatepointsForGC/constants.ll +++ b/test/Transforms/RewriteStatepointsForGC/constants.ll @@ -95,3 +95,25 @@ entry: %res = extractelement <2 x i8 addrspace(1)*> , 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 +} -- 2.11.0