Skip to content

Commit

Permalink
Remove br undef in SafePointIRVerifier directory
Browse files Browse the repository at this point in the history
  • Loading branch information
leewei05 committed Nov 6, 2024
1 parent f1146b2 commit 5ee4e9b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

; In %merge %val.unrelocated, %ptr and %arg should be unrelocated.
; FIXME: if this test fails it is a false-positive alarm. IR is correct.
define void @test.unrelocated-phi.ok(ptr addrspace(1) %arg) gc "statepoint-example" {
define void @test.unrelocated-phi.ok(ptr addrspace(1) %arg, i1 %new_arg) gc "statepoint-example" {
; CHECK-LABEL: Verifying gc pointers in function: test.unrelocated-phi.ok
bci_0:
%ptr = getelementptr i8, ptr addrspace(1) %arg, i64 4
br i1 undef, label %left, label %right
br i1 %new_arg, label %left, label %right

left:
%safepoint_token = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr undef, i32 0, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
Expand Down
4 changes: 2 additions & 2 deletions llvm/test/SafepointIRVerifier/unrecorded-live-at-sp.ll
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ declare ptr addrspace(1) @generate_obj2() #1
declare ptr addrspace(1) @generate_obj3() #1

; Function Attrs: nounwind
define void @test(ptr addrspace(1), ptr addrspace(1), i32) #3 gc "statepoint-example" {
define void @test(ptr addrspace(1), ptr addrspace(1), i32, i1 %new_arg) #3 gc "statepoint-example" {
bci_0:
%result608 = call ptr addrspace(1) @generate_obj3()
br label %bci_37-aload
Expand All @@ -24,7 +24,7 @@ bci_37-aload: ; preds = %not_zero179, %bci_0
%base_phi2 = phi ptr addrspace(1) [ %base_phi3, %not_zero179 ], [ %result608, %bci_0 ], !is_base_value !0
%relocated8 = phi ptr addrspace(1) [ %relocated7.relocated, %not_zero179 ], [ %result608, %bci_0 ]
%tmp3 = getelementptr inbounds %jObject, ptr addrspace(1) %relocated8, i64 0, i32 0, i64 32
br i1 undef, label %not_zero179, label %not_zero146
br i1 %new_arg, label %not_zero179, label %not_zero146

not_zero146: ; preds = %bci_37-aload
%addr98.relocated = call ptr addrspace(1) @generate_obj2() #1
Expand Down
32 changes: 16 additions & 16 deletions llvm/test/SafepointIRVerifier/uses-in-phi-nodes.ll
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
; RUN: opt -safepoint-ir-verifier-print-only -verify-safepoint-ir -S %s 2>&1 | FileCheck %s

define ptr addrspace(1) @test.not.ok.0(ptr addrspace(1) %arg) gc "statepoint-example" {
define ptr addrspace(1) @test.not.ok.0(ptr addrspace(1) %arg, i1 %new_arg) gc "statepoint-example" {
; CHECK-LABEL: Verifying gc pointers in function: test.not.ok.0
bci_0:
br i1 undef, label %left, label %right
br i1 %new_arg, label %left, label %right

left:
%safepoint_token = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(void ()) undef, i32 0, i32 0, i32 0, i32 0)
Expand All @@ -20,10 +20,10 @@ define ptr addrspace(1) @test.not.ok.0(ptr addrspace(1) %arg) gc "statepoint-exa
ret ptr addrspace(1) %val
}

define ptr addrspace(1) @test.not.ok.1(ptr addrspace(1) %arg) gc "statepoint-example" {
define ptr addrspace(1) @test.not.ok.1(ptr addrspace(1) %arg, i1 %new_arg) gc "statepoint-example" {
; CHECK-LABEL: Verifying gc pointers in function: test.not.ok.1
bci_0:
br i1 undef, label %left, label %right
br i1 %new_arg, label %left, label %right

left:
%safepoint_token = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(void ()) undef, i32 0, i32 0, i32 0, i32 0)
Expand All @@ -40,10 +40,10 @@ define ptr addrspace(1) @test.not.ok.1(ptr addrspace(1) %arg) gc "statepoint-exa
ret ptr addrspace(1) %val
}

define ptr addrspace(1) @test.ok.0(ptr addrspace(1) %arg) gc "statepoint-example" {
define ptr addrspace(1) @test.ok.0(ptr addrspace(1) %arg, i1 %new_arg) gc "statepoint-example" {
; CHECK: No illegal uses found by SafepointIRVerifier in: test.ok.0
bci_0:
br i1 undef, label %left, label %right
br i1 %new_arg, label %left, label %right

left:
%safepoint_token = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(void ()) undef, i32 0, i32 0, i32 0, i32 0)
Expand All @@ -57,10 +57,10 @@ define ptr addrspace(1) @test.ok.0(ptr addrspace(1) %arg) gc "statepoint-example
ret ptr addrspace(1) %val
}

define ptr addrspace(1) @test.ok.1(ptr addrspace(1) %arg) gc "statepoint-example" {
define ptr addrspace(1) @test.ok.1(ptr addrspace(1) %arg, i1 %new_arg) gc "statepoint-example" {
; CHECK: No illegal uses found by SafepointIRVerifier in: test.ok.1
bci_0:
br i1 undef, label %left, label %right
br i1 %new_arg, label %left, label %right

left:
call void @not_statepoint()
Expand All @@ -75,10 +75,10 @@ define ptr addrspace(1) @test.ok.1(ptr addrspace(1) %arg) gc "statepoint-example
}

; It should be allowed to compare poisoned ptr with null.
define void @test.poisoned.cmp.ok(ptr addrspace(1) %arg) gc "statepoint-example" {
define void @test.poisoned.cmp.ok(ptr addrspace(1) %arg, i1 %new_arg) gc "statepoint-example" {
; CHECK-LABEL: Verifying gc pointers in function: test.poisoned.cmp.ok
bci_0:
br i1 undef, label %left, label %right
br i1 %new_arg, label %left, label %right

left:
%safepoint_token = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(void ()) undef, i32 0, i32 0, i32 0, i32 0) ["gc-live"(ptr addrspace(1) %arg)]
Expand All @@ -97,10 +97,10 @@ define void @test.poisoned.cmp.ok(ptr addrspace(1) %arg) gc "statepoint-example"
}

; It is illegal to compare poisoned ptr and relocated.
define void @test.poisoned.cmp.fail.0(ptr addrspace(1) %arg) gc "statepoint-example" {
define void @test.poisoned.cmp.fail.0(ptr addrspace(1) %arg, i1 %new_arg) gc "statepoint-example" {
; CHECK-LABEL: Verifying gc pointers in function: test.poisoned.cmp.fail.0
bci_0:
br i1 undef, label %left, label %right
br i1 %new_arg, label %left, label %right

left:
%safepoint_token = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(void ()) undef, i32 0, i32 0, i32 0, i32 0) ["gc-live"(ptr addrspace(1) %arg)]
Expand All @@ -123,10 +123,10 @@ define void @test.poisoned.cmp.fail.0(ptr addrspace(1) %arg) gc "statepoint-exam
}

; It is illegal to compare poisoned ptr and unrelocated.
define void @test.poisoned.cmp.fail.1(ptr addrspace(1) %arg) gc "statepoint-example" {
define void @test.poisoned.cmp.fail.1(ptr addrspace(1) %arg, i1 %new_arg) gc "statepoint-example" {
; CHECK-LABEL: Verifying gc pointers in function: test.poisoned.cmp.fail.1
bci_0:
br i1 undef, label %left, label %right
br i1 %new_arg, label %left, label %right

left:
%safepoint_token = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(void ()) undef, i32 0, i32 0, i32 0, i32 0) ["gc-live"(ptr addrspace(1) %arg)]
Expand All @@ -148,10 +148,10 @@ define void @test.poisoned.cmp.fail.1(ptr addrspace(1) %arg) gc "statepoint-exam
}

; It should be allowed to compare unrelocated phi with unrelocated value.
define void @test.unrelocated-phi.cmp.ok(ptr addrspace(1) %arg) gc "statepoint-example" {
define void @test.unrelocated-phi.cmp.ok(ptr addrspace(1) %arg, i1 %new_arg) gc "statepoint-example" {
; CHECK-LABEL: Verifying gc pointers in function: test.unrelocated-phi.cmp.ok
bci_0:
br i1 undef, label %left, label %right
br i1 %new_arg, label %left, label %right

left:
%safepoint_token = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(void ()) undef, i32 0, i32 0, i32 0, i32 0)
Expand Down

0 comments on commit 5ee4e9b

Please sign in to comment.