[llvm] d1c1a11 - [SafepointIRVerifier] Convert tests to opaque pointers (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 3 05:15:06 PST 2023
Author: Nikita Popov
Date: 2023-01-03T14:14:57+01:00
New Revision: d1c1a1187eeb78a6ba0dabfdde2c453f57787413
URL: https://github.com/llvm/llvm-project/commit/d1c1a1187eeb78a6ba0dabfdde2c453f57787413
DIFF: https://github.com/llvm/llvm-project/commit/d1c1a1187eeb78a6ba0dabfdde2c453f57787413.diff
LOG: [SafepointIRVerifier] Convert tests to opaque pointers (NFC)
Added:
Modified:
llvm/test/SafepointIRVerifier/basic-use-after-reloc.ll
llvm/test/SafepointIRVerifier/compares.ll
llvm/test/SafepointIRVerifier/constant-bases.ll
llvm/test/SafepointIRVerifier/from-same-relocation-in-phi-nodes.ll
llvm/test/SafepointIRVerifier/hidden-constant-base.ll
llvm/test/SafepointIRVerifier/unreachable-block-tolerant.ll
llvm/test/SafepointIRVerifier/unrecorded-live-at-sp.ll
llvm/test/SafepointIRVerifier/use-derived-unrelocated.ll
Removed:
################################################################################
diff --git a/llvm/test/SafepointIRVerifier/basic-use-after-reloc.ll b/llvm/test/SafepointIRVerifier/basic-use-after-reloc.ll
index 05eec922e0a0a..0aa4a67910874 100644
--- a/llvm/test/SafepointIRVerifier/basic-use-after-reloc.ll
+++ b/llvm/test/SafepointIRVerifier/basic-use-after-reloc.ll
@@ -7,17 +7,17 @@
%jObject = type { [8 x i8] }
; Function Attrs: nounwind
-define %jObject addrspace(1)* @test(%jObject addrspace(1)* %arg) gc "statepoint-example" {
+define ptr addrspace(1) @test(ptr addrspace(1) %arg) gc "statepoint-example" {
bci_0:
- %safepoint_token3 = tail call token (i64, i32, double (double)*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_f64f64f(i64 0, i32 0, double (double)* elementtype(double (double)) undef, i32 1, i32 0, double undef, i32 0, i32 0) ["gc-live"(%jObject addrspace(1)* %arg)]
- %arg2.relocated4 = call coldcc %jObject addrspace(1)* @llvm.experimental.gc.relocate.p1jObject(token %safepoint_token3, i32 0, i32 0)
- ret %jObject addrspace(1)* %arg
+ %safepoint_token3 = tail call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(double (double)) undef, i32 1, i32 0, double undef, i32 0, i32 0) ["gc-live"(ptr addrspace(1) %arg)]
+ %arg2.relocated4 = call coldcc ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %safepoint_token3, i32 0, i32 0)
+ ret ptr addrspace(1) %arg
; CHECK: Illegal use of unrelocated value found!
-; CHECK-NEXT: Def: %jObject addrspace(1)* %arg
-; CHECK-NEXT: Use: ret %jObject addrspace(1)* %arg
+; CHECK-NEXT: Def: ptr addrspace(1) %arg
+; CHECK-NEXT: Use: ret ptr addrspace(1) %arg
}
; Function Attrs: nounwind
-declare %jObject addrspace(1)* @llvm.experimental.gc.relocate.p1jObject(token, i32, i32) #3
+declare ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token, i32, i32) #3
-declare token @llvm.experimental.gc.statepoint.p0f_f64f64f(i64, i32, double (double)*, i32, i32, ...)
+declare token @llvm.experimental.gc.statepoint.p0(i64, i32, ptr, i32, i32, ...)
diff --git a/llvm/test/SafepointIRVerifier/compares.ll b/llvm/test/SafepointIRVerifier/compares.ll
index ab82414dea2cd..99b399d48273b 100644
--- a/llvm/test/SafepointIRVerifier/compares.ll
+++ b/llvm/test/SafepointIRVerifier/compares.ll
@@ -5,81 +5,81 @@
; comparison against null.
-define i8 addrspace(1)* @test1(i64 %arg, i8 addrspace(1)* %addr) gc "statepoint-example" {
+define ptr addrspace(1) @test1(i64 %arg, ptr addrspace(1) %addr) gc "statepoint-example" {
; CHECK: No illegal uses found by SafepointIRVerifier in: test1
entry:
- %load_addr = getelementptr i8, i8 addrspace(1)* %addr, i64 %arg
- %safepoint_token = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* elementtype(void ()) undef, i32 0, i32 0, i32 0, i32 0)
- %cmp = icmp eq i8 addrspace(1)* %load_addr, null
- ret i8 addrspace(1)* null
+ %load_addr = getelementptr i8, ptr addrspace(1) %addr, i64 %arg
+ %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)
+ %cmp = icmp eq ptr addrspace(1) %load_addr, null
+ ret ptr addrspace(1) null
}
; comparison against exclusively derived null.
-define void @test2(i64 %arg, i1 %cond, i8 addrspace(1)* %addr) gc "statepoint-example" {
+define void @test2(i64 %arg, i1 %cond, ptr addrspace(1) %addr) gc "statepoint-example" {
; CHECK: No illegal uses found by SafepointIRVerifier in: test2
- %load_addr = getelementptr i8, i8 addrspace(1)* null, i64 %arg
- %load_addr_sel = select i1 %cond, i8 addrspace(1)* null, i8 addrspace(1)* %load_addr
- %safepoint_token = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* elementtype(void ()) undef, i32 0, i32 0, i32 0, i32 0)
- %cmp = icmp eq i8 addrspace(1)* %addr, %load_addr_sel
+ %load_addr = getelementptr i8, ptr addrspace(1) null, i64 %arg
+ %load_addr_sel = select i1 %cond, ptr addrspace(1) null, ptr addrspace(1) %load_addr
+ %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)
+ %cmp = icmp eq ptr addrspace(1) %addr, %load_addr_sel
ret void
}
; comparison against a constant non-null pointer. This is unrelocated use, since
; that pointer bits may mean something in a VM.
-define void @test3(i64 %arg, i32 addrspace(1)* %addr) gc "statepoint-example" {
+define void @test3(i64 %arg, ptr addrspace(1) %addr) gc "statepoint-example" {
; CHECK-LABEL: Verifying gc pointers in function: test3
; CHECK: Illegal use of unrelocated value found!
entry:
- %load_addr = getelementptr i32, i32 addrspace(1)* %addr, i64 %arg
- %load_addr_const = getelementptr i32, i32 addrspace(1)* inttoptr (i64 15 to i32 addrspace(1)*), i64 %arg
- %safepoint_token = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* elementtype(void ()) undef, i32 0, i32 0, i32 0, i32 0)
- %cmp = icmp eq i32 addrspace(1)* %load_addr, %load_addr_const
+ %load_addr = getelementptr i32, ptr addrspace(1) %addr, i64 %arg
+ %load_addr_const = getelementptr i32, ptr addrspace(1) inttoptr (i64 15 to ptr addrspace(1)), i64 %arg
+ %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)
+ %cmp = icmp eq ptr addrspace(1) %load_addr, %load_addr_const
ret void
}
; comparison against a derived pointer that is *not* exclusively derived from
; null. An unrelocated use since the derived pointer could be from the constant
; non-null pointer (load_addr.2).
-define void @test4(i64 %arg, i1 %cond, i8 addrspace(1)* %base) gc "statepoint-example" {
+define void @test4(i64 %arg, i1 %cond, ptr addrspace(1) %base) gc "statepoint-example" {
; CHECK-LABEL: Verifying gc pointers in function: test4
; CHECK: Illegal use of unrelocated value found!
entry:
- %load_addr.1 = getelementptr i8, i8 addrspace(1)* null, i64 %arg
+ %load_addr.1 = getelementptr i8, ptr addrspace(1) null, i64 %arg
br i1 %cond, label %split, label %join
split:
- %load_addr.2 = getelementptr i8, i8 addrspace(1)* inttoptr (i64 30 to i8 addrspace(1)*), i64 %arg
+ %load_addr.2 = getelementptr i8, ptr addrspace(1) inttoptr (i64 30 to ptr addrspace(1)), i64 %arg
br label %join
join:
- %load_addr = phi i8 addrspace(1)* [%load_addr.1, %entry], [%load_addr.2, %split]
- %safepoint_token = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* elementtype(void ()) undef, i32 0, i32 0, i32 0, i32 0)
- %cmp = icmp eq i8 addrspace(1)* %load_addr, %base
+ %load_addr = phi ptr addrspace(1) [%load_addr.1, %entry], [%load_addr.2, %split]
+ %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)
+ %cmp = icmp eq ptr addrspace(1) %load_addr, %base
ret void
}
; comparison between 2 unrelocated base pointers.
; Since the cmp can be reordered legally before the safepoint, these are correct
; unrelocated uses of the pointers.
-define void @test5(i64 %arg, i8 addrspace(1)* %base1, i8 addrspace(1)* %base2) gc "statepoint-example" {
+define void @test5(i64 %arg, ptr addrspace(1) %base1, ptr addrspace(1) %base2) gc "statepoint-example" {
; CHECK: No illegal uses found by SafepointIRVerifier in: test5
- %load_addr1 = getelementptr i8, i8 addrspace(1)* %base1, i64 %arg
- %load_addr2 = getelementptr i8, i8 addrspace(1)* %base2, i64 %arg
- %safepoint_token = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* elementtype(void ()) undef, i32 0, i32 0, i32 0, i32 0)
- %cmp = icmp eq i8 addrspace(1)* %load_addr1, %load_addr2
+ %load_addr1 = getelementptr i8, ptr addrspace(1) %base1, i64 %arg
+ %load_addr2 = getelementptr i8, ptr addrspace(1) %base2, i64 %arg
+ %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)
+ %cmp = icmp eq ptr addrspace(1) %load_addr1, %load_addr2
ret void
}
; comparison between a relocated and an unrelocated pointer.
; this is invalid use of the unrelocated pointer.
-define void @test6(i64 %arg, i8 addrspace(1)* %base1, i8 addrspace(1)* %base2) gc "statepoint-example" {
+define void @test6(i64 %arg, ptr addrspace(1) %base1, ptr addrspace(1) %base2) gc "statepoint-example" {
; CHECK-LABEL: Verifying gc pointers in function: test6
; CHECK: Illegal use of unrelocated value found!
- %load_addr1 = getelementptr i8, i8 addrspace(1)* %base1, i64 %arg
- %safepoint_token = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* elementtype(void ()) undef, i32 0, i32 0, i32 0, i32 0) ["gc-live"(i8 addrspace(1)* %base2)]
- %ptr2.relocated = call i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token %safepoint_token, i32 0, i32 0) ; base2, base2
- %cmp = icmp eq i8 addrspace(1)* %load_addr1, %ptr2.relocated
+ %load_addr1 = getelementptr i8, ptr addrspace(1) %base1, i64 %arg
+ %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) %base2)]
+ %ptr2.relocated = call ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %safepoint_token, i32 0, i32 0) ; base2, base2
+ %cmp = icmp eq ptr addrspace(1) %load_addr1, %ptr2.relocated
ret void
}
-declare token @llvm.experimental.gc.statepoint.p0f_isVoidf(i64, i32, void ()*, i32, i32, ...)
-declare i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token, i32, i32)
+declare token @llvm.experimental.gc.statepoint.p0(i64, i32, ptr, i32, i32, ...)
+declare ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token, i32, i32)
diff --git a/llvm/test/SafepointIRVerifier/constant-bases.ll b/llvm/test/SafepointIRVerifier/constant-bases.ll
index 4973321c98890..ed370c04f2fe8 100644
--- a/llvm/test/SafepointIRVerifier/constant-bases.ll
+++ b/llvm/test/SafepointIRVerifier/constant-bases.ll
@@ -1,70 +1,69 @@
; RUN: opt -safepoint-ir-verifier-print-only -verify-safepoint-ir -S %s 2>&1 | FileCheck %s
-define i8 addrspace(1)* @test1(i64 %arg) gc "statepoint-example" {
+define ptr addrspace(1) @test1(i64 %arg) gc "statepoint-example" {
; CHECK: No illegal uses found by SafepointIRVerifier in: test1
entry:
- %safepoint_token = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* elementtype(void ()) undef, i32 0, i32 0, i32 0, i32 0)
- ret i8 addrspace(1)* null
+ %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)
+ ret ptr addrspace(1) null
}
-define i8 addrspace(1)* @test2(i64 %arg) gc "statepoint-example" {
+define ptr addrspace(1) @test2(i64 %arg) gc "statepoint-example" {
; CHECK: No illegal uses found by SafepointIRVerifier in: test2
entry:
- %load_addr = getelementptr i8, i8 addrspace(1)* inttoptr (i64 15 to i8 addrspace(1)*), i64 %arg
- %safepoint_token = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* elementtype(void ()) undef, i32 0, i32 0, i32 0, i32 0)
- ret i8 addrspace(1)* %load_addr
+ %load_addr = getelementptr i8, ptr addrspace(1) inttoptr (i64 15 to ptr addrspace(1)), i64 %arg
+ %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)
+ ret ptr addrspace(1) %load_addr
}
-define i8 addrspace(1)* @test3(i64 %arg) gc "statepoint-example" {
+define ptr addrspace(1) @test3(i64 %arg) gc "statepoint-example" {
; CHECK: No illegal uses found by SafepointIRVerifier in: test3
entry:
- %load_addr = getelementptr i32, i32 addrspace(1)* inttoptr (i64 15 to i32 addrspace(1)*), i64 %arg
- %load_addr.cast = bitcast i32 addrspace(1)* %load_addr to i8 addrspace(1)*
- %safepoint_token = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* elementtype(void ()) undef, i32 0, i32 0, i32 0, i32 0)
- ret i8 addrspace(1)* %load_addr.cast
+ %load_addr = getelementptr i32, ptr addrspace(1) inttoptr (i64 15 to ptr addrspace(1)), i64 %arg
+ %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)
+ ret ptr addrspace(1) %load_addr
}
-define i8 addrspace(1)* @test4(i64 %arg, i1 %cond) gc "statepoint-example" {
+define ptr addrspace(1) @test4(i64 %arg, i1 %cond) gc "statepoint-example" {
; CHECK: No illegal uses found by SafepointIRVerifier in: test4
entry:
- %load_addr.1 = getelementptr i8, i8 addrspace(1)* inttoptr (i64 15 to i8 addrspace(1)*), i64 %arg
+ %load_addr.1 = getelementptr i8, ptr addrspace(1) inttoptr (i64 15 to ptr addrspace(1)), i64 %arg
br i1 %cond, label %split, label %join
split:
- %load_addr.2 = getelementptr i8, i8 addrspace(1)* inttoptr (i64 30 to i8 addrspace(1)*), i64 %arg
+ %load_addr.2 = getelementptr i8, ptr addrspace(1) inttoptr (i64 30 to ptr addrspace(1)), i64 %arg
br label %join
join:
- %load_addr = phi i8 addrspace(1)* [%load_addr.1, %entry], [%load_addr.2, %split]
- %safepoint_token = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* elementtype(void ()) undef, i32 0, i32 0, i32 0, i32 0)
- ret i8 addrspace(1)* %load_addr
+ %load_addr = phi ptr addrspace(1) [%load_addr.1, %entry], [%load_addr.2, %split]
+ %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)
+ ret ptr addrspace(1) %load_addr
}
-define i8 addrspace(1)* @test5(i64 %arg, i1 %cond) gc "statepoint-example" {
+define ptr addrspace(1) @test5(i64 %arg, i1 %cond) gc "statepoint-example" {
; CHECK: No illegal uses found by SafepointIRVerifier in: test5
entry:
- %load_addr.1 = getelementptr i8, i8 addrspace(1)* inttoptr (i64 15 to i8 addrspace(1)*), i64 %arg
- %load_addr.2 = getelementptr i8, i8 addrspace(1)* inttoptr (i64 30 to i8 addrspace(1)*), i64 %arg
- %load_addr = select i1 %cond, i8 addrspace(1)* %load_addr.1, i8 addrspace(1)* %load_addr.2
- %safepoint_token = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* elementtype(void ()) undef, i32 0, i32 0, i32 0, i32 0)
- ret i8 addrspace(1)* %load_addr
+ %load_addr.1 = getelementptr i8, ptr addrspace(1) inttoptr (i64 15 to ptr addrspace(1)), i64 %arg
+ %load_addr.2 = getelementptr i8, ptr addrspace(1) inttoptr (i64 30 to ptr addrspace(1)), i64 %arg
+ %load_addr = select i1 %cond, ptr addrspace(1) %load_addr.1, ptr addrspace(1) %load_addr.2
+ %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)
+ ret ptr addrspace(1) %load_addr
}
-define i8 addrspace(1)* @test6(i64 %arg, i1 %cond, i8 addrspace(1)* %base) gc "statepoint-example" {
+define ptr addrspace(1) @test6(i64 %arg, i1 %cond, ptr addrspace(1) %base) gc "statepoint-example" {
; CHECK-LABEL: Verifying gc pointers in function: test6
; CHECK: Illegal use of unrelocated value found!
entry:
- %load_addr.1 = getelementptr i8, i8 addrspace(1)* %base, i64 %arg
+ %load_addr.1 = getelementptr i8, ptr addrspace(1) %base, i64 %arg
br i1 %cond, label %split, label %join
split:
- %load_addr.2 = getelementptr i8, i8 addrspace(1)* inttoptr (i64 30 to i8 addrspace(1)*), i64 %arg
+ %load_addr.2 = getelementptr i8, ptr addrspace(1) inttoptr (i64 30 to ptr addrspace(1)), i64 %arg
br label %join
join:
- %load_addr = phi i8 addrspace(1)* [%load_addr.1, %entry], [%load_addr.2, %split]
- %safepoint_token = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* elementtype(void ()) undef, i32 0, i32 0, i32 0, i32 0)
- ret i8 addrspace(1)* %load_addr
+ %load_addr = phi ptr addrspace(1) [%load_addr.1, %entry], [%load_addr.2, %split]
+ %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)
+ ret ptr addrspace(1) %load_addr
}
-declare token @llvm.experimental.gc.statepoint.p0f_isVoidf(i64, i32, void ()*, i32, i32, ...)
+declare token @llvm.experimental.gc.statepoint.p0(i64, i32, ptr, i32, i32, ...)
diff --git a/llvm/test/SafepointIRVerifier/from-same-relocation-in-phi-nodes.ll b/llvm/test/SafepointIRVerifier/from-same-relocation-in-phi-nodes.ll
index 4df19b2d72622..a38651a5a1e4e 100644
--- a/llvm/test/SafepointIRVerifier/from-same-relocation-in-phi-nodes.ll
+++ b/llvm/test/SafepointIRVerifier/from-same-relocation-in-phi-nodes.ll
@@ -3,14 +3,14 @@
; 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(i8 addrspace(1)* %arg) gc "statepoint-example" {
+define void @test.unrelocated-phi.ok(ptr addrspace(1) %arg) gc "statepoint-example" {
; CHECK-LABEL: Verifying gc pointers in function: test.unrelocated-phi.ok
bci_0:
- %ptr = getelementptr i8, i8 addrspace(1)* %arg, i64 4
+ %ptr = getelementptr i8, ptr addrspace(1) %arg, i64 4
br i1 undef, label %left, label %right
left:
- %safepoint_token = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* undef, i32 0, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
+ %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)
br label %merge
right:
@@ -18,9 +18,9 @@ define void @test.unrelocated-phi.ok(i8 addrspace(1)* %arg) gc "statepoint-examp
merge:
; CHECK: No illegal uses found by SafepointIRVerifier in: test.unrelocated-phi.ok
- %val.unrelocated = phi i8 addrspace(1)* [ %arg, %left ], [ %ptr, %right ]
- %c = icmp eq i8 addrspace(1)* %val.unrelocated, %arg
+ %val.unrelocated = phi ptr addrspace(1) [ %arg, %left ], [ %ptr, %right ]
+ %c = icmp eq ptr addrspace(1) %val.unrelocated, %arg
ret void
}
-declare token @llvm.experimental.gc.statepoint.p0f_isVoidf(i64, i32, void ()*, i32, i32, ...)
+declare token @llvm.experimental.gc.statepoint.p0(i64, i32, ptr, i32, i32, ...)
diff --git a/llvm/test/SafepointIRVerifier/hidden-constant-base.ll b/llvm/test/SafepointIRVerifier/hidden-constant-base.ll
index eb03dda823d11..b9eba631fc45d 100644
--- a/llvm/test/SafepointIRVerifier/hidden-constant-base.ll
+++ b/llvm/test/SafepointIRVerifier/hidden-constant-base.ll
@@ -2,24 +2,24 @@
; CHECK-LABEL: Verifying gc pointers in function: test
; CHECK: No illegal uses found by SafepointIRVerifier in: test_gc_relocate
-define i8 addrspace(1)* @test_gc_relocate(i1 %arg) gc "statepoint-example" {
+define ptr addrspace(1) @test_gc_relocate(i1 %arg) gc "statepoint-example" {
bb:
br label %bb2
bb2: ; preds = %bb8, %bb
- %tmp = phi i8 addrspace(1)* [ %tmp5.relocated, %bb8 ], [ null, %bb ]
- %statepoint_token = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 2882400000, i32 0, void ()* elementtype(void ()) @widget, i32 0, i32 0, i32 0, i32 0) [ "deopt"() ]
+ %tmp = phi ptr addrspace(1) [ %tmp5.relocated, %bb8 ], [ null, %bb ]
+ %statepoint_token = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 2882400000, i32 0, ptr elementtype(void ()) @widget, i32 0, i32 0, i32 0, i32 0) [ "deopt"() ]
br label %bb4
bb4: ; preds = %bb8, %bb2
- %tmp5 = phi i8 addrspace(1)* [ %tmp5.relocated, %bb8 ], [ %tmp, %bb2 ]
- %statepoint_token1 = call token (i64, i32, i1 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_i1f(i64 2882400000, i32 0, i1 ()* elementtype(i1 ()) @baz, i32 0, i32 0, i32 0, i32 0) [ "deopt"(i8 addrspace(1)* %tmp5), "gc-live"(i8 addrspace(1)* %tmp5) ]
+ %tmp5 = phi ptr addrspace(1) [ %tmp5.relocated, %bb8 ], [ %tmp, %bb2 ]
+ %statepoint_token1 = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 2882400000, i32 0, ptr elementtype(i1 ()) @baz, i32 0, i32 0, i32 0, i32 0) [ "deopt"(ptr addrspace(1) %tmp5), "gc-live"(ptr addrspace(1) %tmp5) ]
%tmp62 = call i1 @llvm.experimental.gc.result.i1(token %statepoint_token1)
- %tmp5.relocated = call coldcc i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token %statepoint_token1, i32 0, i32 0) ; (%tmp5, %tmp5)
+ %tmp5.relocated = call coldcc ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %statepoint_token1, i32 0, i32 0) ; (%tmp5, %tmp5)
br i1 %tmp62, label %bb8, label %bb6
bb6: ; preds = %bb4
- ret i8 addrspace(1)* null
+ ret ptr addrspace(1) null
bb8: ; preds = %bb4
br i1 %arg, label %bb4, label %bb2
@@ -27,22 +27,21 @@ bb8: ; preds = %bb4
; CHECK-LABEL: Verifying gc pointers in function: test
; CHECK: No illegal uses found by SafepointIRVerifier in: test_freeze_inst
-define void @test_freeze_inst(i32* %ptr) gc "statepoint-example" {
+define void @test_freeze_inst(ptr %ptr) gc "statepoint-example" {
entry:
br label %loop
loop:
- %vptr = phi i8 addrspace(1)* [ %fptr, %loop ], [ undef, %entry ]
- %fptr = freeze i8 addrspace(1)* %vptr
- %statepoint_token = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* elementtype(void ()) undef, i32 0, i32 0, i32 0, i32 0) [ "deopt"(i8 addrspace(1)* %fptr), "gc-live"(i8 addrspace(1)* %fptr) ]
- %fptr.relocated = call coldcc i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token %statepoint_token, i32 0, i32 0) ; (%fptr, %fptr)
+ %vptr = phi ptr addrspace(1) [ %fptr, %loop ], [ undef, %entry ]
+ %fptr = freeze ptr addrspace(1) %vptr
+ %statepoint_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) [ "deopt"(ptr addrspace(1) %fptr), "gc-live"(ptr addrspace(1) %fptr) ]
+ %fptr.relocated = call coldcc ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %statepoint_token, i32 0, i32 0) ; (%fptr, %fptr)
br label %loop
}
declare void @widget()
declare i1 @baz()
-declare token @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 immarg, i32 immarg, void ()*, i32 immarg, i32 immarg, ...)
-declare token @llvm.experimental.gc.statepoint.p0f_i1f(i64 immarg, i32 immarg, i1 ()*, i32 immarg, i32 immarg, ...)
+declare token @llvm.experimental.gc.statepoint.p0(i64 immarg, i32 immarg, ptr, i32 immarg, i32 immarg, ...)
declare i1 @llvm.experimental.gc.result.i1(token)
-declare i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token, i32 immarg, i32 immarg)
+declare ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token, i32 immarg, i32 immarg)
diff --git a/llvm/test/SafepointIRVerifier/unreachable-block-tolerant.ll b/llvm/test/SafepointIRVerifier/unreachable-block-tolerant.ll
index 6aed320124cc9..1b579c848bc2c 100644
--- a/llvm/test/SafepointIRVerifier/unreachable-block-tolerant.ll
+++ b/llvm/test/SafepointIRVerifier/unreachable-block-tolerant.ll
@@ -5,41 +5,40 @@
%jObject = type { [8 x i8] }
-define %jObject addrspace(1)* @test(%jObject addrspace(1)* %arg) gc "statepoint-example" {
+define ptr addrspace(1) @test(ptr addrspace(1) %arg) gc "statepoint-example" {
; CHECK-LABEL: Verifying gc pointers in function: test
; CHECK-NEXT: No illegal uses found by SafepointIRVerifier in: test
- %safepoint_token3 = tail call token (i64, i32, double (double)*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_f64f64f(i64 0, i32 0, double (double)* elementtype(double (double)) undef, i32 1, i32 0, double undef, i32 0, i32 0) ["gc-live"(%jObject addrspace(1)* %arg)]
- %arg2.relocated4 = call coldcc %jObject addrspace(1)* @llvm.experimental.gc.relocate.p1jObject(token %safepoint_token3, i32 0, i32 0)
- ret %jObject addrspace(1)* %arg2.relocated4
+ %safepoint_token3 = tail call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(double (double)) undef, i32 1, i32 0, double undef, i32 0, i32 0) ["gc-live"(ptr addrspace(1) %arg)]
+ %arg2.relocated4 = call coldcc ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %safepoint_token3, i32 0, i32 0)
+ ret ptr addrspace(1) %arg2.relocated4
unreachable:
- ret %jObject addrspace(1)* null
+ ret ptr addrspace(1) null
}
; Function Attrs: nounwind
-declare %jObject addrspace(1)* @llvm.experimental.gc.relocate.p1jObject(token, i32, i32) #3
+declare ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token, i32, i32) #3
-declare token @llvm.experimental.gc.statepoint.p0f_f64f64f(i64, i32, double (double)*, i32, i32, ...)
+declare token @llvm.experimental.gc.statepoint.p0(i64, i32, ptr, i32, i32, ...)
; In %merge %val.unrelocated, %ptr and %arg should be unrelocated.
-define void @test2(i8 addrspace(1)* %arg) gc "statepoint-example" {
+define void @test2(ptr addrspace(1) %arg) gc "statepoint-example" {
; CHECK-LABEL: Verifying gc pointers in function: test2
; CHECK: No illegal uses found by SafepointIRVerifier in: test2
bci_0:
- %ptr = getelementptr i8, i8 addrspace(1)* %arg, i64 4
+ %ptr = getelementptr i8, ptr addrspace(1) %arg, i64 4
br label %right
left:
- %safepoint_token = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* elementtype(void ()) undef, i32 0, i32 0, i32 0, i32 0)
+ %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)
br label %merge
right:
br label %merge
merge:
- %val.unrelocated = phi i8 addrspace(1)* [ %arg, %left ], [ %ptr, %right ]
- %c = icmp eq i8 addrspace(1)* %val.unrelocated, %arg
+ %val.unrelocated = phi ptr addrspace(1) [ %arg, %left ], [ %ptr, %right ]
+ %c = icmp eq ptr addrspace(1) %val.unrelocated, %arg
ret void
}
-declare token @llvm.experimental.gc.statepoint.p0f_isVoidf(i64, i32, void ()*, i32, i32, ...)
diff --git a/llvm/test/SafepointIRVerifier/unrecorded-live-at-sp.ll b/llvm/test/SafepointIRVerifier/unrecorded-live-at-sp.ll
index 8fb9b432dcca3..b64851e76b716 100644
--- a/llvm/test/SafepointIRVerifier/unrecorded-live-at-sp.ll
+++ b/llvm/test/SafepointIRVerifier/unrecorded-live-at-sp.ll
@@ -1,67 +1,60 @@
; RUN: opt %s -safepoint-ir-verifier-print-only -verify-safepoint-ir -S 2>&1 | FileCheck %s
; CHECK: Illegal use of unrelocated value found!
-; CHECK-NEXT: Def: %base_phi4 = phi %jObject addrspace(1)* addrspace(1)* [ %addr98.relocated, %not_zero146 ], [ %cast6, %bci_37-aload ], !is_base_value !0
-; CHECK-NEXT: Use: %safepoint_token = tail call token (i64, i32, i32 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_i32f(i64 0, i32 0, i32 ()* elementtype(i32 ()) undef, i32 0, i32 0, i32 0, i32 0) [ "gc-live"(%jObject addrspace(1)* %base_phi1, %jObject addrspace(1)* addrspace(1)* %base_phi4, %jObject addrspace(1)* addrspace(1)* %relocated4, %jObject addrspace(1)* %relocated7) ]
+; CHECK-NEXT: Def: %base_phi4 = phi ptr addrspace(1) [ %addr98.relocated, %not_zero146 ], [ %base_phi2, %bci_37-aload ], !is_base_value !0
+; CHECK-NEXT: Use: %safepoint_token = tail call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(i32 ()) undef, i32 0, i32 0, i32 0, i32 0) [ "gc-live"(ptr addrspace(1) %base_phi1, ptr addrspace(1) %base_phi4, ptr addrspace(1) %relocated4, ptr addrspace(1) %relocated7) ]
%jObject = type { [8 x i8] }
-declare %jObject addrspace(1)* @generate_obj1() #1
+declare ptr addrspace(1) @generate_obj1() #1
-declare %jObject addrspace(1)* addrspace(1)* @generate_obj2() #1
+declare ptr addrspace(1) @generate_obj2() #1
-declare %jObject addrspace(1)* @generate_obj3() #1
+declare ptr addrspace(1) @generate_obj3() #1
; Function Attrs: nounwind
-define void @test(%jObject addrspace(1)*, %jObject addrspace(1)*, i32) #3 gc "statepoint-example" {
+define void @test(ptr addrspace(1), ptr addrspace(1), i32) #3 gc "statepoint-example" {
bci_0:
- %result608 = call %jObject addrspace(1)* @generate_obj3()
- %obj609 = bitcast %jObject addrspace(1)* %result608 to %jObject addrspace(1)*
- %cast = bitcast %jObject addrspace(1)* %result608 to %jObject addrspace(1)*
- %cast5 = bitcast %jObject addrspace(1)* %result608 to %jObject addrspace(1)*
+ %result608 = call ptr addrspace(1) @generate_obj3()
br label %bci_37-aload
bci_37-aload: ; preds = %not_zero179, %bci_0
- %base_phi = phi %jObject addrspace(1)* [ %base_phi1.relocated, %not_zero179 ], [ %cast, %bci_0 ], !is_base_value !0
- %base_phi2 = phi %jObject addrspace(1)* [ %base_phi3, %not_zero179 ], [ %cast5, %bci_0 ], !is_base_value !0
- %relocated8 = phi %jObject addrspace(1)* [ %relocated7.relocated, %not_zero179 ], [ %obj609, %bci_0 ]
- %tmp3 = getelementptr inbounds %jObject, %jObject addrspace(1)* %relocated8, i64 0, i32 0, i64 32
- %addr98 = bitcast i8 addrspace(1)* %tmp3 to %jObject addrspace(1)* addrspace(1)*
- %cast6 = bitcast %jObject addrspace(1)* %base_phi2 to %jObject addrspace(1)* addrspace(1)*
+ %base_phi = phi ptr addrspace(1) [ %base_phi1.relocated, %not_zero179 ], [ %result608, %bci_0 ], !is_base_value !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
not_zero146: ; preds = %bci_37-aload
- %addr98.relocated = call %jObject addrspace(1)* addrspace(1)* @generate_obj2() #1
- %obj609.relocated = call %jObject addrspace(1)* @generate_obj1() #1
+ %addr98.relocated = call ptr addrspace(1) @generate_obj2() #1
+ %obj609.relocated = call ptr addrspace(1) @generate_obj1() #1
br label %not_zero179
not_zero179: ; preds = %not_zero146, %bci_37-aload
- %base_phi1 = phi %jObject addrspace(1)* [ %obj609.relocated, %not_zero146 ], [ %base_phi, %bci_37-aload ], !is_base_value !0
- %base_phi3 = phi %jObject addrspace(1)* [ %obj609.relocated, %not_zero146 ], [ %base_phi2, %bci_37-aload ], !is_base_value !0
- %relocated7 = phi %jObject addrspace(1)* [ %obj609.relocated, %not_zero146 ], [ %relocated8, %bci_37-aload ]
- %base_phi4 = phi %jObject addrspace(1)* addrspace(1)* [ %addr98.relocated, %not_zero146 ], [ %cast6, %bci_37-aload ], !is_base_value !0
- %relocated4 = phi %jObject addrspace(1)* addrspace(1)* [ %addr98.relocated, %not_zero146 ], [ %addr98, %bci_37-aload ]
- %safepoint_token = tail call token (i64, i32, i32 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_i32f(i64 0, i32 0, i32 ()* elementtype(i32 ()) undef, i32 0, i32 0, i32 0, i32 0) ["gc-live"(%jObject addrspace(1)* %base_phi1, %jObject addrspace(1)* addrspace(1)* %base_phi4, %jObject addrspace(1)* addrspace(1)* %relocated4, %jObject addrspace(1)* %relocated7)]
+ %base_phi1 = phi ptr addrspace(1) [ %obj609.relocated, %not_zero146 ], [ %base_phi, %bci_37-aload ], !is_base_value !0
+ %base_phi3 = phi ptr addrspace(1) [ %obj609.relocated, %not_zero146 ], [ %base_phi2, %bci_37-aload ], !is_base_value !0
+ %relocated7 = phi ptr addrspace(1) [ %obj609.relocated, %not_zero146 ], [ %relocated8, %bci_37-aload ]
+ %base_phi4 = phi ptr addrspace(1) [ %addr98.relocated, %not_zero146 ], [ %base_phi2, %bci_37-aload ], !is_base_value !0
+ %relocated4 = phi ptr addrspace(1) [ %addr98.relocated, %not_zero146 ], [ %tmp3, %bci_37-aload ]
+ %safepoint_token = tail call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(i32 ()) undef, i32 0, i32 0, i32 0, i32 0) ["gc-live"(ptr addrspace(1) %base_phi1, ptr addrspace(1) %base_phi4, ptr addrspace(1) %relocated4, ptr addrspace(1) %relocated7)]
%tmp4 = call i32 @llvm.experimental.gc.result.i32(token %safepoint_token)
- %base_phi1.relocated = call coldcc %jObject addrspace(1)* @llvm.experimental.gc.relocate.p1jObject(token %safepoint_token, i32 0, i32 0)
- %base_phi4.relocated = call coldcc %jObject addrspace(1)* addrspace(1)* @llvm.experimental.gc.relocate.p1p1jObject(token %safepoint_token, i32 1, i32 1)
- %relocated4.relocated = call coldcc %jObject addrspace(1)* addrspace(1)* @llvm.experimental.gc.relocate.p1p1jObject(token %safepoint_token, i32 1, i32 2)
- %relocated7.relocated = call coldcc %jObject addrspace(1)* @llvm.experimental.gc.relocate.p1jObject(token %safepoint_token, i32 0, i32 3)
- %addr636 = bitcast %jObject addrspace(1)* addrspace(1)* %relocated4.relocated to %jObject addrspace(1)* addrspace(1)*
+ %base_phi1.relocated = call coldcc ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %safepoint_token, i32 0, i32 0)
+ %base_phi4.relocated = call coldcc ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %safepoint_token, i32 1, i32 1)
+ %relocated4.relocated = call coldcc ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %safepoint_token, i32 1, i32 2)
+ %relocated7.relocated = call coldcc ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %safepoint_token, i32 0, i32 3)
br label %bci_37-aload
}
-declare token @llvm.experimental.gc.statepoint.p0f_i32f(i64, i32, i32 ()*, i32, i32, ...)
+declare token @llvm.experimental.gc.statepoint.p0(i64, i32, ptr, i32, i32, ...)
; Function Attrs: nounwind
declare i32 @llvm.experimental.gc.result.i32(token) #4
; Function Attrs: nounwind
-declare %jObject addrspace(1)* @llvm.experimental.gc.relocate.p1jObject(token, i32, i32) #4
+declare ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token, i32, i32) #4
; Function Attrs: nounwind
-declare %jObject addrspace(1)* addrspace(1)* @llvm.experimental.gc.relocate.p1p1jObject(token, i32, i32) #4
attributes #0 = { noinline nounwind "gc-leaf-function"="true" }
attributes #1 = { "gc-leaf-function"="true" }
diff --git a/llvm/test/SafepointIRVerifier/use-derived-unrelocated.ll b/llvm/test/SafepointIRVerifier/use-derived-unrelocated.ll
index db7b72a1341ce..f352ada585bd4 100644
--- a/llvm/test/SafepointIRVerifier/use-derived-unrelocated.ll
+++ b/llvm/test/SafepointIRVerifier/use-derived-unrelocated.ll
@@ -1,149 +1,142 @@
; RUN: opt -safepoint-ir-verifier-print-only -verify-safepoint-ir -S %s 2>&1 | FileCheck %s
; Checking if verifier accepts chain of GEPs/bitcasts.
-define void @test.deriving.ok(i32, i8 addrspace(1)* %base1, i8 addrspace(1)* %base2) gc "statepoint-example" {
+define void @test.deriving.ok(i32, ptr addrspace(1) %base1, ptr addrspace(1) %base2) gc "statepoint-example" {
; CHECK-LABEL: Verifying gc pointers in function: test.deriving.ok
; CHECK-NEXT: No illegal uses found by SafepointIRVerifier in: test.deriving.ok
- %ptr = getelementptr i8, i8 addrspace(1)* %base1, i64 4
- %safepoint_token = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* elementtype(void ()) undef, i32 0, i32 0, i32 0, i32 0) ["gc-live"(i8 addrspace(1)* %base1)]
- %ptr2 = getelementptr i8, i8 addrspace(1)* %base2, i64 8
- %ptr.i32 = bitcast i8 addrspace(1)* %ptr to i32 addrspace(1)*
- %ptr2.i32 = bitcast i8 addrspace(1)* %ptr2 to i32 addrspace(1)*
+ %ptr = getelementptr i8, ptr addrspace(1) %base1, i64 4
+ %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) %base1)]
+ %ptr2 = getelementptr i8, ptr addrspace(1) %base2, i64 8
ret void
}
; Checking if verifier accepts cmp of two derived pointers when one defined
; before safepoint and one after and both have unrelocated base.
-define void @test.cmp.ok(i32, i8 addrspace(1)* %base1, i8 addrspace(1)* %base2) gc "statepoint-example" {
+define void @test.cmp.ok(i32, ptr addrspace(1) %base1, ptr addrspace(1) %base2) gc "statepoint-example" {
; CHECK-LABEL: Verifying gc pointers in function: test.cmp.ok
; CHECK-NEXT: No illegal uses found by SafepointIRVerifier in: test.cmp.ok
- %ptr = getelementptr i8, i8 addrspace(1)* %base1, i64 4
- %safepoint_token = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* elementtype(void ()) undef, i32 0, i32 0, i32 0, i32 0) ["gc-live"(i8 addrspace(1)* %base1)]
- %ptr2 = getelementptr i8, i8 addrspace(1)* %base2, i64 8
- %c2 = icmp sgt i8 addrspace(1)* %ptr2, %ptr
+ %ptr = getelementptr i8, ptr addrspace(1) %base1, i64 4
+ %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) %base1)]
+ %ptr2 = getelementptr i8, ptr addrspace(1) %base2, i64 8
+ %c2 = icmp sgt ptr addrspace(1) %ptr2, %ptr
ret void
}
; Checking if verifier accepts cmp of two derived pointers when one defined
; before safepoint and one after and both have unrelocated base. One of pointers
; defined as a long chain of geps/bitcasts.
-define void @test.cmp-long_chain.ok(i32, i8 addrspace(1)* %base1, i8 addrspace(1)* %base2) gc "statepoint-example" {
+define void @test.cmp-long_chain.ok(i32, ptr addrspace(1) %base1, ptr addrspace(1) %base2) gc "statepoint-example" {
; CHECK-LABEL: Verifying gc pointers in function: test.cmp-long_chain.ok
; CHECK-NEXT: No illegal uses found by SafepointIRVerifier in: test.cmp-long_chain.ok
- %ptr = getelementptr i8, i8 addrspace(1)* %base1, i64 4
- %ptr.i32 = bitcast i8 addrspace(1)* %ptr to i32 addrspace(1)*
- %safepoint_token = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* elementtype(void ()) undef, i32 0, i32 0, i32 0, i32 0) ["gc-live"(i8 addrspace(1)* %base1)]
- %ptr2 = getelementptr i8, i8 addrspace(1)* %base2, i64 8
- %ptr2.i32 = bitcast i8 addrspace(1)* %ptr2 to i32 addrspace(1)*
- %ptr2.i32.2 = getelementptr i32, i32 addrspace(1)* %ptr2.i32, i64 4
- %ptr2.i32.3 = getelementptr i32, i32 addrspace(1)* %ptr2.i32.2, i64 8
- %ptr2.i32.4 = getelementptr i32, i32 addrspace(1)* %ptr2.i32.3, i64 8
- %ptr2.i32.5 = getelementptr i32, i32 addrspace(1)* %ptr2.i32.4, i64 8
- %ptr2.i32.6 = getelementptr i32, i32 addrspace(1)* %ptr2.i32.5, i64 8
- %ptr2.i32.6.i8 = bitcast i32 addrspace(1)* %ptr2.i32.6 to i8 addrspace(1)*
- %ptr2.i32.6.i8.i32 = bitcast i8 addrspace(1)* %ptr2.i32.6.i8 to i32 addrspace(1)*
- %ptr2.i32.6.i8.i32.2 = getelementptr i32, i32 addrspace(1)* %ptr2.i32.6.i8.i32, i64 8
- %c2 = icmp sgt i32 addrspace(1)* %ptr2.i32.6.i8.i32.2, %ptr.i32
+ %ptr = getelementptr i8, ptr addrspace(1) %base1, i64 4
+ %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) %base1)]
+ %ptr2 = getelementptr i8, ptr addrspace(1) %base2, i64 8
+ %ptr2.i32.2 = getelementptr i32, ptr addrspace(1) %ptr2, i64 4
+ %ptr2.i32.3 = getelementptr i32, ptr addrspace(1) %ptr2.i32.2, i64 8
+ %ptr2.i32.4 = getelementptr i32, ptr addrspace(1) %ptr2.i32.3, i64 8
+ %ptr2.i32.5 = getelementptr i32, ptr addrspace(1) %ptr2.i32.4, i64 8
+ %ptr2.i32.6 = getelementptr i32, ptr addrspace(1) %ptr2.i32.5, i64 8
+ %ptr2.i32.6.i8.i32.2 = getelementptr i32, ptr addrspace(1) %ptr2.i32.6, i64 8
+ %c2 = icmp sgt ptr addrspace(1) %ptr2.i32.6.i8.i32.2, %ptr
ret void
}
; GEP and bitcast of unrelocated pointer is acceptable, but load by resulting
; pointer should be reported.
-define void @test.load.fail(i32, i8 addrspace(1)* %base) gc "statepoint-example" {
+define void @test.load.fail(i32, ptr addrspace(1) %base) gc "statepoint-example" {
; CHECK-LABEL: Verifying gc pointers in function: test.load.fail
- %ptr = getelementptr i8, i8 addrspace(1)* %base, i64 4
- %safepoint_token = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* elementtype(void ()) undef, i32 0, i32 0, i32 0, i32 0) ["gc-live"(i8 addrspace(1)* %base)]
- %ptr.i32 = bitcast i8 addrspace(1)* %ptr to i32 addrspace(1)* ; it's ok
+ %ptr = getelementptr i8, ptr addrspace(1) %base, i64 4
+ %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) %base)]
; CHECK-NEXT: Illegal use of unrelocated value found!
-; CHECK-NEXT: Def: %ptr.i32 = bitcast i8 addrspace(1)* %ptr to i32 addrspace(1)*
-; CHECK-NEXT: Use: %ptr.val = load i32, i32 addrspace(1)* %ptr.i32
- %ptr.val = load i32, i32 addrspace(1)* %ptr.i32
+; CHECK-NEXT: Def: %ptr = getelementptr i8, ptr addrspace(1) %base, i64 4
+; CHECK-NEXT: Use: %ptr.val = load i32, ptr addrspace(1) %ptr
+ %ptr.val = load i32, ptr addrspace(1) %ptr
ret void
}
; Comparison between pointer derived from unrelocated one (though defined after
; safepoint) and relocated pointer should be reported.
-define void @test.cmp.fail(i64 %arg, i8 addrspace(1)* %base1, i8 addrspace(1)* %base2) gc "statepoint-example" {
+define void @test.cmp.fail(i64 %arg, ptr addrspace(1) %base1, ptr addrspace(1) %base2) gc "statepoint-example" {
; CHECK-LABEL: Verifying gc pointers in function: test.cmp.fail
- %safepoint_token = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* elementtype(void ()) undef, i32 0, i32 0, i32 0, i32 0) ["gc-live"(i8 addrspace(1)* %base2)]
- %base2.relocated = call i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token %safepoint_token, i32 0, i32 0) ; base2, base2
- %addr1 = getelementptr i8, i8 addrspace(1)* %base1, i64 %arg
+ %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) %base2)]
+ %base2.relocated = call ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %safepoint_token, i32 0, i32 0) ; base2, base2
+ %addr1 = getelementptr i8, ptr addrspace(1) %base1, i64 %arg
; CHECK-NEXT: Illegal use of unrelocated value found!
-; CHECK-NEXT: Def: %addr1 = getelementptr i8, i8 addrspace(1)* %base1, i64 %arg
-; CHECK-NEXT: Use: %cmp = icmp eq i8 addrspace(1)* %addr1, %base2.relocated
- %cmp = icmp eq i8 addrspace(1)* %addr1, %base2.relocated
+; CHECK-NEXT: Def: %addr1 = getelementptr i8, ptr addrspace(1) %base1, i64 %arg
+; CHECK-NEXT: Use: %cmp = icmp eq ptr addrspace(1) %addr1, %base2.relocated
+ %cmp = icmp eq ptr addrspace(1) %addr1, %base2.relocated
ret void
}
; Same as test.cmp.fail but splitted into two BBs.
-define void @test.cmp2.fail(i64 %arg, i8 addrspace(1)* %base1, i8 addrspace(1)* %base2) gc "statepoint-example" {
+define void @test.cmp2.fail(i64 %arg, ptr addrspace(1) %base1, ptr addrspace(1) %base2) gc "statepoint-example" {
.b0:
; CHECK-LABEL: Verifying gc pointers in function: test.cmp2.fail
- %safepoint_token = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* elementtype(void ()) undef, i32 0, i32 0, i32 0, i32 0) ["gc-live" (i8 addrspace(1)* %base2)]
- %base2.relocated = call i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token %safepoint_token, i32 0, i32 0) ; base2, base2
- %addr1 = getelementptr i8, i8 addrspace(1)* %base1, i64 %arg
+ %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) %base2)]
+ %base2.relocated = call ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %safepoint_token, i32 0, i32 0) ; base2, base2
+ %addr1 = getelementptr i8, ptr addrspace(1) %base1, i64 %arg
br label %.b1
.b1:
; CHECK-NEXT: Illegal use of unrelocated value found!
-; CHECK-NEXT: Def: %addr1 = getelementptr i8, i8 addrspace(1)* %base1, i64 %arg
-; CHECK-NEXT: Use: %cmp = icmp eq i8 addrspace(1)* %addr1, %base2.relocated
- %cmp = icmp eq i8 addrspace(1)* %addr1, %base2.relocated
+; CHECK-NEXT: Def: %addr1 = getelementptr i8, ptr addrspace(1) %base1, i64 %arg
+; CHECK-NEXT: Use: %cmp = icmp eq ptr addrspace(1) %addr1, %base2.relocated
+ %cmp = icmp eq ptr addrspace(1) %addr1, %base2.relocated
ret void
}
; Checking that cmp of two unrelocated pointers is OK and load is not.
-define void @test.cmp-load.fail(i64 %arg, i8 addrspace(1)* %base1, i8 addrspace(1)* %base2) gc "statepoint-example" {
+define void @test.cmp-load.fail(i64 %arg, ptr addrspace(1) %base1, ptr addrspace(1) %base2) gc "statepoint-example" {
; CHECK-LABEL: Verifying gc pointers in function: test.cmp-load.fail
- %addr1 = getelementptr i8, i8 addrspace(1)* %base1, i64 %arg
- %safepoint_token = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* elementtype(void ()) undef, i32 0, i32 0, i32 0, i32 0) ["gc-live"(i8 addrspace(1)* %base2)]
- %addr2 = getelementptr i8, i8 addrspace(1)* %base2, i64 8
- %cmp = icmp eq i8 addrspace(1)* %addr1, %addr2
+ %addr1 = getelementptr i8, ptr addrspace(1) %base1, i64 %arg
+ %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) %base2)]
+ %addr2 = getelementptr i8, ptr addrspace(1) %base2, i64 8
+ %cmp = icmp eq ptr addrspace(1) %addr1, %addr2
; CHECK-NEXT: Illegal use of unrelocated value found!
-; CHECK-NEXT: Def: %addr2 = getelementptr i8, i8 addrspace(1)* %base2, i64 8
-; CHECK-NEXT: Use: %val = load i8, i8 addrspace(1)* %addr2
- %val = load i8, i8 addrspace(1)* %addr2
+; CHECK-NEXT: Def: %addr2 = getelementptr i8, ptr addrspace(1) %base2, i64 8
+; CHECK-NEXT: Use: %val = load i8, ptr addrspace(1) %addr2
+ %val = load i8, ptr addrspace(1) %addr2
ret void
}
; Same as test.cmp-load.fail but splitted into thee BBs.
-define void @test.cmp-load2.fail(i64 %arg, i8 addrspace(1)* %base1, i8 addrspace(1)* %base2) gc "statepoint-example" {
+define void @test.cmp-load2.fail(i64 %arg, ptr addrspace(1) %base1, ptr addrspace(1) %base2) gc "statepoint-example" {
.b0:
; CHECK-LABEL: Verifying gc pointers in function: test.cmp-load2.fail
- %addr1 = getelementptr i8, i8 addrspace(1)* %base1, i64 %arg
- %safepoint_token = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* elementtype(void ()) undef, i32 0, i32 0, i32 0, i32 0) ["gc-live"(i8 addrspace(1)* %base2)]
+ %addr1 = getelementptr i8, ptr addrspace(1) %base1, i64 %arg
+ %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) %base2)]
br label %.b1
.b1:
- %addr2 = getelementptr i8, i8 addrspace(1)* %base2, i64 8
+ %addr2 = getelementptr i8, ptr addrspace(1) %base2, i64 8
br label %.b2
.b2:
- %cmp = icmp eq i8 addrspace(1)* %addr1, %addr2
+ %cmp = icmp eq ptr addrspace(1) %addr1, %addr2
; CHECK-NEXT: Illegal use of unrelocated value found!
-; CHECK-NEXT: Def: %addr2 = getelementptr i8, i8 addrspace(1)* %base2, i64 8
-; CHECK-NEXT: Use: %val = load i8, i8 addrspace(1)* %addr2
- %val = load i8, i8 addrspace(1)* %addr2
+; CHECK-NEXT: Def: %addr2 = getelementptr i8, ptr addrspace(1) %base2, i64 8
+; CHECK-NEXT: Use: %val = load i8, ptr addrspace(1) %addr2
+ %val = load i8, ptr addrspace(1) %addr2
ret void
}
; Same as test.cmp.ok but with multiple safepoints within one BB. And the last
; one is in the very end of BB so that Contribution of this BB is empty.
-define void @test.cmp.multi-sp.ok(i64 %arg, i8 addrspace(1)* %base1, i8 addrspace(1)* %base2) gc "statepoint-example" {
+define void @test.cmp.multi-sp.ok(i64 %arg, ptr addrspace(1) %base1, ptr addrspace(1) %base2) gc "statepoint-example" {
; CHECK-LABEL: Verifying gc pointers in function: test.cmp.multi-sp.ok
; CHECK-NEXT: No illegal uses found by SafepointIRVerifier in: test.cmp.multi-sp.ok
- %safepoint_token = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* elementtype(void ()) undef, i32 0, i32 0, i32 0, i32 0) ["gc-live"(i8 addrspace(1)* %base2)]
- %base2.relocated = call i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token %safepoint_token, i32 0, i32 0) ; base2, base2
- %addr1 = getelementptr i8, i8 addrspace(1)* %base1, i64 %arg
- %safepoint_token2 = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* elementtype(void ()) undef, i32 0, i32 0, i32 0, i32 0) ["gc-live"(i8 addrspace(1)* %base2.relocated)]
- %base2.relocated2 = call i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token %safepoint_token2, i32 0, i32 0) ; base2.relocated, base2.relocated
- %addr2 = getelementptr i8, i8 addrspace(1)* %base2, i64 %arg
- %cmp = icmp eq i8 addrspace(1)* %addr1, %addr2
- %safepoint_token3 = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* elementtype(void ()) undef, i32 0, i32 0, i32 0, i32 0) ["gc-live"(i8 addrspace(1)* %base2.relocated2)]
+ %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) %base2)]
+ %base2.relocated = call ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %safepoint_token, i32 0, i32 0) ; base2, base2
+ %addr1 = getelementptr i8, ptr addrspace(1) %base1, i64 %arg
+ %safepoint_token2 = 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) %base2.relocated)]
+ %base2.relocated2 = call ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %safepoint_token2, i32 0, i32 0) ; base2.relocated, base2.relocated
+ %addr2 = getelementptr i8, ptr addrspace(1) %base2, i64 %arg
+ %cmp = icmp eq ptr addrspace(1) %addr1, %addr2
+ %safepoint_token3 = 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) %base2.relocated2)]
ret void
}
; Function Attrs: nounwind
-declare token @llvm.experimental.gc.statepoint.p0f_isVoidf(i64, i32, void ()*, i32, i32, ...)
-declare i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token, i32, i32)
+declare token @llvm.experimental.gc.statepoint.p0(i64, i32, ptr, i32, i32, ...)
+declare ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token, i32, i32)
More information about the llvm-commits
mailing list