[llvm] cdfb99b - [AggressiveInstCombine] Convert tests to opaque pointers (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 23 00:48:18 PST 2022


Author: Nikita Popov
Date: 2022-12-23T09:47:48+01:00
New Revision: cdfb99b0699595008c971649b50d008ca3fdad6f

URL: https://github.com/llvm/llvm-project/commit/cdfb99b0699595008c971649b50d008ca3fdad6f
DIFF: https://github.com/llvm/llvm-project/commit/cdfb99b0699595008c971649b50d008ca3fdad6f.diff

LOG: [AggressiveInstCombine] Convert tests to opaque pointers (NFC)

Added: 
    

Modified: 
    llvm/test/Transforms/AggressiveInstCombine/lower-table-based-cttz-basics.ll
    llvm/test/Transforms/AggressiveInstCombine/lower-table-based-cttz-dereferencing-pointer.ll
    llvm/test/Transforms/AggressiveInstCombine/lower-table-based-cttz-non-argument-value.ll
    llvm/test/Transforms/AggressiveInstCombine/lower-table-based-cttz-zero-element.ll
    llvm/test/Transforms/AggressiveInstCombine/negative-lower-table-based-cttz.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/AggressiveInstCombine/lower-table-based-cttz-basics.ll b/llvm/test/Transforms/AggressiveInstCombine/lower-table-based-cttz-basics.ll
index 128e23b3d0e8b..147fc64f9c92a 100644
--- a/llvm/test/Transforms/AggressiveInstCombine/lower-table-based-cttz-basics.ll
+++ b/llvm/test/Transforms/AggressiveInstCombine/lower-table-based-cttz-basics.ll
@@ -107,8 +107,8 @@ entry:
   %mul = mul i32 %and, 125613361
   %shr = lshr i32 %mul, 27
   %idxprom = zext i32 %shr to i64
-  %arrayidx = getelementptr inbounds [32 x i8], [32 x i8]* @ctz7.table, i64 0, i64 %idxprom
-  %0 = load i8, i8* %arrayidx, align 1
+  %arrayidx = getelementptr inbounds [32 x i8], ptr @ctz7.table, i64 0, i64 %idxprom
+  %0 = load i8, ptr %arrayidx, align 1
   %conv = zext i8 %0 to i32
   ret i32 %conv
 }
@@ -129,8 +129,8 @@ entry:
   %mul = mul i32 %and, 72416175
   %shr = lshr i32 %mul, 26
   %idxprom = zext i32 %shr to i64
-  %arrayidx = getelementptr inbounds [64 x i16], [64 x i16]* @ctz2.table, i64 0, i64 %idxprom
-  %0 = load i16, i16* %arrayidx, align 2
+  %arrayidx = getelementptr inbounds [64 x i16], ptr @ctz2.table, i64 0, i64 %idxprom
+  %0 = load i16, ptr %arrayidx, align 2
   %conv = sext i16 %0 to i32
   ret i32 %conv
 }
@@ -160,8 +160,8 @@ if.end:                                           ; preds = %entry
   %mul = mul i32 %and, 81224991
   %shr = lshr i32 %mul, 27
   %idxprom = zext i32 %shr to i64
-  %arrayidx = getelementptr inbounds [32 x i32], [32 x i32]* @ctz3.table, i64 0, i64 %idxprom
-  %0 = load i32, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds [32 x i32], ptr @ctz3.table, i64 0, i64 %idxprom
+  %0 = load i32, ptr %arrayidx, align 4
   br label %return
 
 return:                                           ; preds = %entry, %if.end
@@ -185,8 +185,8 @@ entry:
   %and = and i64 %sub, %b
   %mul = mul i64 %and, 283881067100198605
   %shr = lshr i64 %mul, 58
-  %arrayidx = getelementptr inbounds [64 x i32], [64 x i32]* @table, i64 0, i64 %shr
-  %0 = load i32, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds [64 x i32], ptr @table, i64 0, i64 %shr
+  %0 = load i32, ptr %arrayidx, align 4
   ret i32 %0
 }
 
@@ -208,8 +208,8 @@ entry:
   %mul = mul i32 %and, 81224991
   %shr = lshr i32 %mul, 27
   %idxprom = zext i32 %shr to i64
-  %arrayidx = getelementptr inbounds [32 x i8], [32 x i8]* @ctz5.table, i64 0, i64 %idxprom
-  %0 = load i8, i8* %arrayidx, align 1
+  %arrayidx = getelementptr inbounds [32 x i8], ptr @ctz5.table, i64 0, i64 %idxprom
+  %0 = load i8, ptr %arrayidx, align 1
   %conv = zext i8 %0 to i32
   ret i32 %conv
 }
@@ -230,8 +230,8 @@ entry:
   %and = and i64 %add, %n
   %mul = mul i64 %and, 571347909858961602
   %shr = lshr i64 %mul, 58
-  %arrayidx = getelementptr inbounds [64 x i32], [64 x i32]* @ctz6.table, i64 0, i64 %shr
-  %0 = load i32, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds [64 x i32], ptr @ctz6.table, i64 0, i64 %shr
+  %0 = load i32, ptr %arrayidx, align 4
   ret i32 %0
 }
 
@@ -251,7 +251,7 @@ entry:
   %mul = mul i32 %and, 162449982
   %shr = lshr i32 %mul, 27
   %idxprom = zext i32 %shr to i64
-  %arrayidx = getelementptr inbounds [32 x i32], [32 x i32]* @ctz8.table, i64 0, i64 %idxprom
-  %0 = load i32, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds [32 x i32], ptr @ctz8.table, i64 0, i64 %idxprom
+  %0 = load i32, ptr %arrayidx, align 4
   ret i32 %0
 }

diff  --git a/llvm/test/Transforms/AggressiveInstCombine/lower-table-based-cttz-dereferencing-pointer.ll b/llvm/test/Transforms/AggressiveInstCombine/lower-table-based-cttz-dereferencing-pointer.ll
index 95ddc0cfd433e..d2ecb57d94f99 100644
--- a/llvm/test/Transforms/AggressiveInstCombine/lower-table-based-cttz-dereferencing-pointer.ll
+++ b/llvm/test/Transforms/AggressiveInstCombine/lower-table-based-cttz-dereferencing-pointer.ll
@@ -20,10 +20,10 @@
 
 @table = internal unnamed_addr constant [64 x i32] [i32 0, i32 1, i32 12, i32 2, i32 13, i32 22, i32 17, i32 3, i32 14, i32 33, i32 23, i32 36, i32 18, i32 58, i32 28, i32 4, i32 62, i32 15, i32 34, i32 26, i32 24, i32 48, i32 50, i32 37, i32 19, i32 55, i32 59, i32 52, i32 29, i32 44, i32 39, i32 5, i32 63, i32 11, i32 21, i32 16, i32 32, i32 35, i32 57, i32 27, i32 61, i32 25, i32 47, i32 49, i32 54, i32 51, i32 43, i32 38, i32 10, i32 20, i32 31, i32 56, i32 60, i32 46, i32 53, i32 42, i32 9, i32 30, i32 45, i32 41, i32 8, i32 40, i32 7, i32 6], align 4
 
-define i32 @ctz6(i64* nocapture readonly %b) {
+define i32 @ctz6(ptr nocapture readonly %b) {
 ; CHECK-LABEL: @ctz6(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[TMP0:%.*]] = load i64, i64* [[B:%.*]], align 8
+; CHECK-NEXT:    [[TMP0:%.*]] = load i64, ptr [[B:%.*]], align 8
 ; CHECK-NEXT:    [[TMP1:%.*]] = call i64 @llvm.cttz.i64(i64 [[TMP0]], i1 true)
 ; CHECK-NEXT:    [[TMP2:%.*]] = icmp eq i64 [[TMP0]], 0
 ; CHECK-NEXT:    [[TMP3:%.*]] = select i1 [[TMP2]], i64 0, i64 [[TMP1]]
@@ -31,12 +31,12 @@ define i32 @ctz6(i64* nocapture readonly %b) {
 ; CHECK-NEXT:    ret i32 [[TMP4]]
 ;
 entry:
-  %0 = load i64, i64* %b, align 8
+  %0 = load i64, ptr %b, align 8
   %sub = sub i64 0, %0
   %and = and i64 %0, %sub
   %mul = mul i64 %and, 283881067100198605
   %shr = lshr i64 %mul, 58
-  %arrayidx = getelementptr inbounds [64 x i32], [64 x i32]* @table, i64 0, i64 %shr
-  %1 = load i32, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds [64 x i32], ptr @table, i64 0, i64 %shr
+  %1 = load i32, ptr %arrayidx, align 4
   ret i32 %1
 }

diff  --git a/llvm/test/Transforms/AggressiveInstCombine/lower-table-based-cttz-non-argument-value.ll b/llvm/test/Transforms/AggressiveInstCombine/lower-table-based-cttz-non-argument-value.ll
index 631b9d7023556..f63badb9f0a91 100644
--- a/llvm/test/Transforms/AggressiveInstCombine/lower-table-based-cttz-non-argument-value.ll
+++ b/llvm/test/Transforms/AggressiveInstCombine/lower-table-based-cttz-non-argument-value.ll
@@ -23,7 +23,7 @@
 define i32 @test() {
 ; CHECK-LABEL: @test(
 ; CHECK-NEXT:  entry:
-; CHECK-NEXT:    [[TMP0:%.*]] = load i32, i32* @x, align 4
+; CHECK-NEXT:    [[TMP0:%.*]] = load i32, ptr @x, align 4
 ; CHECK-NEXT:    [[TMP1:%.*]] = call i32 @llvm.cttz.i32(i32 [[TMP0]], i1 true)
 ; CHECK-NEXT:    [[TMP2:%.*]] = icmp eq i32 [[TMP0]], 0
 ; CHECK-NEXT:    [[TMP3:%.*]] = select i1 [[TMP2]], i32 0, i32 [[TMP1]]
@@ -32,14 +32,14 @@ define i32 @test() {
 ; CHECK-NEXT:    ret i32 [[CONV]]
 ;
 entry:
-  %0 = load i32, i32* @x, align 4
+  %0 = load i32, ptr @x, align 4
   %sub = sub i32 0, %0
   %and = and i32 %0, %sub
   %mul = mul i32 %and, 125613361
   %shr = lshr i32 %mul, 27
   %idxprom = zext i32 %shr to i64
-  %arrayidx = getelementptr inbounds [32 x i8], [32 x i8]* @test.table, i64 0, i64 %idxprom
-  %1 = load i8, i8* %arrayidx, align 1
+  %arrayidx = getelementptr inbounds [32 x i8], ptr @test.table, i64 0, i64 %idxprom
+  %1 = load i8, ptr %arrayidx, align 1
   %conv = zext i8 %1 to i32
   ret i32 %conv
 }

diff  --git a/llvm/test/Transforms/AggressiveInstCombine/lower-table-based-cttz-zero-element.ll b/llvm/test/Transforms/AggressiveInstCombine/lower-table-based-cttz-zero-element.ll
index 1384019f4046d..bbdd9b7cef102 100644
--- a/llvm/test/Transforms/AggressiveInstCombine/lower-table-based-cttz-zero-element.ll
+++ b/llvm/test/Transforms/AggressiveInstCombine/lower-table-based-cttz-zero-element.ll
@@ -19,8 +19,8 @@ entry:
   %mul = mul i32 %and, 125613361
   %shr = lshr i32 %mul, 27
   %idxprom = zext i32 %shr to i64
-  %arrayidx = getelementptr inbounds [32 x i8], [32 x i8]* @ctz1.table, i64 0, i64 %idxprom
-  %0 = load i8, i8* %arrayidx, align 1
+  %arrayidx = getelementptr inbounds [32 x i8], ptr @ctz1.table, i64 0, i64 %idxprom
+  %0 = load i8, ptr %arrayidx, align 1
   %conv = zext i8 %0 to i32
   ret i32 %conv
 }

diff  --git a/llvm/test/Transforms/AggressiveInstCombine/negative-lower-table-based-cttz.ll b/llvm/test/Transforms/AggressiveInstCombine/negative-lower-table-based-cttz.ll
index d2d5e4ebe96b0..714acd7f16097 100644
--- a/llvm/test/Transforms/AggressiveInstCombine/negative-lower-table-based-cttz.ll
+++ b/llvm/test/Transforms/AggressiveInstCombine/negative-lower-table-based-cttz.ll
@@ -15,8 +15,8 @@ entry:
   %mul = mul i32 %and, 125613361
   %shr = lshr i32 %mul, 27
   %idxprom = zext i32 %shr to i64
-  %arrayidx = getelementptr inbounds [32 x i8], [32 x i8]* @ctz1.table, i64 0, i64 %idxprom
-  %0 = load i8, i8* %arrayidx, align 1
+  %arrayidx = getelementptr inbounds [32 x i8], ptr @ctz1.table, i64 0, i64 %idxprom
+  %0 = load i8, ptr %arrayidx, align 1
   %conv = zext i8 %0 to i32
   ret i32 %conv
 }
@@ -32,8 +32,8 @@ entry:
   %mul = mul i32 %and, 125613361
   %shr = lshr i32 %mul, 27
   %idxprom = zext i32 %shr to i64
-  %arrayidx = getelementptr inbounds [32 x i8], [32 x i8]* @ctz2.table, i64 0, i64 %idxprom
-  %0 = load i8, i8* %arrayidx, align 1
+  %arrayidx = getelementptr inbounds [32 x i8], ptr @ctz2.table, i64 0, i64 %idxprom
+  %0 = load i8, ptr %arrayidx, align 1
   %conv = zext i8 %0 to i32
   ret i32 %conv
 }
@@ -45,8 +45,8 @@ entry:
   %mul = mul i32 %and, 125613362
   %shr = lshr i32 %mul, 27
   %idxprom = zext i32 %shr to i64
-  %arrayidx = getelementptr inbounds [32 x i8], [32 x i8]* @ctz2.table, i64 0, i64 %idxprom
-  %0 = load i8, i8* %arrayidx, align 1
+  %arrayidx = getelementptr inbounds [32 x i8], ptr @ctz2.table, i64 0, i64 %idxprom
+  %0 = load i8, ptr %arrayidx, align 1
   %conv = zext i8 %0 to i32
   ret i32 %conv
 }
@@ -58,8 +58,8 @@ entry:
   %mul = mul i32 %and, 125613361
   %shr = lshr i32 %mul, 26
   %idxprom = zext i32 %shr to i64
-  %arrayidx = getelementptr inbounds [32 x i8], [32 x i8]* @ctz2.table, i64 0, i64 %idxprom
-  %0 = load i8, i8* %arrayidx, align 1
+  %arrayidx = getelementptr inbounds [32 x i8], ptr @ctz2.table, i64 0, i64 %idxprom
+  %0 = load i8, ptr %arrayidx, align 1
   %conv = zext i8 %0 to i32
   ret i32 %conv
 }
@@ -75,8 +75,8 @@ entry:
   %mul = mul i32 %and, 125613361
   %shr = lshr i32 %mul, 27
   %idxprom = zext i32 %shr to i64
-  %arrayidx = getelementptr inbounds [128 x i8], [128 x i8]* @ctz3.table, i64 0, i64 %idxprom
-  %0 = load i8, i8* %arrayidx, align 1
+  %arrayidx = getelementptr inbounds [128 x i8], ptr @ctz3.table, i64 0, i64 %idxprom
+  %0 = load i8, ptr %arrayidx, align 1
   %conv = zext i8 %0 to i32
   ret i32 %conv
 }
@@ -102,8 +102,8 @@ if.end:                                           ; preds = %entry
   %mul = mul i32 %and, 81224991
   %shr = lshr i32 %mul, 27
   %idxprom = zext i32 %shr to i64
-  %arrayidx = getelementptr inbounds [32 x i32], [32 x i32]* @table, i64 0, i64 %idxprom
-  %0 = load i32, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds [32 x i32], ptr @table, i64 0, i64 %idxprom
+  %0 = load i32, ptr %arrayidx, align 4
   br label %return
 
 return:                                           ; preds = %entry, %if.end
@@ -132,7 +132,7 @@ entry:
   %and = and i64 %add, %n
   %mul = mul i64 %and, 571347909858961602
   %shr = lshr i64 %mul, 58
-  %arrayidx = getelementptr inbounds [64 x i32], [64 x i32]* @ctz7.table, i64 0, i64 %shr
-  %0 = load i32, i32* %arrayidx, align 4
+  %arrayidx = getelementptr inbounds [64 x i32], ptr @ctz7.table, i64 0, i64 %shr
+  %0 = load i32, ptr %arrayidx, align 4
   ret i32 %0
 }


        


More information about the llvm-commits mailing list