[llvm] 60ea938 - IndirectBrExpand: Convert test to opaque pointers
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 28 06:48:00 PST 2022
Author: Matt Arsenault
Date: 2022-11-28T09:35:37-05:00
New Revision: 60ea938ec02245b5f44119d57e4212ca55db2915
URL: https://github.com/llvm/llvm-project/commit/60ea938ec02245b5f44119d57e4212ca55db2915
DIFF: https://github.com/llvm/llvm-project/commit/60ea938ec02245b5f44119d57e4212ca55db2915.diff
LOG: IndirectBrExpand: Convert test to opaque pointers
Added:
Modified:
llvm/test/Transforms/IndirectBrExpand/basic.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/IndirectBrExpand/basic.ll b/llvm/test/Transforms/IndirectBrExpand/basic.ll
index d0319c6b9946a..c90ec4a3c48b2 100644
--- a/llvm/test/Transforms/IndirectBrExpand/basic.ll
+++ b/llvm/test/Transforms/IndirectBrExpand/basic.ll
@@ -4,52 +4,52 @@
target triple = "x86_64-unknown-linux-gnu"
- at test1.targets = constant [4 x i8*] [i8* blockaddress(@test1, %bb0),
- i8* blockaddress(@test1, %bb1),
- i8* blockaddress(@test1, %bb2),
- i8* blockaddress(@test1, %bb3)]
-; CHECK-LABEL: @test1.targets = constant [4 x i8*]
-; CHECK: [i8* inttoptr (i64 1 to i8*),
-; CHECK: i8* inttoptr (i64 2 to i8*),
-; CHECK: i8* inttoptr (i64 3 to i8*),
-; CHECK: i8* blockaddress(@test1, %bb3)]
-
-define void @test1(i64* readonly %p, i64* %sink) #0 {
+ at test1.targets = constant [4 x ptr] [ptr blockaddress(@test1, %bb0),
+ ptr blockaddress(@test1, %bb1),
+ ptr blockaddress(@test1, %bb2),
+ ptr blockaddress(@test1, %bb3)]
+; CHECK-LABEL: @test1.targets = constant [4 x ptr]
+; CHECK: [ptr inttoptr (i64 1 to ptr),
+; CHECK: ptr inttoptr (i64 2 to ptr),
+; CHECK: ptr inttoptr (i64 3 to ptr),
+; CHECK: ptr blockaddress(@test1, %bb3)]
+
+define void @test1(ptr readonly %p, ptr %sink) #0 {
; CHECK-LABEL: define void @test1(
entry:
- %i0 = load i64, i64* %p
- %target.i0 = getelementptr [4 x i8*], [4 x i8*]* @test1.targets, i64 0, i64 %i0
- %target0 = load i8*, i8** %target.i0
+ %i0 = load i64, ptr %p
+ %target.i0 = getelementptr [4 x ptr], ptr @test1.targets, i64 0, i64 %i0
+ %target0 = load ptr, ptr %target.i0
; Only a subset of blocks are viable successors here.
- indirectbr i8* %target0, [label %bb0, label %bb1]
+ indirectbr ptr %target0, [label %bb0, label %bb1]
; CHECK-NOT: indirectbr
-; CHECK: %[[ENTRY_V:.*]] = ptrtoint i8* %{{.*}} to i64
+; CHECK: %[[ENTRY_V:.*]] = ptrtoint ptr %{{.*}} to i64
; CHECK-NEXT: br label %[[SWITCH_BB:.*]]
bb0:
- store volatile i64 0, i64* %sink
+ store volatile i64 0, ptr %sink
br label %latch
bb1:
- store volatile i64 1, i64* %sink
+ store volatile i64 1, ptr %sink
br label %latch
bb2:
- store volatile i64 2, i64* %sink
+ store volatile i64 2, ptr %sink
br label %latch
bb3:
- store volatile i64 3, i64* %sink
+ store volatile i64 3, ptr %sink
br label %latch
latch:
- %i.next = load i64, i64* %p
- %target.i.next = getelementptr [4 x i8*], [4 x i8*]* @test1.targets, i64 0, i64 %i.next
- %target.next = load i8*, i8** %target.i.next
+ %i.next = load i64, ptr %p
+ %target.i.next = getelementptr [4 x ptr], ptr @test1.targets, i64 0, i64 %i.next
+ %target.next = load ptr, ptr %target.i.next
; A
diff erent subset of blocks are viable successors here.
- indirectbr i8* %target.next, [label %bb1, label %bb2]
+ indirectbr ptr %target.next, [label %bb1, label %bb2]
; CHECK-NOT: indirectbr
-; CHECK: %[[LATCH_V:.*]] = ptrtoint i8* %{{.*}} to i64
+; CHECK: %[[LATCH_V:.*]] = ptrtoint ptr %{{.*}} to i64
; CHECK-NEXT: br label %[[SWITCH_BB]]
;
; CHECK: [[SWITCH_BB]]:
More information about the llvm-commits
mailing list