[ConstantHoisting] Convert tests to opaque pointers (NFC)
authorNikita Popov <npopov@redhat.com>
Wed, 21 Jun 2023 09:20:15 +0000 (11:20 +0200)
committerNikita Popov <npopov@redhat.com>
Wed, 21 Jun 2023 09:22:04 +0000 (11:22 +0200)
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

index 72f1b56..e53d2b3 100644 (file)
@@ -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
 }
 
index d7652cc..9808353 100644 (file)
@@ -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
 }
 
index 502b0b8..c7c709b 100644 (file)
@@ -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
 }