[llvm] f6ec56a - [LoopDistribute] Convert tests to opaque pointers (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 26 03:32:13 PDT 2023
Author: Nikita Popov
Date: 2023-04-26T12:32:04+02:00
New Revision: f6ec56ac5be26ad862e22d0eebb2645d1ad78218
URL: https://github.com/llvm/llvm-project/commit/f6ec56ac5be26ad862e22d0eebb2645d1ad78218
DIFF: https://github.com/llvm/llvm-project/commit/f6ec56ac5be26ad862e22d0eebb2645d1ad78218.diff
LOG: [LoopDistribute] Convert tests to opaque pointers (NFC)
Added:
Modified:
llvm/test/Transforms/LoopDistribute/basic-with-memchecks.ll
llvm/test/Transforms/LoopDistribute/followup.ll
llvm/test/Transforms/LoopDistribute/outside-use.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/LoopDistribute/basic-with-memchecks.ll b/llvm/test/Transforms/LoopDistribute/basic-with-memchecks.ll
index 3a57dfd5148bd..d1cff14c3f4b7 100644
--- a/llvm/test/Transforms/LoopDistribute/basic-with-memchecks.ll
+++ b/llvm/test/Transforms/LoopDistribute/basic-with-memchecks.ll
@@ -1,11 +1,11 @@
-; RUN: opt -opaque-pointers=0 -aa-pipeline=basic-aa -passes=loop-distribute -enable-loop-distribute -verify-loop-info -verify-dom-info -S \
+; RUN: opt -aa-pipeline=basic-aa -passes=loop-distribute -enable-loop-distribute -verify-loop-info -verify-dom-info -S \
; RUN: < %s | FileCheck %s
-; RUN: opt -opaque-pointers=0 -aa-pipeline=basic-aa -passes='loop-distribute,loop-vectorize' -enable-loop-distribute -force-vector-width=4 \
+; RUN: opt -aa-pipeline=basic-aa -passes='loop-distribute,loop-vectorize' -enable-loop-distribute -force-vector-width=4 \
; RUN: -verify-loop-info -verify-dom-info -S < %s | \
; RUN: FileCheck --check-prefix=VECTORIZE %s
-; RUN: opt -opaque-pointers=0 -aa-pipeline=basic-aa -passes='loop-distribute,print<access-info>' -enable-loop-distribute \
+; RUN: opt -aa-pipeline=basic-aa -passes='loop-distribute,print<access-info>' -enable-loop-distribute \
; RUN: -verify-loop-info -verify-dom-info -disable-output < %s 2>&1 | FileCheck %s --check-prefix=ANALYSIS
; The memcheck version of basic.ll. We should distribute and vectorize the
@@ -20,20 +20,20 @@
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.10.0"
- at B = common global i32* null, align 8
- at A = common global i32* null, align 8
- at C = common global i32* null, align 8
- at D = common global i32* null, align 8
- at E = common global i32* null, align 8
+ at B = common global ptr null, align 8
+ at A = common global ptr null, align 8
+ at C = common global ptr null, align 8
+ at D = common global ptr null, align 8
+ at E = common global ptr null, align 8
; CHECK-LABEL: @f(
define void @f() {
entry:
- %a = load i32*, i32** @A, align 8
- %b = load i32*, i32** @B, align 8
- %c = load i32*, i32** @C, align 8
- %d = load i32*, i32** @D, align 8
- %e = load i32*, i32** @E, align 8
+ %a = load ptr, ptr @A, align 8
+ %b = load ptr, ptr @B, align 8
+ %c = load ptr, ptr @C, align 8
+ %d = load ptr, ptr @D, align 8
+ %e = load ptr, ptr @E, align 8
br label %for.body
; We have two compares for each array overlap check.
@@ -54,7 +54,7 @@ entry:
; CHECK: = icmp
; CHECK-NOT: = icmp
-; CHECK: br i1 %conflict.rdx25, label %for.body.ph.lver.orig, label %for.body.ph.ldist1
+; CHECK: br i1 %conflict.rdx15, label %for.body.ph.lver.orig, label %for.body.ph.ldist1
; The non-distributed loop that the memchecks fall back on.
@@ -83,28 +83,28 @@ entry:
for.body: ; preds = %for.body, %entry
%ind = phi i64 [ 0, %entry ], [ %add, %for.body ]
- %arrayidxA = getelementptr inbounds i32, i32* %a, i64 %ind
- %loadA = load i32, i32* %arrayidxA, align 4
+ %arrayidxA = getelementptr inbounds i32, ptr %a, i64 %ind
+ %loadA = load i32, ptr %arrayidxA, align 4
- %arrayidxB = getelementptr inbounds i32, i32* %b, i64 %ind
- %loadB = load i32, i32* %arrayidxB, align 4
+ %arrayidxB = getelementptr inbounds i32, ptr %b, i64 %ind
+ %loadB = load i32, ptr %arrayidxB, align 4
%mulA = mul i32 %loadB, %loadA
%add = add nuw nsw i64 %ind, 1
- %arrayidxA_plus_4 = getelementptr inbounds i32, i32* %a, i64 %add
- store i32 %mulA, i32* %arrayidxA_plus_4, align 4
+ %arrayidxA_plus_4 = getelementptr inbounds i32, ptr %a, i64 %add
+ store i32 %mulA, ptr %arrayidxA_plus_4, align 4
- %arrayidxD = getelementptr inbounds i32, i32* %d, i64 %ind
- %loadD = load i32, i32* %arrayidxD, align 4
+ %arrayidxD = getelementptr inbounds i32, ptr %d, i64 %ind
+ %loadD = load i32, ptr %arrayidxD, align 4
- %arrayidxE = getelementptr inbounds i32, i32* %e, i64 %ind
- %loadE = load i32, i32* %arrayidxE, align 4
+ %arrayidxE = getelementptr inbounds i32, ptr %e, i64 %ind
+ %loadE = load i32, ptr %arrayidxE, align 4
%mulC = mul i32 %loadD, %loadE
- %arrayidxC = getelementptr inbounds i32, i32* %c, i64 %ind
- store i32 %mulC, i32* %arrayidxC, align 4
+ %arrayidxC = getelementptr inbounds i32, ptr %c, i64 %ind
+ store i32 %mulC, ptr %arrayidxC, align 4
%exitcond = icmp eq i64 %add, 20
br i1 %exitcond, label %for.end, label %for.body
@@ -137,38 +137,38 @@ for.end: ; preds = %for.body
; VECTORIZE-NOT: mul <4 x i32>
define void @f_volatile_load() {
entry:
- %a = load i32*, i32** @A, align 8
- %b = load i32*, i32** @B, align 8
- %c = load i32*, i32** @C, align 8
- %d = load i32*, i32** @D, align 8
- %e = load i32*, i32** @E, align 8
+ %a = load ptr, ptr @A, align 8
+ %b = load ptr, ptr @B, align 8
+ %c = load ptr, ptr @C, align 8
+ %d = load ptr, ptr @D, align 8
+ %e = load ptr, ptr @E, align 8
br label %for.body
for.body:
%ind = phi i64 [ 0, %entry ], [ %add, %for.body ]
- %arrayidxA = getelementptr inbounds i32, i32* %a, i64 %ind
- %loadA = load i32, i32* %arrayidxA, align 4
+ %arrayidxA = getelementptr inbounds i32, ptr %a, i64 %ind
+ %loadA = load i32, ptr %arrayidxA, align 4
- %arrayidxB = getelementptr inbounds i32, i32* %b, i64 %ind
- %loadB = load i32, i32* %arrayidxB, align 4
+ %arrayidxB = getelementptr inbounds i32, ptr %b, i64 %ind
+ %loadB = load i32, ptr %arrayidxB, align 4
%mulA = mul i32 %loadB, %loadA
%add = add nuw nsw i64 %ind, 1
- %arrayidxA_plus_4 = getelementptr inbounds i32, i32* %a, i64 %add
- store i32 %mulA, i32* %arrayidxA_plus_4, align 4
+ %arrayidxA_plus_4 = getelementptr inbounds i32, ptr %a, i64 %add
+ store i32 %mulA, ptr %arrayidxA_plus_4, align 4
- %arrayidxD = getelementptr inbounds i32, i32* %d, i64 %ind
- %loadD = load volatile i32, i32* %arrayidxD, align 4
+ %arrayidxD = getelementptr inbounds i32, ptr %d, i64 %ind
+ %loadD = load volatile i32, ptr %arrayidxD, align 4
- %arrayidxE = getelementptr inbounds i32, i32* %e, i64 %ind
- %loadE = load i32, i32* %arrayidxE, align 4
+ %arrayidxE = getelementptr inbounds i32, ptr %e, i64 %ind
+ %loadE = load i32, ptr %arrayidxE, align 4
%mulC = mul i32 %loadD, %loadE
- %arrayidxC = getelementptr inbounds i32, i32* %c, i64 %ind
- store i32 %mulC, i32* %arrayidxC, align 4
+ %arrayidxC = getelementptr inbounds i32, ptr %c, i64 %ind
+ store i32 %mulC, ptr %arrayidxC, align 4
%exitcond = icmp eq i64 %add, 20
br i1 %exitcond, label %for.end, label %for.body
@@ -191,39 +191,39 @@ declare i32 @llvm.convergent(i32) #0
; ANALYSIS: Report: cannot add control dependency to convergent operation
define void @f_with_convergent() #1 {
entry:
- %a = load i32*, i32** @A, align 8
- %b = load i32*, i32** @B, align 8
- %c = load i32*, i32** @C, align 8
- %d = load i32*, i32** @D, align 8
- %e = load i32*, i32** @E, align 8
+ %a = load ptr, ptr @A, align 8
+ %b = load ptr, ptr @B, align 8
+ %c = load ptr, ptr @C, align 8
+ %d = load ptr, ptr @D, align 8
+ %e = load ptr, ptr @E, align 8
br label %for.body
for.body: ; preds = %for.body, %entry
%ind = phi i64 [ 0, %entry ], [ %add, %for.body ]
- %arrayidxA = getelementptr inbounds i32, i32* %a, i64 %ind
- %loadA = load i32, i32* %arrayidxA, align 4
+ %arrayidxA = getelementptr inbounds i32, ptr %a, i64 %ind
+ %loadA = load i32, ptr %arrayidxA, align 4
- %arrayidxB = getelementptr inbounds i32, i32* %b, i64 %ind
- %loadB = load i32, i32* %arrayidxB, align 4
+ %arrayidxB = getelementptr inbounds i32, ptr %b, i64 %ind
+ %loadB = load i32, ptr %arrayidxB, align 4
%mulA = mul i32 %loadB, %loadA
%add = add nuw nsw i64 %ind, 1
- %arrayidxA_plus_4 = getelementptr inbounds i32, i32* %a, i64 %add
- store i32 %mulA, i32* %arrayidxA_plus_4, align 4
+ %arrayidxA_plus_4 = getelementptr inbounds i32, ptr %a, i64 %add
+ store i32 %mulA, ptr %arrayidxA_plus_4, align 4
- %arrayidxD = getelementptr inbounds i32, i32* %d, i64 %ind
- %loadD = load i32, i32* %arrayidxD, align 4
+ %arrayidxD = getelementptr inbounds i32, ptr %d, i64 %ind
+ %loadD = load i32, ptr %arrayidxD, align 4
- %arrayidxE = getelementptr inbounds i32, i32* %e, i64 %ind
- %loadE = load i32, i32* %arrayidxE, align 4
+ %arrayidxE = getelementptr inbounds i32, ptr %e, i64 %ind
+ %loadE = load i32, ptr %arrayidxE, align 4
%convergentD = call i32 @llvm.convergent(i32 %loadD)
%mulC = mul i32 %convergentD, %loadE
- %arrayidxC = getelementptr inbounds i32, i32* %c, i64 %ind
- store i32 %mulC, i32* %arrayidxC, align 4
+ %arrayidxC = getelementptr inbounds i32, ptr %c, i64 %ind
+ store i32 %mulC, ptr %arrayidxC, align 4
%exitcond = icmp eq i64 %add, 20
br i1 %exitcond, label %for.end, label %for.body
@@ -240,39 +240,39 @@ for.end: ; preds = %for.body
; CHECK-NOT: call i32 @llvm.convergent
define void @f_with_convergent_forced_distribute() #1 {
entry:
- %a = load i32*, i32** @A, align 8
- %b = load i32*, i32** @B, align 8
- %c = load i32*, i32** @C, align 8
- %d = load i32*, i32** @D, align 8
- %e = load i32*, i32** @E, align 8
+ %a = load ptr, ptr @A, align 8
+ %b = load ptr, ptr @B, align 8
+ %c = load ptr, ptr @C, align 8
+ %d = load ptr, ptr @D, align 8
+ %e = load ptr, ptr @E, align 8
br label %for.body
for.body: ; preds = %for.body, %entry
%ind = phi i64 [ 0, %entry ], [ %add, %for.body ]
- %arrayidxA = getelementptr inbounds i32, i32* %a, i64 %ind
- %loadA = load i32, i32* %arrayidxA, align 4
+ %arrayidxA = getelementptr inbounds i32, ptr %a, i64 %ind
+ %loadA = load i32, ptr %arrayidxA, align 4
- %arrayidxB = getelementptr inbounds i32, i32* %b, i64 %ind
- %loadB = load i32, i32* %arrayidxB, align 4
+ %arrayidxB = getelementptr inbounds i32, ptr %b, i64 %ind
+ %loadB = load i32, ptr %arrayidxB, align 4
%mulA = mul i32 %loadB, %loadA
%add = add nuw nsw i64 %ind, 1
- %arrayidxA_plus_4 = getelementptr inbounds i32, i32* %a, i64 %add
- store i32 %mulA, i32* %arrayidxA_plus_4, align 4
+ %arrayidxA_plus_4 = getelementptr inbounds i32, ptr %a, i64 %add
+ store i32 %mulA, ptr %arrayidxA_plus_4, align 4
- %arrayidxD = getelementptr inbounds i32, i32* %d, i64 %ind
- %loadD = load i32, i32* %arrayidxD, align 4
+ %arrayidxD = getelementptr inbounds i32, ptr %d, i64 %ind
+ %loadD = load i32, ptr %arrayidxD, align 4
- %arrayidxE = getelementptr inbounds i32, i32* %e, i64 %ind
- %loadE = load i32, i32* %arrayidxE, align 4
+ %arrayidxE = getelementptr inbounds i32, ptr %e, i64 %ind
+ %loadE = load i32, ptr %arrayidxE, align 4
%convergentD = call i32 @llvm.convergent(i32 %loadD)
%mulC = mul i32 %convergentD, %loadE
- %arrayidxC = getelementptr inbounds i32, i32* %c, i64 %ind
- store i32 %mulC, i32* %arrayidxC, align 4
+ %arrayidxC = getelementptr inbounds i32, ptr %c, i64 %ind
+ store i32 %mulC, ptr %arrayidxC, align 4
%exitcond = icmp eq i64 %add, 20
br i1 %exitcond, label %for.end, label %for.body, !llvm.loop !0
diff --git a/llvm/test/Transforms/LoopDistribute/followup.ll b/llvm/test/Transforms/LoopDistribute/followup.ll
index 99cd3fdd49bd9..86cfb1855ae34 100644
--- a/llvm/test/Transforms/LoopDistribute/followup.ll
+++ b/llvm/test/Transforms/LoopDistribute/followup.ll
@@ -1,39 +1,39 @@
-; RUN: opt -opaque-pointers=0 -passes=loop-distribute -S < %s | FileCheck %s
+; RUN: opt -passes=loop-distribute -S < %s | FileCheck %s
;
; Check that followup loop-attributes are applied to the loops after
; loop distribution.
;
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
-define void @f(i32* %a, i32* %b, i32* %c, i32* %d, i32* %e) {
+define void @f(ptr %a, ptr %b, ptr %c, ptr %d, ptr %e) {
entry:
br label %for.body
for.body:
%ind = phi i64 [ 0, %entry ], [ %add, %for.body ]
- %arrayidxA = getelementptr inbounds i32, i32* %a, i64 %ind
- %loadA = load i32, i32* %arrayidxA, align 4
+ %arrayidxA = getelementptr inbounds i32, ptr %a, i64 %ind
+ %loadA = load i32, ptr %arrayidxA, align 4
- %arrayidxB = getelementptr inbounds i32, i32* %b, i64 %ind
- %loadB = load i32, i32* %arrayidxB, align 4
+ %arrayidxB = getelementptr inbounds i32, ptr %b, i64 %ind
+ %loadB = load i32, ptr %arrayidxB, align 4
%mulA = mul i32 %loadB, %loadA
%add = add nuw nsw i64 %ind, 1
- %arrayidxA_plus_4 = getelementptr inbounds i32, i32* %a, i64 %add
- store i32 %mulA, i32* %arrayidxA_plus_4, align 4
+ %arrayidxA_plus_4 = getelementptr inbounds i32, ptr %a, i64 %add
+ store i32 %mulA, ptr %arrayidxA_plus_4, align 4
- %arrayidxD = getelementptr inbounds i32, i32* %d, i64 %ind
- %loadD = load i32, i32* %arrayidxD, align 4
+ %arrayidxD = getelementptr inbounds i32, ptr %d, i64 %ind
+ %loadD = load i32, ptr %arrayidxD, align 4
- %arrayidxE = getelementptr inbounds i32, i32* %e, i64 %ind
- %loadE = load i32, i32* %arrayidxE, align 4
+ %arrayidxE = getelementptr inbounds i32, ptr %e, i64 %ind
+ %loadE = load i32, ptr %arrayidxE, align 4
%mulC = mul i32 %loadD, %loadE
- %arrayidxC = getelementptr inbounds i32, i32* %c, i64 %ind
- store i32 %mulC, i32* %arrayidxC, align 4
+ %arrayidxC = getelementptr inbounds i32, ptr %c, i64 %ind
+ store i32 %mulC, ptr %arrayidxC, align 4
%exitcond = icmp eq i64 %add, 20
br i1 %exitcond, label %for.end, label %for.body, !llvm.loop !0
@@ -55,10 +55,10 @@ for.end:
; CHECK-LABEL: for.body.ldist1:
; CHECK: br i1 %exitcond.ldist1, label %for.body.ph, label %for.body.ldist1, !llvm.loop ![[LOOP_SEQUENTIAL:[0-9]+]]
; CHECK-LABEL: for.body:
-; CHECK: br i1 %exitcond, label %for.end.loopexit26, label %for.body, !llvm.loop ![[LOOP_COINCIDENT:[0-9]+]]
+; CHECK: br i1 %exitcond, label %for.end.loopexit16, label %for.body, !llvm.loop ![[LOOP_COINCIDENT:[0-9]+]]
; CHECK-LABEL: for.end.loopexit:
; CHECK: br label %for.end
-; CHECK-LABEL: for.end.loopexit26:
+; CHECK-LABEL: for.end.loopexit16:
; CHECK: br label %for.end
; CHECK: ![[LOOP_ORIG]] = distinct !{![[LOOP_ORIG]], ![[FOLLOWUP_ALL:[0-9]+]], ![[FOLLOUP_FALLBACK:[0-9]+]]}
diff --git a/llvm/test/Transforms/LoopDistribute/outside-use.ll b/llvm/test/Transforms/LoopDistribute/outside-use.ll
index 2d87dfc421b4a..e564c445fc6b9 100644
--- a/llvm/test/Transforms/LoopDistribute/outside-use.ll
+++ b/llvm/test/Transforms/LoopDistribute/outside-use.ll
@@ -1,4 +1,4 @@
-; RUN: opt -opaque-pointers=0 -passes=loop-distribute -enable-loop-distribute -verify-loop-info -verify-dom-info -S < %s \
+; RUN: opt -passes=loop-distribute -enable-loop-distribute -verify-loop-info -verify-dom-info -S < %s \
; RUN: | FileCheck %s
; Check that definitions used outside the loop are handled correctly: (1) they
@@ -14,20 +14,20 @@
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.10.0"
- at B = common global i32* null, align 8
- at A = common global i32* null, align 8
- at C = common global i32* null, align 8
- at D = common global i32* null, align 8
- at E = common global i32* null, align 8
+ at B = common global ptr null, align 8
+ at A = common global ptr null, align 8
+ at C = common global ptr null, align 8
+ at D = common global ptr null, align 8
+ at E = common global ptr null, align 8
@SUM = common global i32 0, align 8
define void @f() {
entry:
- %a = load i32*, i32** @A, align 8
- %b = load i32*, i32** @B, align 8
- %c = load i32*, i32** @C, align 8
- %d = load i32*, i32** @D, align 8
- %e = load i32*, i32** @E, align 8
+ %a = load ptr, ptr @A, align 8
+ %b = load ptr, ptr @B, align 8
+ %c = load ptr, ptr @C, align 8
+ %d = load ptr, ptr @D, align 8
+ %e = load ptr, ptr @E, align 8
br label %for.body
@@ -38,29 +38,29 @@ entry:
; CHECK: %sum_add = add nuw nsw i32 %sum, %loadC
; CHECK: for.end.loopexit:
; CHECK: %sum_add.lver.ph = phi i32 [ %sum_add.lver.orig, %for.body.lver.orig ]
-; CHECK: for.end.loopexit6:
-; CHECK: %sum_add.lver.ph7 = phi i32 [ %sum_add, %for.body ]
+; CHECK: for.end.loopexit2:
+; CHECK: %sum_add.lver.ph3 = phi i32 [ %sum_add, %for.body ]
; CHECK: for.end:
-; CHECK: %sum_add.lver = phi i32 [ %sum_add.lver.ph, %for.end.loopexit ], [ %sum_add.lver.ph7, %for.end.loopexit6 ]
+; CHECK: %sum_add.lver = phi i32 [ %sum_add.lver.ph, %for.end.loopexit ], [ %sum_add.lver.ph3, %for.end.loopexit2 ]
for.body: ; preds = %for.body, %entry
%ind = phi i64 [ 0, %entry ], [ %add, %for.body ]
%sum = phi i32 [ 0, %entry ], [ %sum_add, %for.body ]
- %arrayidxA = getelementptr inbounds i32, i32* %a, i64 %ind
- %loadA = load i32, i32* %arrayidxA, align 4
+ %arrayidxA = getelementptr inbounds i32, ptr %a, i64 %ind
+ %loadA = load i32, ptr %arrayidxA, align 4
- %arrayidxB = getelementptr inbounds i32, i32* %b, i64 %ind
- %loadB = load i32, i32* %arrayidxB, align 4
+ %arrayidxB = getelementptr inbounds i32, ptr %b, i64 %ind
+ %loadB = load i32, ptr %arrayidxB, align 4
%mulA = mul i32 %loadB, %loadA
%add = add nuw nsw i64 %ind, 1
- %arrayidxA_plus_4 = getelementptr inbounds i32, i32* %a, i64 %add
- store i32 %mulA, i32* %arrayidxA_plus_4, align 4
+ %arrayidxA_plus_4 = getelementptr inbounds i32, ptr %a, i64 %add
+ store i32 %mulA, ptr %arrayidxA_plus_4, align 4
- %arrayidxC = getelementptr inbounds i32, i32* %c, i64 %ind
- %loadC = load i32, i32* %arrayidxC, align 4
+ %arrayidxC = getelementptr inbounds i32, ptr %c, i64 %ind
+ %loadC = load i32, ptr %arrayidxC, align 4
%sum_add = add nuw nsw i32 %sum, %loadC
@@ -68,6 +68,6 @@ for.body: ; preds = %for.body, %entry
br i1 %exitcond, label %for.end, label %for.body
for.end: ; preds = %for.body
- store i32 %sum_add, i32* @SUM, align 4
+ store i32 %sum_add, ptr @SUM, align 4
ret void
}
More information about the llvm-commits
mailing list