[llvm] 22cf983 - [VPlan] Use opaque pointers in VPlan unit test IR (#69947)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 21 11:38:29 PST 2024
Author: calebwat
Date: 2024-02-21T11:38:26-08:00
New Revision: 22cf983387e52e3df01504c69df8266e9d80d9da
URL: https://github.com/llvm/llvm-project/commit/22cf983387e52e3df01504c69df8266e9d80d9da
DIFF: https://github.com/llvm/llvm-project/commit/22cf983387e52e3df01504c69df8266e9d80d9da.diff
LOG: [VPlan] Use opaque pointers in VPlan unit test IR (#69947)
Updates the unit tests for VPlan to use opaque pointers in strings
containing LLVM IR. This is to match the similar adjustments being made
for lit tests to use opaque pointers.
Added:
Modified:
llvm/unittests/Transforms/Vectorize/VPlanHCFGTest.cpp
llvm/unittests/Transforms/Vectorize/VPlanSlpTest.cpp
Removed:
################################################################################
diff --git a/llvm/unittests/Transforms/Vectorize/VPlanHCFGTest.cpp b/llvm/unittests/Transforms/Vectorize/VPlanHCFGTest.cpp
index 88ceb5952c6a56..be8be7acbe3881 100644
--- a/llvm/unittests/Transforms/Vectorize/VPlanHCFGTest.cpp
+++ b/llvm/unittests/Transforms/Vectorize/VPlanHCFGTest.cpp
@@ -21,15 +21,15 @@ class VPlanHCFGTest : public VPlanTestBase {};
TEST_F(VPlanHCFGTest, testBuildHCFGInnerLoop) {
const char *ModuleString =
- "define void @f(i32* %A, i64 %N) {\n"
+ "define void @f(ptr %A, i64 %N) {\n"
"entry:\n"
" br label %for.body\n"
"for.body:\n"
" %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]\n"
- " %arr.idx = getelementptr inbounds i32, i32* %A, i64 %indvars.iv\n"
- " %l1 = load i32, i32* %arr.idx, align 4\n"
+ " %arr.idx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv\n"
+ " %l1 = load i32, ptr %arr.idx, align 4\n"
" %res = add i32 %l1, 10\n"
- " store i32 %res, i32* %arr.idx, align 4\n"
+ " store i32 %res, ptr %arr.idx, align 4\n"
" %indvars.iv.next = add i64 %indvars.iv, 1\n"
" %exitcond = icmp ne i64 %indvars.iv.next, %N\n"
" br i1 %exitcond, label %for.body, label %for.end\n"
@@ -148,15 +148,15 @@ compound=true
TEST_F(VPlanHCFGTest, testVPInstructionToVPRecipesInner) {
const char *ModuleString =
- "define void @f(i32* %A, i64 %N) {\n"
+ "define void @f(ptr %A, i64 %N) {\n"
"entry:\n"
" br label %for.body\n"
"for.body:\n"
" %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]\n"
- " %arr.idx = getelementptr inbounds i32, i32* %A, i64 %indvars.iv\n"
- " %l1 = load i32, i32* %arr.idx, align 4\n"
+ " %arr.idx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv\n"
+ " %l1 = load i32, ptr %arr.idx, align 4\n"
" %res = add i32 %l1, 10\n"
- " store i32 %res, i32* %arr.idx, align 4\n"
+ " store i32 %res, ptr %arr.idx, align 4\n"
" %indvars.iv.next = add i64 %indvars.iv, 1\n"
" %exitcond = icmp ne i64 %indvars.iv.next, %N\n"
" br i1 %exitcond, label %for.body, label %for.end\n"
diff --git a/llvm/unittests/Transforms/Vectorize/VPlanSlpTest.cpp b/llvm/unittests/Transforms/Vectorize/VPlanSlpTest.cpp
index 70951f3a656a0b..396919763c933a 100644
--- a/llvm/unittests/Transforms/Vectorize/VPlanSlpTest.cpp
+++ b/llvm/unittests/Transforms/Vectorize/VPlanSlpTest.cpp
@@ -56,33 +56,33 @@ TEST_F(VPlanSlpTest, testSlpSimple_2) {
"%struct.Test = type { i32, i32 }\n"
"%struct.Test3 = type { i32, i32, i32 }\n"
"%struct.Test4xi8 = type { i8, i8, i8 }\n"
- "define void @add_x2(%struct.Test* nocapture readonly %A, %struct.Test* "
- "nocapture readonly %B, %struct.Test* nocapture %C) {\n"
+ "define void @add_x2(ptr nocapture readonly %A, ptr "
+ "nocapture readonly %B, ptr nocapture %C) {\n"
"entry:\n"
" br label %for.body\n"
"for.body: ; preds = %for.body, "
"%entry\n"
" %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]\n"
- " %A0 = getelementptr inbounds %struct.Test, %struct.Test* %A, i64 "
+ " %A0 = getelementptr inbounds %struct.Test, ptr %A, i64 "
"%indvars.iv, i32 0\n"
- " %vA0 = load i32, i32* %A0, align 4\n"
- " %B0 = getelementptr inbounds %struct.Test, %struct.Test* %B, i64 "
+ " %vA0 = load i32, ptr %A0, align 4\n"
+ " %B0 = getelementptr inbounds %struct.Test, ptr %B, i64 "
"%indvars.iv, i32 0\n"
- " %vB0 = load i32, i32* %B0, align 4\n"
+ " %vB0 = load i32, ptr %B0, align 4\n"
" %add0 = add nsw i32 %vA0, %vB0\n"
- " %A1 = getelementptr inbounds %struct.Test, %struct.Test* %A, i64 "
+ " %A1 = getelementptr inbounds %struct.Test, ptr %A, i64 "
"%indvars.iv, i32 1\n"
- " %vA1 = load i32, i32* %A1, align 4\n"
- " %B1 = getelementptr inbounds %struct.Test, %struct.Test* %B, i64 "
+ " %vA1 = load i32, ptr %A1, align 4\n"
+ " %B1 = getelementptr inbounds %struct.Test, ptr %B, i64 "
"%indvars.iv, i32 1\n"
- " %vB1 = load i32, i32* %B1, align 4\n"
+ " %vB1 = load i32, ptr %B1, align 4\n"
" %add1 = add nsw i32 %vA1, %vB1\n"
- " %C0 = getelementptr inbounds %struct.Test, %struct.Test* %C, i64 "
+ " %C0 = getelementptr inbounds %struct.Test, ptr %C, i64 "
"%indvars.iv, i32 0\n"
- " store i32 %add0, i32* %C0, align 4\n"
- " %C1 = getelementptr inbounds %struct.Test, %struct.Test* %C, i64 "
+ " store i32 %add0, ptr %C0, align 4\n"
+ " %C1 = getelementptr inbounds %struct.Test, ptr %C, i64 "
"%indvars.iv, i32 1\n"
- " store i32 %add1, i32* %C1, align 4\n"
+ " store i32 %add1, ptr %C1, align 4\n"
" %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1\n"
" %exitcond = icmp eq i64 %indvars.iv.next, 1024\n"
" br i1 %exitcond, label %for.cond.cleanup, label %for.body\n"
@@ -129,33 +129,33 @@ TEST_F(VPlanSlpTest, testSlpSimple_3) {
"%struct.Test = type { i32, i32 }\n"
"%struct.Test3 = type { i32, i32, i32 }\n"
"%struct.Test4xi8 = type { i8, i8, i8 }\n"
- "define void @add_x2(%struct.Test* nocapture readonly %A, %struct.Test* "
- "nocapture readonly %B, %struct.Test* nocapture %C) {\n"
+ "define void @add_x2(ptr nocapture readonly %A, ptr "
+ "nocapture readonly %B, ptr nocapture %C) {\n"
"entry:\n"
" br label %for.body\n"
"for.body: ; preds = %for.body, "
"%entry\n"
" %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]\n"
- " %A0 = getelementptr %struct.Test, %struct.Test* %A, i64 "
+ " %A0 = getelementptr %struct.Test, ptr %A, i64 "
" %indvars.iv, i32 0\n"
- " %vA0 = load i32, i32* %A0, align 4\n"
- " %B0 = getelementptr inbounds %struct.Test, %struct.Test* %B, i64 "
+ " %vA0 = load i32, ptr %A0, align 4\n"
+ " %B0 = getelementptr inbounds %struct.Test, ptr %B, i64 "
" %indvars.iv, i32 0\n"
- " %vB0 = load i32, i32* %B0, align 4\n"
+ " %vB0 = load i32, ptr %B0, align 4\n"
" %add0 = add nsw i32 %vA0, %vB0\n"
- " %A1 = getelementptr inbounds %struct.Test, %struct.Test* %A, i64 "
+ " %A1 = getelementptr inbounds %struct.Test, ptr %A, i64 "
" %indvars.iv, i32 1\n"
- " %vA1 = load i32, i32* %A1, align 4\n"
- " %B1 = getelementptr inbounds %struct.Test, %struct.Test* %B, i64 "
+ " %vA1 = load i32, ptr %A1, align 4\n"
+ " %B1 = getelementptr inbounds %struct.Test, ptr %B, i64 "
" %indvars.iv, i32 1\n"
- " %vB1 = load i32, i32* %B1, align 4\n"
+ " %vB1 = load i32, ptr %B1, align 4\n"
" %add1 = add nsw i32 %vA1, %vB1\n"
- " %C0 = getelementptr inbounds %struct.Test, %struct.Test* %C, i64 "
+ " %C0 = getelementptr inbounds %struct.Test, ptr %C, i64 "
" %indvars.iv, i32 0\n"
- " store i32 %add0, i32* %C0, align 4\n"
- " %C1 = getelementptr inbounds %struct.Test, %struct.Test* %C, i64 "
+ " store i32 %add0, ptr %C0, align 4\n"
+ " %C1 = getelementptr inbounds %struct.Test, ptr %C, i64 "
" %indvars.iv, i32 1\n"
- " store i32 %add1, i32* %C1, align 4\n"
+ " store i32 %add1, ptr %C1, align 4\n"
" %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1\n"
" %exitcond = icmp eq i64 %indvars.iv.next, 1024\n"
" br i1 %exitcond, label %for.cond.cleanup, label %for.body\n"
@@ -206,27 +206,27 @@ TEST_F(VPlanSlpTest, testSlpSimple_3) {
TEST_F(VPlanSlpTest, testSlpReuse_1) {
const char *ModuleString =
"%struct.Test = type { i32, i32 }\n"
- "define void @add_x2(%struct.Test* nocapture readonly %A, %struct.Test* "
- "nocapture readonly %B, %struct.Test* nocapture %C) {\n"
+ "define void @add_x2(ptr nocapture readonly %A, ptr "
+ "nocapture readonly %B, ptr nocapture %C) {\n"
"entry:\n"
" br label %for.body\n"
"for.body: ; preds = %for.body, "
"%entry\n"
" %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]\n"
- " %A0 = getelementptr inbounds %struct.Test, %struct.Test* %A, i64 "
+ " %A0 = getelementptr inbounds %struct.Test, ptr %A, i64 "
"%indvars.iv, i32 0\n"
- " %vA0 = load i32, i32* %A0, align 4\n"
+ " %vA0 = load i32, ptr %A0, align 4\n"
" %add0 = add nsw i32 %vA0, %vA0\n"
- " %A1 = getelementptr inbounds %struct.Test, %struct.Test* %A, i64 "
+ " %A1 = getelementptr inbounds %struct.Test, ptr %A, i64 "
"%indvars.iv, i32 1\n"
- " %vA1 = load i32, i32* %A1, align 4\n"
+ " %vA1 = load i32, ptr %A1, align 4\n"
" %add1 = add nsw i32 %vA1, %vA1\n"
- " %C0 = getelementptr inbounds %struct.Test, %struct.Test* %C, i64 "
+ " %C0 = getelementptr inbounds %struct.Test, ptr %C, i64 "
"%indvars.iv, i32 0\n"
- " store i32 %add0, i32* %C0, align 4\n"
- " %C1 = getelementptr inbounds %struct.Test, %struct.Test* %C, i64 "
+ " store i32 %add0, ptr %C0, align 4\n"
+ " %C1 = getelementptr inbounds %struct.Test, ptr %C, i64 "
"%indvars.iv, i32 1\n"
- " store i32 %add1, i32* %C1, align 4\n"
+ " store i32 %add1, ptr %C1, align 4\n"
" %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1\n"
" %exitcond = icmp eq i64 %indvars.iv.next, 1024\n"
" br i1 %exitcond, label %for.cond.cleanup, label %for.body\n"
@@ -269,27 +269,27 @@ TEST_F(VPlanSlpTest, testSlpReuse_1) {
TEST_F(VPlanSlpTest, testSlpReuse_2) {
const char *ModuleString =
"%struct.Test = type { i32, i32 }\n"
- "define void @add_x2(%struct.Test* nocapture readonly %A, %struct.Test* "
- "nocapture readonly %B, %struct.Test* nocapture %C) {\n"
+ "define void @add_x2(ptr nocapture readonly %A, ptr "
+ "nocapture readonly %B, ptr nocapture %C) {\n"
"entry:\n"
" br label %for.body\n"
"for.body: ; preds = %for.body, "
"%entry\n"
" %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]\n"
- " %A0 = getelementptr inbounds %struct.Test, %struct.Test* %A, i64 "
+ " %A0 = getelementptr inbounds %struct.Test, ptr %A, i64 "
"%indvars.iv, i32 0\n"
- " %vA0 = load i32, i32* %A0, align 4\n"
+ " %vA0 = load i32, ptr %A0, align 4\n"
" %add0 = add nsw i32 %vA0, %vA0\n"
- " %C0 = getelementptr inbounds %struct.Test, %struct.Test* %C, i64 "
+ " %C0 = getelementptr inbounds %struct.Test, ptr %C, i64 "
"%indvars.iv, i32 0\n"
- " store i32 %add0, i32* %C0, align 4\n"
- " %A1 = getelementptr inbounds %struct.Test, %struct.Test* %A, i64 "
+ " store i32 %add0, ptr %C0, align 4\n"
+ " %A1 = getelementptr inbounds %struct.Test, ptr %A, i64 "
"%indvars.iv, i32 1\n"
- " %vA1 = load i32, i32* %A1, align 4\n"
+ " %vA1 = load i32, ptr %A1, align 4\n"
" %add1 = add nsw i32 %vA1, %vA1\n"
- " %C1 = getelementptr inbounds %struct.Test, %struct.Test* %C, i64 "
+ " %C1 = getelementptr inbounds %struct.Test, ptr %C, i64 "
"%indvars.iv, i32 1\n"
- " store i32 %add1, i32* %C1, align 4\n"
+ " store i32 %add1, ptr %C1, align 4\n"
" %use = add i32 %vA1, 1\n"
" %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1\n"
" %exitcond = icmp eq i64 %indvars.iv.next, 1024\n"
@@ -386,49 +386,49 @@ TEST_F(VPlanSlpTest, testSlpReorder_1) {
LLVMContext Ctx;
const char *ModuleString =
"%struct.Test = type { i32, i32 }\n"
- "define void @add_x3(%struct.Test* %A, %struct.Test* %B, %struct.Test* "
- "%C, %struct.Test* %D, %struct.Test* %E) {\n"
+ "define void @add_x3(ptr %A, ptr %B, ptr "
+ "%C, ptr %D, ptr %E) {\n"
"entry:\n"
" br label %for.body\n"
"for.body: ; preds = %for.body, "
"%entry\n"
" %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]\n"
- " %A0 = getelementptr inbounds %struct.Test, %struct.Test* %A, i64 "
+ " %A0 = getelementptr inbounds %struct.Test, ptr %A, i64 "
"%indvars.iv, i32 0\n"
- " %vA0 = load i32, i32* %A0, align 4\n"
- " %B0 = getelementptr inbounds %struct.Test, %struct.Test* %B, i64 "
+ " %vA0 = load i32, ptr %A0, align 4\n"
+ " %B0 = getelementptr inbounds %struct.Test, ptr %B, i64 "
"%indvars.iv, i32 0\n"
- " %vB0 = load i32, i32* %B0, align 4\n"
+ " %vB0 = load i32, ptr %B0, align 4\n"
" %mul11 = mul nsw i32 %vA0, %vB0\n"
- " %C0 = getelementptr inbounds %struct.Test, %struct.Test* %C, i64 "
+ " %C0 = getelementptr inbounds %struct.Test, ptr %C, i64 "
"%indvars.iv, i32 0\n"
- " %vC0 = load i32, i32* %C0, align 4\n"
- " %D0 = getelementptr inbounds %struct.Test, %struct.Test* %D, i64 "
+ " %vC0 = load i32, ptr %C0, align 4\n"
+ " %D0 = getelementptr inbounds %struct.Test, ptr %D, i64 "
"%indvars.iv, i32 0\n"
- " %vD0 = load i32, i32* %D0, align 4\n"
+ " %vD0 = load i32, ptr %D0, align 4\n"
" %mul12 = mul nsw i32 %vC0, %vD0\n"
- " %A1 = getelementptr inbounds %struct.Test, %struct.Test* %A, i64 "
+ " %A1 = getelementptr inbounds %struct.Test, ptr %A, i64 "
"%indvars.iv, i32 1\n"
- " %vA1 = load i32, i32* %A1, align 4\n"
- " %B1 = getelementptr inbounds %struct.Test, %struct.Test* %B, i64 "
+ " %vA1 = load i32, ptr %A1, align 4\n"
+ " %B1 = getelementptr inbounds %struct.Test, ptr %B, i64 "
"%indvars.iv, i32 1\n"
- " %vB1 = load i32, i32* %B1, align 4\n"
+ " %vB1 = load i32, ptr %B1, align 4\n"
" %mul21 = mul nsw i32 %vA1, %vB1\n"
- " %C1 = getelementptr inbounds %struct.Test, %struct.Test* %C, i64 "
+ " %C1 = getelementptr inbounds %struct.Test, ptr %C, i64 "
"%indvars.iv, i32 1\n"
- " %vC1 = load i32, i32* %C1, align 4\n"
- " %D1 = getelementptr inbounds %struct.Test, %struct.Test* %D, i64 "
+ " %vC1 = load i32, ptr %C1, align 4\n"
+ " %D1 = getelementptr inbounds %struct.Test, ptr %D, i64 "
"%indvars.iv, i32 1\n"
- " %vD1 = load i32, i32* %D1, align 4\n"
+ " %vD1 = load i32, ptr %D1, align 4\n"
" %mul22 = mul nsw i32 %vC1, %vD1\n"
" %add1 = add nsw i32 %mul11, %mul12\n"
" %add2 = add nsw i32 %mul22, %mul21\n"
- " %E0 = getelementptr inbounds %struct.Test, %struct.Test* %E, i64 "
+ " %E0 = getelementptr inbounds %struct.Test, ptr %E, i64 "
"%indvars.iv, i32 0\n"
- " store i32 %add1, i32* %E0, align 4\n"
- " %E1 = getelementptr inbounds %struct.Test, %struct.Test* %E, i64 "
+ " store i32 %add1, ptr %E0, align 4\n"
+ " %E1 = getelementptr inbounds %struct.Test, ptr %E, i64 "
"%indvars.iv, i32 1\n"
- " store i32 %add2, i32* %E1, align 4\n"
+ " store i32 %add2, ptr %E1, align 4\n"
" %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1\n"
" %exitcond = icmp eq i64 %indvars.iv.next, 1024\n"
" br i1 %exitcond, label %for.cond.cleanup, label %for.body\n"
@@ -458,49 +458,49 @@ TEST_F(VPlanSlpTest, testSlpReorder_2) {
LLVMContext Ctx;
const char *ModuleString =
"%struct.Test = type { i32, i32 }\n"
- "define void @add_x3(%struct.Test* %A, %struct.Test* %B, %struct.Test* "
- "%C, %struct.Test* %D, %struct.Test* %E) {\n"
+ "define void @add_x3(ptr %A, ptr %B, ptr "
+ "%C, ptr %D, ptr %E) {\n"
"entry:\n"
" br label %for.body\n"
"for.body: ; preds = %for.body, "
"%entry\n"
" %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]\n"
- " %A0 = getelementptr inbounds %struct.Test, %struct.Test* %A, i64 "
+ " %A0 = getelementptr inbounds %struct.Test, ptr %A, i64 "
"%indvars.iv, i32 0\n"
- " %vA0 = load i32, i32* %A0, align 4\n"
- " %B0 = getelementptr inbounds %struct.Test, %struct.Test* %B, i64 "
+ " %vA0 = load i32, ptr %A0, align 4\n"
+ " %B0 = getelementptr inbounds %struct.Test, ptr %B, i64 "
"%indvars.iv, i32 0\n"
- " %vB0 = load i32, i32* %B0, align 4\n"
+ " %vB0 = load i32, ptr %B0, align 4\n"
" %mul11 = mul nsw i32 %vA0, %vB0\n"
- " %C0 = getelementptr inbounds %struct.Test, %struct.Test* %C, i64 "
+ " %C0 = getelementptr inbounds %struct.Test, ptr %C, i64 "
"%indvars.iv, i32 0\n"
- " %vC0 = load i32, i32* %C0, align 4\n"
- " %D0 = getelementptr inbounds %struct.Test, %struct.Test* %D, i64 "
+ " %vC0 = load i32, ptr %C0, align 4\n"
+ " %D0 = getelementptr inbounds %struct.Test, ptr %D, i64 "
"%indvars.iv, i32 0\n"
- " %vD0 = load i32, i32* %D0, align 4\n"
+ " %vD0 = load i32, ptr %D0, align 4\n"
" %mul12 = mul nsw i32 %vC0, %vD0\n"
- " %A1 = getelementptr inbounds %struct.Test, %struct.Test* %A, i64 "
+ " %A1 = getelementptr inbounds %struct.Test, ptr %A, i64 "
"%indvars.iv, i32 1\n"
- " %vA1 = load i32, i32* %A1, align 4\n"
- " %B1 = getelementptr inbounds %struct.Test, %struct.Test* %B, i64 "
+ " %vA1 = load i32, ptr %A1, align 4\n"
+ " %B1 = getelementptr inbounds %struct.Test, ptr %B, i64 "
"%indvars.iv, i32 1\n"
- " %vB1 = load i32, i32* %B1, align 4\n"
+ " %vB1 = load i32, ptr %B1, align 4\n"
" %mul21 = mul nsw i32 %vB1, %vA1\n"
- " %C1 = getelementptr inbounds %struct.Test, %struct.Test* %C, i64 "
+ " %C1 = getelementptr inbounds %struct.Test, ptr %C, i64 "
"%indvars.iv, i32 1\n"
- " %vC1 = load i32, i32* %C1, align 4\n"
- " %D1 = getelementptr inbounds %struct.Test, %struct.Test* %D, i64 "
+ " %vC1 = load i32, ptr %C1, align 4\n"
+ " %D1 = getelementptr inbounds %struct.Test, ptr %D, i64 "
"%indvars.iv, i32 1\n"
- " %vD1 = load i32, i32* %D1, align 4\n"
+ " %vD1 = load i32, ptr %D1, align 4\n"
" %mul22 = mul nsw i32 %vD1, %vC1\n"
" %add1 = add nsw i32 %mul11, %mul12\n"
" %add2 = add nsw i32 %mul22, %mul21\n"
- " %E0 = getelementptr inbounds %struct.Test, %struct.Test* %E, i64 "
+ " %E0 = getelementptr inbounds %struct.Test, ptr %E, i64 "
"%indvars.iv, i32 0\n"
- " store i32 %add1, i32* %E0, align 4\n"
- " %E1 = getelementptr inbounds %struct.Test, %struct.Test* %E, i64 "
+ " store i32 %add1, ptr %E0, align 4\n"
+ " %E1 = getelementptr inbounds %struct.Test, ptr %E, i64 "
"%indvars.iv, i32 1\n"
- " store i32 %add2, i32* %E1, align 4\n"
+ " store i32 %add2, ptr %E1, align 4\n"
" %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1\n"
" %exitcond = icmp eq i64 %indvars.iv.next, 1024\n"
" br i1 %exitcond, label %for.cond.cleanup, label %for.body\n"
@@ -530,49 +530,49 @@ TEST_F(VPlanSlpTest, testSlpReorder_3) {
LLVMContext Ctx;
const char *ModuleString =
"%struct.Test = type { i32, i32 }\n"
- "define void @add_x3(%struct.Test* %A, %struct.Test* %B, %struct.Test* "
- "%C, %struct.Test* %D, %struct.Test* %E) {\n"
+ "define void @add_x3(ptr %A, ptr %B, ptr "
+ "%C, ptr %D, ptr %E) {\n"
"entry:\n"
" br label %for.body\n"
"for.body: ; preds = %for.body, "
"%entry\n"
" %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]\n"
- " %A1 = getelementptr inbounds %struct.Test, %struct.Test* %A, i64 "
+ " %A1 = getelementptr inbounds %struct.Test, ptr %A, i64 "
"%indvars.iv, i32 1\n"
- " %vA1 = load i32, i32* %A1, align 4\n"
- " %B0 = getelementptr inbounds %struct.Test, %struct.Test* %B, i64 "
+ " %vA1 = load i32, ptr %A1, align 4\n"
+ " %B0 = getelementptr inbounds %struct.Test, ptr %B, i64 "
"%indvars.iv, i32 0\n"
- " %vB0 = load i32, i32* %B0, align 4\n"
+ " %vB0 = load i32, ptr %B0, align 4\n"
" %mul11 = mul nsw i32 %vA1, %vB0\n"
- " %C0 = getelementptr inbounds %struct.Test, %struct.Test* %C, i64 "
+ " %C0 = getelementptr inbounds %struct.Test, ptr %C, i64 "
"%indvars.iv, i32 0\n"
- " %vC0 = load i32, i32* %C0, align 4\n"
- " %D0 = getelementptr inbounds %struct.Test, %struct.Test* %D, i64 "
+ " %vC0 = load i32, ptr %C0, align 4\n"
+ " %D0 = getelementptr inbounds %struct.Test, ptr %D, i64 "
"%indvars.iv, i32 0\n"
- " %vD0 = load i32, i32* %D0, align 4\n"
+ " %vD0 = load i32, ptr %D0, align 4\n"
" %mul12 = mul nsw i32 %vC0, %vD0\n"
- " %A0 = getelementptr inbounds %struct.Test, %struct.Test* %A, i64 "
+ " %A0 = getelementptr inbounds %struct.Test, ptr %A, i64 "
"%indvars.iv, i32 0\n"
- " %vA0 = load i32, i32* %A0, align 4\n"
- " %B1 = getelementptr inbounds %struct.Test, %struct.Test* %B, i64 "
+ " %vA0 = load i32, ptr %A0, align 4\n"
+ " %B1 = getelementptr inbounds %struct.Test, ptr %B, i64 "
"%indvars.iv, i32 1\n"
- " %vB1 = load i32, i32* %B1, align 4\n"
+ " %vB1 = load i32, ptr %B1, align 4\n"
" %mul21 = mul nsw i32 %vB1, %vA0\n"
- " %C1 = getelementptr inbounds %struct.Test, %struct.Test* %C, i64 "
+ " %C1 = getelementptr inbounds %struct.Test, ptr %C, i64 "
"%indvars.iv, i32 1\n"
- " %vC1 = load i32, i32* %C1, align 4\n"
- " %D1 = getelementptr inbounds %struct.Test, %struct.Test* %D, i64 "
+ " %vC1 = load i32, ptr %C1, align 4\n"
+ " %D1 = getelementptr inbounds %struct.Test, ptr %D, i64 "
"%indvars.iv, i32 1\n"
- " %vD1 = load i32, i32* %D1, align 4\n"
+ " %vD1 = load i32, ptr %D1, align 4\n"
" %mul22 = mul nsw i32 %vD1, %vC1\n"
" %add1 = add nsw i32 %mul11, %mul12\n"
" %add2 = add nsw i32 %mul22, %mul21\n"
- " %E0 = getelementptr inbounds %struct.Test, %struct.Test* %E, i64 "
+ " %E0 = getelementptr inbounds %struct.Test, ptr %E, i64 "
"%indvars.iv, i32 0\n"
- " store i32 %add1, i32* %E0, align 4\n"
- " %E1 = getelementptr inbounds %struct.Test, %struct.Test* %E, i64 "
+ " store i32 %add1, ptr %E0, align 4\n"
+ " %E1 = getelementptr inbounds %struct.Test, ptr %E, i64 "
"%indvars.iv, i32 1\n"
- " store i32 %add2, i32* %E1, align 4\n"
+ " store i32 %add2, ptr %E1, align 4\n"
" %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1\n"
" %exitcond = icmp eq i64 %indvars.iv.next, 1024\n"
" br i1 %exitcond, label %for.cond.cleanup, label %for.body\n"
@@ -606,49 +606,49 @@ TEST_F(VPlanSlpTest, testSlpReorder_4) {
LLVMContext Ctx;
const char *ModuleString =
"%struct.Test = type { i32, i32 }\n"
- "define void @add_x3(%struct.Test* %A, %struct.Test* %B, %struct.Test* "
- "%C, %struct.Test* %D, %struct.Test* %E) {\n"
+ "define void @add_x3(ptr %A, ptr %B, ptr "
+ "%C, ptr %D, ptr %E) {\n"
"entry:\n"
" br label %for.body\n"
"for.body: ; preds = %for.body, "
"%entry\n"
" %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]\n"
- " %A0 = getelementptr inbounds %struct.Test, %struct.Test* %A, i64 "
+ " %A0 = getelementptr inbounds %struct.Test, ptr %A, i64 "
"%indvars.iv, i32 0\n"
- " %vA0 = load i32, i32* %A0, align 4\n"
- " %B0 = getelementptr inbounds %struct.Test, %struct.Test* %B, i64 "
+ " %vA0 = load i32, ptr %A0, align 4\n"
+ " %B0 = getelementptr inbounds %struct.Test, ptr %B, i64 "
"%indvars.iv, i32 0\n"
- " %vB0 = load i32, i32* %B0, align 4\n"
+ " %vB0 = load i32, ptr %B0, align 4\n"
" %mul11 = mul nsw i32 %vA0, %vB0\n"
- " %C0 = getelementptr inbounds %struct.Test, %struct.Test* %C, i64 "
+ " %C0 = getelementptr inbounds %struct.Test, ptr %C, i64 "
"%indvars.iv, i32 0\n"
- " %vC0 = load i32, i32* %C0, align 4\n"
- " %D0 = getelementptr inbounds %struct.Test, %struct.Test* %D, i64 "
+ " %vC0 = load i32, ptr %C0, align 4\n"
+ " %D0 = getelementptr inbounds %struct.Test, ptr %D, i64 "
"%indvars.iv, i32 0\n"
- " %vD0 = load i32, i32* %D0, align 4\n"
+ " %vD0 = load i32, ptr %D0, align 4\n"
" %mul12 = mul nsw i32 %vC0, %vD0\n"
- " %A1 = getelementptr inbounds %struct.Test, %struct.Test* %A, i64 "
+ " %A1 = getelementptr inbounds %struct.Test, ptr %A, i64 "
"%indvars.iv, i32 1\n"
- " %vA1 = load i32, i32* %A1, align 4\n"
- " %B1 = getelementptr inbounds %struct.Test, %struct.Test* %B, i64 "
+ " %vA1 = load i32, ptr %A1, align 4\n"
+ " %B1 = getelementptr inbounds %struct.Test, ptr %B, i64 "
"%indvars.iv, i32 1\n"
- " %vB1 = load i32, i32* %B1, align 4\n"
+ " %vB1 = load i32, ptr %B1, align 4\n"
" %mul21 = mul nsw i32 %vA1, %vB1\n"
- " %C1 = getelementptr inbounds %struct.Test, %struct.Test* %C, i64 "
+ " %C1 = getelementptr inbounds %struct.Test, ptr %C, i64 "
"%indvars.iv, i32 1\n"
- " %vC1 = load i32, i32* %C1, align 4\n"
- " %D1 = getelementptr inbounds %struct.Test, %struct.Test* %D, i64 "
+ " %vC1 = load i32, ptr %C1, align 4\n"
+ " %D1 = getelementptr inbounds %struct.Test, ptr %D, i64 "
"%indvars.iv, i32 1\n"
- " %vD1 = load i32, i32* %D1, align 4\n"
+ " %vD1 = load i32, ptr %D1, align 4\n"
" %mul22 = mul nsw i32 %vC1, %vD1\n"
" %add1 = add nsw i32 %mul11, %mul12\n"
" %add2 = add nsw i32 %mul22, %mul21\n"
- " %E0 = getelementptr inbounds %struct.Test, %struct.Test* %E, i64 "
+ " %E0 = getelementptr inbounds %struct.Test, ptr %E, i64 "
"%indvars.iv, i32 0\n"
- " store i32 %add1, i32* %E0, align 4\n"
- " %E1 = getelementptr inbounds %struct.Test, %struct.Test* %E, i64 "
+ " store i32 %add1, ptr %E0, align 4\n"
+ " %E1 = getelementptr inbounds %struct.Test, ptr %E, i64 "
"%indvars.iv, i32 1\n"
- " store i32 %add2, i32* %E1, align 4\n"
+ " store i32 %add2, ptr %E1, align 4\n"
" %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1\n"
" %exitcond = icmp eq i64 %indvars.iv.next, 1024\n"
" br i1 %exitcond, label %for.cond.cleanup, label %for.body\n"
@@ -680,35 +680,35 @@ TEST_F(VPlanSlpTest, testInstrsInDifferentBBs) {
"%struct.Test = type { i32, i32 }\n"
"%struct.Test3 = type { i32, i32, i32 }\n"
"%struct.Test4xi8 = type { i8, i8, i8 }\n"
- "define void @add_x2(%struct.Test* nocapture readonly %A, %struct.Test* "
- "nocapture readonly %B, %struct.Test* nocapture %C) {\n"
+ "define void @add_x2(ptr nocapture readonly %A, ptr "
+ "nocapture readonly %B, ptr nocapture %C) {\n"
"entry:\n"
" br label %for.body\n"
"for.body: ; preds = %for.body, "
"%entry\n"
" %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %bb2 ]\n"
- " %A0 = getelementptr inbounds %struct.Test, %struct.Test* %A, i64 "
+ " %A0 = getelementptr inbounds %struct.Test, ptr %A, i64 "
"%indvars.iv, i32 0\n"
- " %vA0 = load i32, i32* %A0, align 4\n"
- " %B0 = getelementptr inbounds %struct.Test, %struct.Test* %B, i64 "
+ " %vA0 = load i32, ptr %A0, align 4\n"
+ " %B0 = getelementptr inbounds %struct.Test, ptr %B, i64 "
"%indvars.iv, i32 0\n"
- " %vB0 = load i32, i32* %B0, align 4\n"
+ " %vB0 = load i32, ptr %B0, align 4\n"
" %add0 = add nsw i32 %vA0, %vB0\n"
- " %A1 = getelementptr inbounds %struct.Test, %struct.Test* %A, i64 "
+ " %A1 = getelementptr inbounds %struct.Test, ptr %A, i64 "
"%indvars.iv, i32 1\n"
- " %vA1 = load i32, i32* %A1, align 4\n"
- " %B1 = getelementptr inbounds %struct.Test, %struct.Test* %B, i64 "
+ " %vA1 = load i32, ptr %A1, align 4\n"
+ " %B1 = getelementptr inbounds %struct.Test, ptr %B, i64 "
"%indvars.iv, i32 1\n"
" br label %bb2\n"
"bb2:\n"
- " %vB1 = load i32, i32* %B1, align 4\n"
+ " %vB1 = load i32, ptr %B1, align 4\n"
" %add1 = add nsw i32 %vA1, %vB1\n"
- " %C0 = getelementptr inbounds %struct.Test, %struct.Test* %C, i64 "
+ " %C0 = getelementptr inbounds %struct.Test, ptr %C, i64 "
"%indvars.iv, i32 0\n"
- " store i32 %add0, i32* %C0, align 4\n"
- " %C1 = getelementptr inbounds %struct.Test, %struct.Test* %C, i64 "
+ " store i32 %add0, ptr %C0, align 4\n"
+ " %C1 = getelementptr inbounds %struct.Test, ptr %C, i64 "
"%indvars.iv, i32 1\n"
- " store i32 %add1, i32* %C1, align 4\n"
+ " store i32 %add1, ptr %C1, align 4\n"
" %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1\n"
" %exitcond = icmp eq i64 %indvars.iv.next, 1024\n"
" br i1 %exitcond, label %for.cond.cleanup, label %for.body\n"
@@ -743,35 +743,35 @@ TEST_F(VPlanSlpTest, testInstrsInDifferentBBs2) {
"%struct.Test = type { i32, i32 }\n"
"%struct.Test3 = type { i32, i32, i32 }\n"
"%struct.Test4xi8 = type { i8, i8, i8 }\n"
- "define void @add_x2(%struct.Test* nocapture readonly %A, %struct.Test* "
- "nocapture readonly %B, %struct.Test* nocapture %C) {\n"
+ "define void @add_x2(ptr nocapture readonly %A, ptr "
+ "nocapture readonly %B, ptr nocapture %C) {\n"
"entry:\n"
" br label %for.body\n"
"for.body: ; preds = %for.body, "
"%entry\n"
" %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %bb2 ]\n"
- " %A0 = getelementptr inbounds %struct.Test, %struct.Test* %A, i64 "
+ " %A0 = getelementptr inbounds %struct.Test, ptr %A, i64 "
"%indvars.iv, i32 0\n"
- " %vA0 = load i32, i32* %A0, align 4\n"
- " %B0 = getelementptr inbounds %struct.Test, %struct.Test* %B, i64 "
+ " %vA0 = load i32, ptr %A0, align 4\n"
+ " %B0 = getelementptr inbounds %struct.Test, ptr %B, i64 "
"%indvars.iv, i32 0\n"
- " %vB0 = load i32, i32* %B0, align 4\n"
+ " %vB0 = load i32, ptr %B0, align 4\n"
" %add0 = add nsw i32 %vA0, %vB0\n"
- " %A1 = getelementptr inbounds %struct.Test, %struct.Test* %A, i64 "
+ " %A1 = getelementptr inbounds %struct.Test, ptr %A, i64 "
"%indvars.iv, i32 1\n"
- " %vA1 = load i32, i32* %A1, align 4\n"
- " %B1 = getelementptr inbounds %struct.Test, %struct.Test* %B, i64 "
+ " %vA1 = load i32, ptr %A1, align 4\n"
+ " %B1 = getelementptr inbounds %struct.Test, ptr %B, i64 "
"%indvars.iv, i32 1\n"
- " %vB1 = load i32, i32* %B1, align 4\n"
+ " %vB1 = load i32, ptr %B1, align 4\n"
" %add1 = add nsw i32 %vA1, %vB1\n"
" br label %bb2\n"
"bb2:\n"
- " %C0 = getelementptr inbounds %struct.Test, %struct.Test* %C, i64 "
+ " %C0 = getelementptr inbounds %struct.Test, ptr %C, i64 "
"%indvars.iv, i32 0\n"
- " store i32 %add0, i32* %C0, align 4\n"
- " %C1 = getelementptr inbounds %struct.Test, %struct.Test* %C, i64 "
+ " store i32 %add0, ptr %C0, align 4\n"
+ " %C1 = getelementptr inbounds %struct.Test, ptr %C, i64 "
"%indvars.iv, i32 1\n"
- " store i32 %add1, i32* %C1, align 4\n"
+ " store i32 %add1, ptr %C1, align 4\n"
" %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1\n"
" %exitcond = icmp eq i64 %indvars.iv.next, 1024\n"
" br i1 %exitcond, label %for.cond.cleanup, label %for.body\n"
@@ -805,33 +805,33 @@ TEST_F(VPlanSlpTest, testSlpAtomicLoad) {
"%struct.Test = type { i32, i32 }\n"
"%struct.Test3 = type { i32, i32, i32 }\n"
"%struct.Test4xi8 = type { i8, i8, i8 }\n"
- "define void @add_x2(%struct.Test* nocapture readonly %A, %struct.Test* "
- "nocapture readonly %B, %struct.Test* nocapture %C) {\n"
+ "define void @add_x2(ptr nocapture readonly %A, ptr "
+ "nocapture readonly %B, ptr nocapture %C) {\n"
"entry:\n"
" br label %for.body\n"
"for.body: ; preds = %for.body, "
"%entry\n"
" %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]\n"
- " %A0 = getelementptr inbounds %struct.Test, %struct.Test* %A, i64 "
+ " %A0 = getelementptr inbounds %struct.Test, ptr %A, i64 "
"%indvars.iv, i32 0\n"
- " %vA0 = load atomic i32, i32* %A0 monotonic, align 4\n"
- " %B0 = getelementptr inbounds %struct.Test, %struct.Test* %B, i64 "
+ " %vA0 = load atomic i32, ptr %A0 monotonic, align 4\n"
+ " %B0 = getelementptr inbounds %struct.Test, ptr %B, i64 "
"%indvars.iv, i32 0\n"
- " %vB0 = load i32, i32* %B0, align 4\n"
+ " %vB0 = load i32, ptr %B0, align 4\n"
" %add0 = add nsw i32 %vA0, %vB0\n"
- " %A1 = getelementptr inbounds %struct.Test, %struct.Test* %A, i64 "
+ " %A1 = getelementptr inbounds %struct.Test, ptr %A, i64 "
"%indvars.iv, i32 1\n"
- " %vA1 = load i32, i32* %A1, align 4\n"
- " %B1 = getelementptr inbounds %struct.Test, %struct.Test* %B, i64 "
+ " %vA1 = load i32, ptr %A1, align 4\n"
+ " %B1 = getelementptr inbounds %struct.Test, ptr %B, i64 "
"%indvars.iv, i32 1\n"
- " %vB1 = load i32, i32* %B1, align 4\n"
+ " %vB1 = load i32, ptr %B1, align 4\n"
" %add1 = add nsw i32 %vA1, %vB1\n"
- " %C0 = getelementptr inbounds %struct.Test, %struct.Test* %C, i64 "
+ " %C0 = getelementptr inbounds %struct.Test, ptr %C, i64 "
"%indvars.iv, i32 0\n"
- " store i32 %add0, i32* %C0, align 4\n"
- " %C1 = getelementptr inbounds %struct.Test, %struct.Test* %C, i64 "
+ " store i32 %add0, ptr %C0, align 4\n"
+ " %C1 = getelementptr inbounds %struct.Test, ptr %C, i64 "
"%indvars.iv, i32 1\n"
- " store i32 %add1, i32* %C1, align 4\n"
+ " store i32 %add1, ptr %C1, align 4\n"
" %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1\n"
" %exitcond = icmp eq i64 %indvars.iv.next, 1024\n"
" br i1 %exitcond, label %for.cond.cleanup, label %for.body\n"
@@ -864,33 +864,33 @@ TEST_F(VPlanSlpTest, testSlpAtomicStore) {
"%struct.Test = type { i32, i32 }\n"
"%struct.Test3 = type { i32, i32, i32 }\n"
"%struct.Test4xi8 = type { i8, i8, i8 }\n"
- "define void @add_x2(%struct.Test* nocapture readonly %A, %struct.Test* "
- "nocapture readonly %B, %struct.Test* nocapture %C) {\n"
+ "define void @add_x2(ptr nocapture readonly %A, ptr "
+ "nocapture readonly %B, ptr nocapture %C) {\n"
"entry:\n"
" br label %for.body\n"
"for.body: ; preds = %for.body, "
"%entry\n"
" %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]\n"
- " %A0 = getelementptr inbounds %struct.Test, %struct.Test* %A, i64 "
+ " %A0 = getelementptr inbounds %struct.Test, ptr %A, i64 "
"%indvars.iv, i32 0\n"
- " %vA0 = load i32, i32* %A0, align 4\n"
- " %B0 = getelementptr inbounds %struct.Test, %struct.Test* %B, i64 "
+ " %vA0 = load i32, ptr %A0, align 4\n"
+ " %B0 = getelementptr inbounds %struct.Test, ptr %B, i64 "
"%indvars.iv, i32 0\n"
- " %vB0 = load i32, i32* %B0, align 4\n"
+ " %vB0 = load i32, ptr %B0, align 4\n"
" %add0 = add nsw i32 %vA0, %vB0\n"
- " %A1 = getelementptr inbounds %struct.Test, %struct.Test* %A, i64 "
+ " %A1 = getelementptr inbounds %struct.Test, ptr %A, i64 "
"%indvars.iv, i32 1\n"
- " %vA1 = load i32, i32* %A1, align 4\n"
- " %B1 = getelementptr inbounds %struct.Test, %struct.Test* %B, i64 "
+ " %vA1 = load i32, ptr %A1, align 4\n"
+ " %B1 = getelementptr inbounds %struct.Test, ptr %B, i64 "
"%indvars.iv, i32 1\n"
- " %vB1 = load i32, i32* %B1, align 4\n"
+ " %vB1 = load i32, ptr %B1, align 4\n"
" %add1 = add nsw i32 %vA1, %vB1\n"
- " %C0 = getelementptr inbounds %struct.Test, %struct.Test* %C, i64 "
+ " %C0 = getelementptr inbounds %struct.Test, ptr %C, i64 "
"%indvars.iv, i32 0\n"
- " store atomic i32 %add0, i32* %C0 monotonic, align 4\n"
- " %C1 = getelementptr inbounds %struct.Test, %struct.Test* %C, i64 "
+ " store atomic i32 %add0, ptr %C0 monotonic, align 4\n"
+ " %C1 = getelementptr inbounds %struct.Test, ptr %C, i64 "
"%indvars.iv, i32 1\n"
- " store i32 %add1, i32* %C1, align 4\n"
+ " store i32 %add1, ptr %C1, align 4\n"
" %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1\n"
" %exitcond = icmp eq i64 %indvars.iv.next, 1024\n"
" br i1 %exitcond, label %for.cond.cleanup, label %for.body\n"
More information about the llvm-commits
mailing list