[llvm] 47f2546 - LowerExpectIntrinsic: Convert tests to opaque pointers
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 28 06:08:43 PST 2022
Author: Matt Arsenault
Date: 2022-11-28T09:08:31-05:00
New Revision: 47f25462c803589f3ee9b0c5572b98b85cd3c371
URL: https://github.com/llvm/llvm-project/commit/47f25462c803589f3ee9b0c5572b98b85cd3c371
DIFF: https://github.com/llvm/llvm-project/commit/47f25462c803589f3ee9b0c5572b98b85cd3c371.diff
LOG: LowerExpectIntrinsic: Convert tests to opaque pointers
Added:
Modified:
llvm/test/Transforms/LowerExpectIntrinsic/PR33346.ll
llvm/test/Transforms/LowerExpectIntrinsic/basic.ll
llvm/test/Transforms/LowerExpectIntrinsic/expect-with-probability.ll
llvm/test/Transforms/LowerExpectIntrinsic/phi_or.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/LowerExpectIntrinsic/PR33346.ll b/llvm/test/Transforms/LowerExpectIntrinsic/PR33346.ll
index ca962fbdc8f3c..75805656e178f 100644
--- a/llvm/test/Transforms/LowerExpectIntrinsic/PR33346.ll
+++ b/llvm/test/Transforms/LowerExpectIntrinsic/PR33346.ll
@@ -4,9 +4,9 @@
define i64 @foo(i64 %arg) #0 {
bb:
%tmp = alloca i64, align 8
- store i64 %arg, i64* %tmp, align 8
- %tmp1 = load i64, i64* %tmp, align 8
- %tmp2 = load i64, i64* %tmp, align 8
+ store i64 %arg, ptr %tmp, align 8
+ %tmp1 = load i64, ptr %tmp, align 8
+ %tmp2 = load i64, ptr %tmp, align 8
%tmp3 = call i64 @llvm.expect.i64(i64 %tmp1, i64 %tmp2)
ret i64 %tmp3
}
diff --git a/llvm/test/Transforms/LowerExpectIntrinsic/basic.ll b/llvm/test/Transforms/LowerExpectIntrinsic/basic.ll
index 94ecbcf750a27..d974e873ea8d5 100644
--- a/llvm/test/Transforms/LowerExpectIntrinsic/basic.ll
+++ b/llvm/test/Transforms/LowerExpectIntrinsic/basic.ll
@@ -6,8 +6,8 @@ define i32 @test1(i32 %x) nounwind uwtable ssp {
entry:
%retval = alloca i32, align 4
%x.addr = alloca i32, align 4
- store i32 %x, i32* %x.addr, align 4
- %tmp = load i32, i32* %x.addr, align 4
+ store i32 %x, ptr %x.addr, align 4
+ %tmp = load i32, ptr %x.addr, align 4
%cmp = icmp sgt i32 %tmp, 1
%conv = zext i1 %cmp to i32
%conv1 = sext i32 %conv to i64
@@ -19,15 +19,15 @@ entry:
if.then: ; preds = %entry
%call = call i32 (...) @f()
- store i32 %call, i32* %retval
+ store i32 %call, ptr %retval
br label %return
if.end: ; preds = %entry
- store i32 1, i32* %retval
+ store i32 1, ptr %retval
br label %return
return: ; preds = %if.end, %if.then
- %0 = load i32, i32* %retval
+ %0 = load i32, ptr %retval
ret i32 %0
}
@@ -40,8 +40,8 @@ define i32 @test2(i32 %x) nounwind uwtable ssp {
entry:
%retval = alloca i32, align 4
%x.addr = alloca i32, align 4
- store i32 %x, i32* %x.addr, align 4
- %tmp = load i32, i32* %x.addr, align 4
+ store i32 %x, ptr %x.addr, align 4
+ %tmp = load i32, ptr %x.addr, align 4
%conv = sext i32 %tmp to i64
%expval = call i64 @llvm.expect.i64(i64 %conv, i64 1)
%tobool = icmp ne i64 %expval, 0
@@ -51,15 +51,15 @@ entry:
if.then: ; preds = %entry
%call = call i32 (...) @f()
- store i32 %call, i32* %retval
+ store i32 %call, ptr %retval
br label %return
if.end: ; preds = %entry
- store i32 1, i32* %retval
+ store i32 1, ptr %retval
br label %return
return: ; preds = %if.end, %if.then
- %0 = load i32, i32* %retval
+ %0 = load i32, ptr %retval
ret i32 %0
}
@@ -68,8 +68,8 @@ define i32 @test3(i32 %x) nounwind uwtable ssp {
entry:
%retval = alloca i32, align 4
%x.addr = alloca i32, align 4
- store i32 %x, i32* %x.addr, align 4
- %tmp = load i32, i32* %x.addr, align 4
+ store i32 %x, ptr %x.addr, align 4
+ %tmp = load i32, ptr %x.addr, align 4
%tobool = icmp ne i32 %tmp, 0
%lnot = xor i1 %tobool, true
%lnot.ext = zext i1 %lnot to i32
@@ -82,15 +82,15 @@ entry:
if.then: ; preds = %entry
%call = call i32 (...) @f()
- store i32 %call, i32* %retval
+ store i32 %call, ptr %retval
br label %return
if.end: ; preds = %entry
- store i32 1, i32* %retval
+ store i32 1, ptr %retval
br label %return
return: ; preds = %if.end, %if.then
- %0 = load i32, i32* %retval
+ %0 = load i32, ptr %retval
ret i32 %0
}
@@ -99,8 +99,8 @@ define i32 @test4(i32 %x) nounwind uwtable ssp {
entry:
%retval = alloca i32, align 4
%x.addr = alloca i32, align 4
- store i32 %x, i32* %x.addr, align 4
- %tmp = load i32, i32* %x.addr, align 4
+ store i32 %x, ptr %x.addr, align 4
+ %tmp = load i32, ptr %x.addr, align 4
%tobool = icmp ne i32 %tmp, 0
%lnot = xor i1 %tobool, true
%lnot1 = xor i1 %lnot, true
@@ -114,15 +114,15 @@ entry:
if.then: ; preds = %entry
%call = call i32 (...) @f()
- store i32 %call, i32* %retval
+ store i32 %call, ptr %retval
br label %return
if.end: ; preds = %entry
- store i32 1, i32* %retval
+ store i32 1, ptr %retval
br label %return
return: ; preds = %if.end, %if.then
- %0 = load i32, i32* %retval
+ %0 = load i32, ptr %retval
ret i32 %0
}
@@ -131,8 +131,8 @@ define i32 @test5(i32 %x) nounwind uwtable ssp {
entry:
%retval = alloca i32, align 4
%x.addr = alloca i32, align 4
- store i32 %x, i32* %x.addr, align 4
- %tmp = load i32, i32* %x.addr, align 4
+ store i32 %x, ptr %x.addr, align 4
+ %tmp = load i32, ptr %x.addr, align 4
%cmp = icmp slt i32 %tmp, 0
%conv = zext i1 %cmp to i32
%conv1 = sext i32 %conv to i64
@@ -144,15 +144,15 @@ entry:
if.then: ; preds = %entry
%call = call i32 (...) @f()
- store i32 %call, i32* %retval
+ store i32 %call, ptr %retval
br label %return
if.end: ; preds = %entry
- store i32 1, i32* %retval
+ store i32 1, ptr %retval
br label %return
return: ; preds = %if.end, %if.then
- %0 = load i32, i32* %retval
+ %0 = load i32, ptr %retval
ret i32 %0
}
@@ -161,8 +161,8 @@ define i32 @test6(i32 %x) nounwind uwtable ssp {
entry:
%retval = alloca i32, align 4
%x.addr = alloca i32, align 4
- store i32 %x, i32* %x.addr, align 4
- %tmp = load i32, i32* %x.addr, align 4
+ store i32 %x, ptr %x.addr, align 4
+ %tmp = load i32, ptr %x.addr, align 4
%conv = sext i32 %tmp to i64
%expval = call i64 @llvm.expect.i64(i64 %conv, i64 2)
; CHECK: !prof !2
@@ -173,15 +173,15 @@ entry:
]
sw.bb: ; preds = %entry, %entry
- store i32 0, i32* %retval
+ store i32 0, ptr %retval
br label %return
sw.epilog: ; preds = %entry
- store i32 1, i32* %retval
+ store i32 1, ptr %retval
br label %return
return: ; preds = %sw.epilog, %sw.bb
- %0 = load i32, i32* %retval
+ %0 = load i32, ptr %retval
ret i32 %0
}
@@ -190,8 +190,8 @@ define i32 @test7(i32 %x) nounwind uwtable ssp {
entry:
%retval = alloca i32, align 4
%x.addr = alloca i32, align 4
- store i32 %x, i32* %x.addr, align 4
- %tmp = load i32, i32* %x.addr, align 4
+ store i32 %x, ptr %x.addr, align 4
+ %tmp = load i32, ptr %x.addr, align 4
%conv = sext i32 %tmp to i64
%expval = call i64 @llvm.expect.i64(i64 %conv, i64 1)
; CHECK: !prof !3
@@ -202,16 +202,16 @@ entry:
]
sw.bb: ; preds = %entry, %entry
- %tmp1 = load i32, i32* %x.addr, align 4
- store i32 %tmp1, i32* %retval
+ %tmp1 = load i32, ptr %x.addr, align 4
+ store i32 %tmp1, ptr %retval
br label %return
sw.epilog: ; preds = %entry
- store i32 0, i32* %retval
+ store i32 0, ptr %retval
br label %return
return: ; preds = %sw.epilog, %sw.bb
- %0 = load i32, i32* %retval
+ %0 = load i32, ptr %retval
ret i32 %0
}
@@ -220,8 +220,8 @@ define i32 @test8(i32 %x) nounwind uwtable ssp {
entry:
%retval = alloca i32, align 4
%x.addr = alloca i32, align 4
- store i32 %x, i32* %x.addr, align 4
- %tmp = load i32, i32* %x.addr, align 4
+ store i32 %x, ptr %x.addr, align 4
+ %tmp = load i32, ptr %x.addr, align 4
%cmp = icmp sgt i32 %tmp, 1
%conv = zext i1 %cmp to i32
%expval = call i32 @llvm.expect.i32(i32 %conv, i32 1)
@@ -232,15 +232,15 @@ entry:
if.then: ; preds = %entry
%call = call i32 (...) @f()
- store i32 %call, i32* %retval
+ store i32 %call, ptr %retval
br label %return
if.end: ; preds = %entry
- store i32 1, i32* %retval
+ store i32 1, ptr %retval
br label %return
return: ; preds = %if.end, %if.then
- %0 = load i32, i32* %retval
+ %0 = load i32, ptr %retval
ret i32 %0
}
@@ -251,8 +251,8 @@ define i32 @test9(i32 %x) nounwind uwtable ssp {
entry:
%retval = alloca i32, align 4
%x.addr = alloca i32, align 4
- store i32 %x, i32* %x.addr, align 4
- %tmp = load i32, i32* %x.addr, align 4
+ store i32 %x, ptr %x.addr, align 4
+ %tmp = load i32, ptr %x.addr, align 4
%cmp = icmp sgt i32 %tmp, 1
%expval = call i1 @llvm.expect.i1(i1 %cmp, i1 1)
; CHECK: !prof !0
@@ -261,15 +261,15 @@ entry:
if.then: ; preds = %entry
%call = call i32 (...) @f()
- store i32 %call, i32* %retval
+ store i32 %call, ptr %retval
br label %return
if.end: ; preds = %entry
- store i32 1, i32* %retval
+ store i32 1, ptr %retval
br label %return
return: ; preds = %if.end, %if.then
- %0 = load i32, i32* %retval
+ %0 = load i32, ptr %retval
ret i32 %0
}
diff --git a/llvm/test/Transforms/LowerExpectIntrinsic/expect-with-probability.ll b/llvm/test/Transforms/LowerExpectIntrinsic/expect-with-probability.ll
index 5f6c672df4ebc..054f40f19f445 100644
--- a/llvm/test/Transforms/LowerExpectIntrinsic/expect-with-probability.ll
+++ b/llvm/test/Transforms/LowerExpectIntrinsic/expect-with-probability.ll
@@ -6,8 +6,8 @@ define i32 @test1(i32 %x) nounwind uwtable ssp {
entry:
%retval = alloca i32, align 4
%x.addr = alloca i32, align 4
- store i32 %x, i32* %x.addr, align 4
- %tmp = load i32, i32* %x.addr, align 4
+ store i32 %x, ptr %x.addr, align 4
+ %tmp = load i32, ptr %x.addr, align 4
%cmp = icmp sgt i32 %tmp, 1
%conv = zext i1 %cmp to i32
%conv1 = sext i32 %conv to i64
@@ -19,15 +19,15 @@ entry:
if.then: ; preds = %entry
%call = call i32 (...) @f()
- store i32 %call, i32* %retval
+ store i32 %call, ptr %retval
br label %return
if.end: ; preds = %entry
- store i32 1, i32* %retval
+ store i32 1, ptr %retval
br label %return
return: ; preds = %if.end, %if.then
- %0 = load i32, i32* %retval
+ %0 = load i32, ptr %retval
ret i32 %0
}
@@ -40,8 +40,8 @@ define i32 @test2(i32 %x) nounwind uwtable ssp {
entry:
%retval = alloca i32, align 4
%x.addr = alloca i32, align 4
- store i32 %x, i32* %x.addr, align 4
- %tmp = load i32, i32* %x.addr, align 4
+ store i32 %x, ptr %x.addr, align 4
+ %tmp = load i32, ptr %x.addr, align 4
%conv = sext i32 %tmp to i64
%expval = call i64 @llvm.expect.with.probability.i64(i64 %conv, i64 1, double 8.000000e-01)
%tobool = icmp ne i64 %expval, 0
@@ -51,15 +51,15 @@ entry:
if.then: ; preds = %entry
%call = call i32 (...) @f()
- store i32 %call, i32* %retval
+ store i32 %call, ptr %retval
br label %return
if.end: ; preds = %entry
- store i32 1, i32* %retval
+ store i32 1, ptr %retval
br label %return
return: ; preds = %if.end, %if.then
- %0 = load i32, i32* %retval
+ %0 = load i32, ptr %retval
ret i32 %0
}
@@ -68,8 +68,8 @@ define i32 @test3(i32 %x) nounwind uwtable ssp {
entry:
%retval = alloca i32, align 4
%x.addr = alloca i32, align 4
- store i32 %x, i32* %x.addr, align 4
- %tmp = load i32, i32* %x.addr, align 4
+ store i32 %x, ptr %x.addr, align 4
+ %tmp = load i32, ptr %x.addr, align 4
%tobool = icmp ne i32 %tmp, 0
%lnot = xor i1 %tobool, true
%lnot.ext = zext i1 %lnot to i32
@@ -82,15 +82,15 @@ entry:
if.then: ; preds = %entry
%call = call i32 (...) @f()
- store i32 %call, i32* %retval
+ store i32 %call, ptr %retval
br label %return
if.end: ; preds = %entry
- store i32 1, i32* %retval
+ store i32 1, ptr %retval
br label %return
return: ; preds = %if.end, %if.then
- %0 = load i32, i32* %retval
+ %0 = load i32, ptr %retval
ret i32 %0
}
@@ -99,8 +99,8 @@ define i32 @test4(i32 %x) nounwind uwtable ssp {
entry:
%retval = alloca i32, align 4
%x.addr = alloca i32, align 4
- store i32 %x, i32* %x.addr, align 4
- %tmp = load i32, i32* %x.addr, align 4
+ store i32 %x, ptr %x.addr, align 4
+ %tmp = load i32, ptr %x.addr, align 4
%tobool = icmp ne i32 %tmp, 0
%lnot = xor i1 %tobool, true
%lnot1 = xor i1 %lnot, true
@@ -114,15 +114,15 @@ entry:
if.then: ; preds = %entry
%call = call i32 (...) @f()
- store i32 %call, i32* %retval
+ store i32 %call, ptr %retval
br label %return
if.end: ; preds = %entry
- store i32 1, i32* %retval
+ store i32 1, ptr %retval
br label %return
return: ; preds = %if.end, %if.then
- %0 = load i32, i32* %retval
+ %0 = load i32, ptr %retval
ret i32 %0
}
@@ -131,8 +131,8 @@ define i32 @test5(i32 %x) nounwind uwtable ssp {
entry:
%retval = alloca i32, align 4
%x.addr = alloca i32, align 4
- store i32 %x, i32* %x.addr, align 4
- %tmp = load i32, i32* %x.addr, align 4
+ store i32 %x, ptr %x.addr, align 4
+ %tmp = load i32, ptr %x.addr, align 4
%cmp = icmp slt i32 %tmp, 0
%conv = zext i1 %cmp to i32
%conv1 = sext i32 %conv to i64
@@ -144,15 +144,15 @@ entry:
if.then: ; preds = %entry
%call = call i32 (...) @f()
- store i32 %call, i32* %retval
+ store i32 %call, ptr %retval
br label %return
if.end: ; preds = %entry
- store i32 1, i32* %retval
+ store i32 1, ptr %retval
br label %return
return: ; preds = %if.end, %if.then
- %0 = load i32, i32* %retval
+ %0 = load i32, ptr %retval
ret i32 %0
}
@@ -161,8 +161,8 @@ define i32 @test6(i32 %x) nounwind uwtable ssp {
entry:
%retval = alloca i32, align 4
%x.addr = alloca i32, align 4
- store i32 %x, i32* %x.addr, align 4
- %tmp = load i32, i32* %x.addr, align 4
+ store i32 %x, ptr %x.addr, align 4
+ %tmp = load i32, ptr %x.addr, align 4
%conv = sext i32 %tmp to i64
%expval = call i64 @llvm.expect.with.probability.i64(i64 %conv, i64 2, double 8.000000e-01)
; CHECK: !prof !2
@@ -173,15 +173,15 @@ entry:
]
sw.bb: ; preds = %entry, %entry
- store i32 0, i32* %retval
+ store i32 0, ptr %retval
br label %return
sw.epilog: ; preds = %entry
- store i32 1, i32* %retval
+ store i32 1, ptr %retval
br label %return
return: ; preds = %sw.epilog, %sw.bb
- %0 = load i32, i32* %retval
+ %0 = load i32, ptr %retval
ret i32 %0
}
@@ -190,8 +190,8 @@ define i32 @test7(i32 %x) nounwind uwtable ssp {
entry:
%retval = alloca i32, align 4
%x.addr = alloca i32, align 4
- store i32 %x, i32* %x.addr, align 4
- %tmp = load i32, i32* %x.addr, align 4
+ store i32 %x, ptr %x.addr, align 4
+ %tmp = load i32, ptr %x.addr, align 4
%conv = sext i32 %tmp to i64
%expval = call i64 @llvm.expect.with.probability.i64(i64 %conv, i64 1, double 8.000000e-01)
; CHECK: !prof !3
@@ -202,16 +202,16 @@ entry:
]
sw.bb: ; preds = %entry, %entry
- %tmp1 = load i32, i32* %x.addr, align 4
- store i32 %tmp1, i32* %retval
+ %tmp1 = load i32, ptr %x.addr, align 4
+ store i32 %tmp1, ptr %retval
br label %return
sw.epilog: ; preds = %entry
- store i32 0, i32* %retval
+ store i32 0, ptr %retval
br label %return
return: ; preds = %sw.epilog, %sw.bb
- %0 = load i32, i32* %retval
+ %0 = load i32, ptr %retval
ret i32 %0
}
@@ -220,8 +220,8 @@ define i32 @test8(i32 %x) nounwind uwtable ssp {
entry:
%retval = alloca i32, align 4
%x.addr = alloca i32, align 4
- store i32 %x, i32* %x.addr, align 4
- %tmp = load i32, i32* %x.addr, align 4
+ store i32 %x, ptr %x.addr, align 4
+ %tmp = load i32, ptr %x.addr, align 4
%cmp = icmp sgt i32 %tmp, 1
%conv = zext i1 %cmp to i32
%expval = call i32 @llvm.expect.with.probability.i32(i32 %conv, i32 1, double 8.000000e-01)
@@ -232,15 +232,15 @@ entry:
if.then: ; preds = %entry
%call = call i32 (...) @f()
- store i32 %call, i32* %retval
+ store i32 %call, ptr %retval
br label %return
if.end: ; preds = %entry
- store i32 1, i32* %retval
+ store i32 1, ptr %retval
br label %return
return: ; preds = %if.end, %if.then
- %0 = load i32, i32* %retval
+ %0 = load i32, ptr %retval
ret i32 %0
}
@@ -251,8 +251,8 @@ define i32 @test9(i32 %x) nounwind uwtable ssp {
entry:
%retval = alloca i32, align 4
%x.addr = alloca i32, align 4
- store i32 %x, i32* %x.addr, align 4
- %tmp = load i32, i32* %x.addr, align 4
+ store i32 %x, ptr %x.addr, align 4
+ %tmp = load i32, ptr %x.addr, align 4
%cmp = icmp sgt i32 %tmp, 1
%expval = call i1 @llvm.expect.with.probability.i1(i1 %cmp, i1 1, double 8.000000e-01)
; CHECK: !prof !0
@@ -261,15 +261,15 @@ entry:
if.then: ; preds = %entry
%call = call i32 (...) @f()
- store i32 %call, i32* %retval
+ store i32 %call, ptr %retval
br label %return
if.end: ; preds = %entry
- store i32 1, i32* %retval
+ store i32 1, ptr %retval
br label %return
return: ; preds = %if.end, %if.then
- %0 = load i32, i32* %retval
+ %0 = load i32, ptr %retval
ret i32 %0
}
diff --git a/llvm/test/Transforms/LowerExpectIntrinsic/phi_or.ll b/llvm/test/Transforms/LowerExpectIntrinsic/phi_or.ll
index 849baef3dca8a..cebade18e8a63 100644
--- a/llvm/test/Transforms/LowerExpectIntrinsic/phi_or.ll
+++ b/llvm/test/Transforms/LowerExpectIntrinsic/phi_or.ll
@@ -53,18 +53,18 @@ bb:
%tmp4 = alloca i32, align 4
%tmp5 = alloca i32, align 4
%tmp6 = alloca i32, align 4
- store i32 %arg, i32* %tmp, align 4
- store i32 %arg1, i32* %tmp4, align 4
- store i32 %arg2, i32* %tmp5, align 4
- store i32 %arg3, i32* %tmp6, align 4
- %tmp7 = load i32, i32* %tmp, align 4
+ store i32 %arg, ptr %tmp, align 4
+ store i32 %arg1, ptr %tmp4, align 4
+ store i32 %arg2, ptr %tmp5, align 4
+ store i32 %arg3, ptr %tmp6, align 4
+ %tmp7 = load i32, ptr %tmp, align 4
%tmp8 = call i32 @goo()
%tmp9 = icmp slt i32 %tmp7, %tmp8
br i1 %tmp9, label %bb14, label %bb10
; CHECK: br i1 %tmp9{{.*}}!prof [[WEIGHT2:![0-9]+]]
bb10: ; preds = %bb
- %tmp11 = load i32, i32* %tmp5, align 4
+ %tmp11 = load i32, ptr %tmp5, align 4
%tmp12 = call i32 @hoo()
%tmp13 = icmp sgt i32 %tmp11, %tmp12
br label %bb14
More information about the llvm-commits
mailing list