[llvm] 92af118 - [ConstantHoisting] Convert tests to opaque pointers (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 21 02:22:14 PDT 2023


Author: Nikita Popov
Date: 2023-06-21T11:22:04+02:00
New Revision: 92af1183c3f1a7621bceab29461cbc80c5ca3e26

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

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

Added: 
    

Modified: 
    llvm/test/Transforms/ConstantHoisting/AArch64/const-hoist-gep.ll
    llvm/test/Transforms/ConstantHoisting/ARM/const-hoist-gep-overindexing.ll
    llvm/test/Transforms/ConstantHoisting/ARM/const-hoist-gep.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/ConstantHoisting/AArch64/const-hoist-gep.ll b/llvm/test/Transforms/ConstantHoisting/AArch64/const-hoist-gep.ll
index 72f1b56e2e333..e53d2b3833d00 100644
--- a/llvm/test/Transforms/ConstantHoisting/AArch64/const-hoist-gep.ll
+++ b/llvm/test/Transforms/ConstantHoisting/AArch64/const-hoist-gep.ll
@@ -1,5 +1,5 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
-; RUN: opt -opaque-pointers=0 -passes=consthoist -consthoist-gep -S -o - %s | FileCheck %s
+; RUN: opt -passes=consthoist -consthoist-gep -S -o - %s | FileCheck %s
 
 target triple = "aarch64-none--musleabi"
 
@@ -19,27 +19,27 @@ target triple = "aarch64-none--musleabi"
 define dso_local void @zot() {
 ; CHECK-LABEL: define dso_local void @zot() {
 ; CHECK-NEXT:  bb:
-; CHECK-NEXT:    [[CONST:%.*]] = bitcast i32* getelementptr inbounds ([[TMP0:%.*]], %0* @global, i32 0, i32 4, i32 0, i32 0) to i32*
-; CHECK-NEXT:    store i32 undef, i32* [[CONST]], align 4
-; CHECK-NEXT:    [[BASE_BITCAST:%.*]] = bitcast i32* [[CONST]] to i8*
-; CHECK-NEXT:    [[MAT_GEP:%.*]] = getelementptr i8, i8* [[BASE_BITCAST]], i32 4
-; CHECK-NEXT:    [[MAT_BITCAST:%.*]] = bitcast i8* [[MAT_GEP]] to i32*
-; CHECK-NEXT:    store i32 undef, i32* [[MAT_BITCAST]], align 4
-; CHECK-NEXT:    [[BASE_BITCAST1:%.*]] = bitcast i32* [[CONST]] to i8*
-; CHECK-NEXT:    [[MAT_GEP2:%.*]] = getelementptr i8, i8* [[BASE_BITCAST1]], i32 160
-; CHECK-NEXT:    [[MAT_BITCAST3:%.*]] = bitcast i8* [[MAT_GEP2]] to i32*
-; CHECK-NEXT:    store i32 undef, i32* [[MAT_BITCAST3]], align 4
-; CHECK-NEXT:    [[BASE_BITCAST4:%.*]] = bitcast i32* [[CONST]] to i8*
-; CHECK-NEXT:    [[MAT_GEP5:%.*]] = getelementptr i8, i8* [[BASE_BITCAST4]], i32 164
-; CHECK-NEXT:    [[MAT_BITCAST6:%.*]] = bitcast i8* [[MAT_GEP5]] to i32*
-; CHECK-NEXT:    store i32 undef, i32* [[MAT_BITCAST6]], align 4
+; CHECK-NEXT:    [[CONST:%.*]] = bitcast ptr getelementptr inbounds ([[TMP0:%.*]], ptr @global, i32 0, i32 4, i32 0, i32 0) to ptr
+; CHECK-NEXT:    store i32 undef, ptr [[CONST]], align 4
+; CHECK-NEXT:    [[BASE_BITCAST:%.*]] = bitcast ptr [[CONST]] to ptr
+; CHECK-NEXT:    [[MAT_GEP:%.*]] = getelementptr i8, ptr [[BASE_BITCAST]], i32 4
+; CHECK-NEXT:    [[MAT_BITCAST:%.*]] = bitcast ptr [[MAT_GEP]] to ptr
+; CHECK-NEXT:    store i32 undef, ptr [[MAT_BITCAST]], align 4
+; CHECK-NEXT:    [[BASE_BITCAST1:%.*]] = bitcast ptr [[CONST]] to ptr
+; CHECK-NEXT:    [[MAT_GEP2:%.*]] = getelementptr i8, ptr [[BASE_BITCAST1]], i32 160
+; CHECK-NEXT:    [[MAT_BITCAST3:%.*]] = bitcast ptr [[MAT_GEP2]] to ptr
+; CHECK-NEXT:    store i32 undef, ptr [[MAT_BITCAST3]], align 4
+; CHECK-NEXT:    [[BASE_BITCAST4:%.*]] = bitcast ptr [[CONST]] to ptr
+; CHECK-NEXT:    [[MAT_GEP5:%.*]] = getelementptr i8, ptr [[BASE_BITCAST4]], i32 164
+; CHECK-NEXT:    [[MAT_BITCAST6:%.*]] = bitcast ptr [[MAT_GEP5]] to ptr
+; CHECK-NEXT:    store i32 undef, ptr [[MAT_BITCAST6]], align 4
 ; CHECK-NEXT:    ret void
 ;
 bb:
-  store i32 undef, i32* getelementptr inbounds (%0, %0* @global, i32 0, i32 4, i32 0, i32 0), align 4
-  store i32 undef, i32* getelementptr inbounds (%0, %0* @global, i32 0, i32 4, i32 0, i32 1), align 4
-  store i32 undef, i32* getelementptr inbounds (%0, %0* @global, i32 0, i32 4, i32 11, i32 0), align 4
-  store i32 undef, i32* getelementptr inbounds (%0, %0* @global, i32 0, i32 4, i32 11, i32 1), align 4
+  store i32 undef, ptr getelementptr inbounds (%0, ptr @global, i32 0, i32 4, i32 0, i32 0), align 4
+  store i32 undef, ptr getelementptr inbounds (%0, ptr @global, i32 0, i32 4, i32 0, i32 1), align 4
+  store i32 undef, ptr getelementptr inbounds (%0, ptr @global, i32 0, i32 4, i32 11, i32 0), align 4
+  store i32 undef, ptr getelementptr inbounds (%0, ptr @global, i32 0, i32 4, i32 11, i32 1), align 4
   ret void
 }
 

diff  --git a/llvm/test/Transforms/ConstantHoisting/ARM/const-hoist-gep-overindexing.ll b/llvm/test/Transforms/ConstantHoisting/ARM/const-hoist-gep-overindexing.ll
index d7652cce5330b..98083534fa89b 100644
--- a/llvm/test/Transforms/ConstantHoisting/ARM/const-hoist-gep-overindexing.ll
+++ b/llvm/test/Transforms/ConstantHoisting/ARM/const-hoist-gep-overindexing.ll
@@ -1,5 +1,5 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt -opaque-pointers=0 -passes=consthoist -consthoist-gep -S -o - %s | FileCheck %s
+; RUN: opt -passes=consthoist -consthoist-gep -S -o - %s | FileCheck %s
 
 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
 target triple = "thumbv6m-none--musleabi"
@@ -11,35 +11,35 @@ target triple = "thumbv6m-none--musleabi"
 define void @test_inbounds() {
 ; CHECK-LABEL: @test_inbounds(
 ; CHECK-NEXT:  bb:
-; CHECK-NEXT:    [[CONST:%.*]] = bitcast i16* getelementptr inbounds ([[TMP0:%.*]], %0* @global, i32 0, i32 1, i32 0) to i16*
-; CHECK-NEXT:    store i16 undef, i16* [[CONST]], align 2
-; CHECK-NEXT:    [[BASE_BITCAST:%.*]] = bitcast i16* [[CONST]] to i8*
-; CHECK-NEXT:    [[MAT_GEP:%.*]] = getelementptr i8, i8* [[BASE_BITCAST]], i32 2
-; CHECK-NEXT:    [[MAT_BITCAST:%.*]] = bitcast i8* [[MAT_GEP]] to i16*
-; CHECK-NEXT:    store i16 undef, i16* [[MAT_BITCAST]], align 2
-; CHECK-NEXT:    [[BASE_BITCAST1:%.*]] = bitcast i16* [[CONST]] to i8*
-; CHECK-NEXT:    [[MAT_GEP2:%.*]] = getelementptr i8, i8* [[BASE_BITCAST1]], i32 20
-; CHECK-NEXT:    [[MAT_BITCAST3:%.*]] = bitcast i8* [[MAT_GEP2]] to i16*
-; CHECK-NEXT:    store i16 undef, i16* [[MAT_BITCAST3]], align 2
+; CHECK-NEXT:    [[CONST:%.*]] = bitcast ptr getelementptr inbounds ([[TMP0:%.*]], ptr @global, i32 0, i32 1, i32 0) to ptr
+; CHECK-NEXT:    store i16 undef, ptr [[CONST]], align 2
+; CHECK-NEXT:    [[BASE_BITCAST:%.*]] = bitcast ptr [[CONST]] to ptr
+; CHECK-NEXT:    [[MAT_GEP:%.*]] = getelementptr i8, ptr [[BASE_BITCAST]], i32 2
+; CHECK-NEXT:    [[MAT_BITCAST:%.*]] = bitcast ptr [[MAT_GEP]] to ptr
+; CHECK-NEXT:    store i16 undef, ptr [[MAT_BITCAST]], align 2
+; CHECK-NEXT:    [[BASE_BITCAST1:%.*]] = bitcast ptr [[CONST]] to ptr
+; CHECK-NEXT:    [[MAT_GEP2:%.*]] = getelementptr i8, ptr [[BASE_BITCAST1]], i32 20
+; CHECK-NEXT:    [[MAT_BITCAST3:%.*]] = bitcast ptr [[MAT_GEP2]] to ptr
+; CHECK-NEXT:    store i16 undef, ptr [[MAT_BITCAST3]], align 2
 ; CHECK-NEXT:    ret void
 ;
 bb:
-  store i16 undef, i16* getelementptr inbounds (%0, %0* @global, i32 0, i32 1, i32 0)
-  store i16 undef, i16* getelementptr inbounds (%0, %0* @global, i32 0, i32 1, i32 1)
-  store i16 undef, i16* getelementptr inbounds (%0, %0* @global, i32 0, i32 1, i32 10)
+  store i16 undef, ptr getelementptr inbounds (%0, ptr @global, i32 0, i32 1, i32 0)
+  store i16 undef, ptr getelementptr inbounds (%0, ptr @global, i32 0, i32 1, i32 1)
+  store i16 undef, ptr getelementptr inbounds (%0, ptr @global, i32 0, i32 1, i32 10)
   ret void
 }
 
 define dso_local void @test_non_inbounds() {
 ; CHECK-LABEL: @test_non_inbounds(
 ; CHECK-NEXT:  bb:
-; CHECK-NEXT:    store i16 undef, i16* getelementptr inbounds ([[TMP0:%.*]], %0* @global, i32 0, i32 1, i32 11), align 2
-; CHECK-NEXT:    store i16 undef, i16* getelementptr ([[TMP0]], %0* @global, i32 0, i32 1, i32 12), align 2
+; CHECK-NEXT:    store i16 undef, ptr getelementptr inbounds ([[TMP0:%.*]], ptr @global, i32 0, i32 1, i32 11), align 2
+; CHECK-NEXT:    store i16 undef, ptr getelementptr ([[TMP0]], ptr @global, i32 0, i32 1, i32 12), align 2
 ; CHECK-NEXT:    ret void
 ;
 bb:
-  store i16 undef, i16* getelementptr inbounds (%0, %0* @global, i32 0, i32 1, i32 11)
-  store i16 undef, i16* getelementptr (%0, %0* @global, i32 0, i32 1, i32 12)
+  store i16 undef, ptr getelementptr inbounds (%0, ptr @global, i32 0, i32 1, i32 11)
+  store i16 undef, ptr getelementptr (%0, ptr @global, i32 0, i32 1, i32 12)
   ret void
 }
 

diff  --git a/llvm/test/Transforms/ConstantHoisting/ARM/const-hoist-gep.ll b/llvm/test/Transforms/ConstantHoisting/ARM/const-hoist-gep.ll
index 502b0b8b67ea1..c7c709b80288f 100644
--- a/llvm/test/Transforms/ConstantHoisting/ARM/const-hoist-gep.ll
+++ b/llvm/test/Transforms/ConstantHoisting/ARM/const-hoist-gep.ll
@@ -1,5 +1,5 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
-; RUN: opt -opaque-pointers=0 -passes=consthoist -consthoist-gep -S -o - %s | FileCheck %s
+; RUN: opt -passes=consthoist -consthoist-gep -S -o - %s | FileCheck %s
 
 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
 target triple = "thumbv6m-none--musleabi"
@@ -20,25 +20,25 @@ target triple = "thumbv6m-none--musleabi"
 define dso_local void @zot() {
 ; CHECK-LABEL: define dso_local void @zot() {
 ; CHECK-NEXT:  bb:
-; CHECK-NEXT:    [[CONST1:%.*]] = bitcast i32* getelementptr inbounds ([[TMP0:%.*]], %0* @global, i32 0, i32 4, i32 11, i32 0) to i32*
-; CHECK-NEXT:    [[CONST:%.*]] = bitcast i32* getelementptr inbounds ([[TMP0]], %0* @global, i32 0, i32 4, i32 0, i32 0) to i32*
-; CHECK-NEXT:    store i32 undef, i32* [[CONST]], align 4
-; CHECK-NEXT:    [[BASE_BITCAST:%.*]] = bitcast i32* [[CONST]] to i8*
-; CHECK-NEXT:    [[MAT_GEP:%.*]] = getelementptr i8, i8* [[BASE_BITCAST]], i32 4
-; CHECK-NEXT:    [[MAT_BITCAST:%.*]] = bitcast i8* [[MAT_GEP]] to i32*
-; CHECK-NEXT:    store i32 undef, i32* [[MAT_BITCAST]], align 4
-; CHECK-NEXT:    store i32 undef, i32* [[CONST1]], align 4
-; CHECK-NEXT:    [[BASE_BITCAST2:%.*]] = bitcast i32* [[CONST1]] to i8*
-; CHECK-NEXT:    [[MAT_GEP3:%.*]] = getelementptr i8, i8* [[BASE_BITCAST2]], i32 4
-; CHECK-NEXT:    [[MAT_BITCAST4:%.*]] = bitcast i8* [[MAT_GEP3]] to i32*
-; CHECK-NEXT:    store i32 undef, i32* [[MAT_BITCAST4]], align 4
+; CHECK-NEXT:    [[CONST1:%.*]] = bitcast ptr getelementptr inbounds ([[TMP0:%.*]], ptr @global, i32 0, i32 4, i32 11, i32 0) to ptr
+; CHECK-NEXT:    [[CONST:%.*]] = bitcast ptr getelementptr inbounds ([[TMP0]], ptr @global, i32 0, i32 4, i32 0, i32 0) to ptr
+; CHECK-NEXT:    store i32 undef, ptr [[CONST]], align 4
+; CHECK-NEXT:    [[BASE_BITCAST:%.*]] = bitcast ptr [[CONST]] to ptr
+; CHECK-NEXT:    [[MAT_GEP:%.*]] = getelementptr i8, ptr [[BASE_BITCAST]], i32 4
+; CHECK-NEXT:    [[MAT_BITCAST:%.*]] = bitcast ptr [[MAT_GEP]] to ptr
+; CHECK-NEXT:    store i32 undef, ptr [[MAT_BITCAST]], align 4
+; CHECK-NEXT:    store i32 undef, ptr [[CONST1]], align 4
+; CHECK-NEXT:    [[BASE_BITCAST2:%.*]] = bitcast ptr [[CONST1]] to ptr
+; CHECK-NEXT:    [[MAT_GEP3:%.*]] = getelementptr i8, ptr [[BASE_BITCAST2]], i32 4
+; CHECK-NEXT:    [[MAT_BITCAST4:%.*]] = bitcast ptr [[MAT_GEP3]] to ptr
+; CHECK-NEXT:    store i32 undef, ptr [[MAT_BITCAST4]], align 4
 ; CHECK-NEXT:    ret void
 ;
 bb:
-  store i32 undef, i32* getelementptr inbounds (%0, %0* @global, i32 0, i32 4, i32 0, i32 0), align 4
-  store i32 undef, i32* getelementptr inbounds (%0, %0* @global, i32 0, i32 4, i32 0, i32 1), align 4
-  store i32 undef, i32* getelementptr inbounds (%0, %0* @global, i32 0, i32 4, i32 11, i32 0), align 4
-  store i32 undef, i32* getelementptr inbounds (%0, %0* @global, i32 0, i32 4, i32 11, i32 1), align 4
+  store i32 undef, ptr getelementptr inbounds (%0, ptr @global, i32 0, i32 4, i32 0, i32 0), align 4
+  store i32 undef, ptr getelementptr inbounds (%0, ptr @global, i32 0, i32 4, i32 0, i32 1), align 4
+  store i32 undef, ptr getelementptr inbounds (%0, ptr @global, i32 0, i32 4, i32 11, i32 0), align 4
+  store i32 undef, ptr getelementptr inbounds (%0, ptr @global, i32 0, i32 4, i32 11, i32 1), align 4
   ret void
 }
 


        


More information about the llvm-commits mailing list