[llvm] e45523c - [X86] Convert test to opaque pointers (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 4 04:03:48 PDT 2023


Author: Nikita Popov
Date: 2023-04-04T13:03:29+02:00
New Revision: e45523cd218f3360a14757c33fb9466bdb492380

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

LOG: [X86] Convert test to opaque pointers (NFC)

Added: 
    

Modified: 
    llvm/test/CodeGen/X86/StackColoring-use-between-allocas.mir

Removed: 
    


################################################################################
diff  --git a/llvm/test/CodeGen/X86/StackColoring-use-between-allocas.mir b/llvm/test/CodeGen/X86/StackColoring-use-between-allocas.mir
index 2f4b267cf283..b820541da2be 100644
--- a/llvm/test/CodeGen/X86/StackColoring-use-between-allocas.mir
+++ b/llvm/test/CodeGen/X86/StackColoring-use-between-allocas.mir
@@ -1,14 +1,12 @@
 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
-# RUN: llc -opaque-pointers=0 -run-pass=stack-coloring %s -o - | FileCheck %s
+# RUN: llc -run-pass=stack-coloring %s -o - | FileCheck %s
 
 ## %tmpcast is between 2 allocas. %ref.tmp will replaced by %tmp. Make sure
 ## that we reorder %tmp to be before the use in %tmpcast.
 
 # CHECK: %a = alloca %struct.e, align 1
 # CHECK: %tmp = alloca %"struct.e::f", align 8
-# CHECK: %0 = bitcast %"struct.e::f"* %tmp to { <2 x float>, <2 x float> }*
 # CHECK: %ref.tmp = alloca { <2 x float>, <2 x float> }, align 8
-# CHECK: %tmpcast = bitcast { <2 x float>, <2 x float> }* %0 to %class.d*
 # CHECK: %b = alloca %struct.j, align 4
 
 --- |
@@ -19,7 +17,7 @@
   %class.d = type { [4 x float] }
   %struct.e = type { i8 }
   %struct.j = type { i32 }
-  %"struct.e::f" = type { [4 x i32*] }
+  %"struct.e::f" = type { [4 x ptr] }
 
   @i = local_unnamed_addr global %class.d zeroinitializer, align 8
 
@@ -28,49 +26,43 @@
   entry:
     %a = alloca %struct.e, align 1
     %ref.tmp = alloca { <2 x float>, <2 x float> }, align 8
-    %tmpcast = bitcast { <2 x float>, <2 x float> }* %ref.tmp to %class.d*
     %b = alloca %struct.j, align 4
     %tmp = alloca %"struct.e::f", align 8
-    %0 = bitcast %struct.e* %a to i8*
-    call void @llvm.lifetime.start.p0i8(i64 1, i8* nonnull %0) #3
-    %1 = bitcast { <2 x float>, <2 x float> }* %ref.tmp to i8*
-    call void @llvm.lifetime.start.p0i8(i64 16, i8* nonnull %1) #3
-    %agg.tmp.sroa.0.0.copyload = load <2 x float>, <2 x float>* bitcast (%class.d* @i to <2 x float>*), align 8, !tbaa.struct !3
-    %agg.tmp.sroa.2.0.copyload = load <2 x float>, <2 x float>* bitcast (float* getelementptr inbounds (%class.d, %class.d* @i, i64 0, i32 0, i64 2) to <2 x float>*), align 8, !tbaa.struct !3
+    call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %a) #3
+    call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %ref.tmp) #3
+    %agg.tmp.sroa.0.0.copyload = load <2 x float>, ptr @i, align 8, !tbaa.struct !3
+    %agg.tmp.sroa.2.0.copyload = load <2 x float>, ptr getelementptr inbounds (%class.d, ptr @i, i64 0, i32 0, i64 2), align 8, !tbaa.struct !3
     %call = tail call { <2 x float>, <2 x float> } @_Zng1d(<2 x float> %agg.tmp.sroa.0.0.copyload, <2 x float> %agg.tmp.sroa.2.0.copyload)
-    %2 = bitcast { <2 x float>, <2 x float> }* %ref.tmp to <2 x float>*
-    %3 = extractvalue { <2 x float>, <2 x float> } %call, 0
-    store <2 x float> %3, <2 x float>* %2, align 8
-    %4 = getelementptr inbounds { <2 x float>, <2 x float> }, { <2 x float>, <2 x float> }* %ref.tmp, i64 0, i32 1
-    %5 = extractvalue { <2 x float>, <2 x float> } %call, 1
-    store <2 x float> %5, <2 x float>* %4, align 8
-    call void @_ZN1e1hERK1d(%struct.e* nonnull %a, %class.d* nonnull dereferenceable(16) %tmpcast)
-    call void @llvm.lifetime.end.p0i8(i64 16, i8* nonnull %1) #3
-    %6 = bitcast %struct.j* %b to i8*
-    call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %6) #3
-    %7 = bitcast %"struct.e::f"* %tmp to i8*
-    call void @llvm.lifetime.start.p0i8(i64 32, i8* nonnull %7) #3
-    call void @_ZN1j1kEv(%"struct.e::f"* nonnull sret(%"struct.e::f") align 8 %tmp, %struct.j* nonnull %b)
-    call void @llvm.lifetime.end.p0i8(i64 32, i8* nonnull %7) #3
-    call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %6) #3
-    call void @llvm.lifetime.end.p0i8(i64 1, i8* nonnull %0) #3
+    %0 = extractvalue { <2 x float>, <2 x float> } %call, 0
+    store <2 x float> %0, ptr %ref.tmp, align 8
+    %1 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %ref.tmp, i64 0, i32 1
+    %2 = extractvalue { <2 x float>, <2 x float> } %call, 1
+    store <2 x float> %2, ptr %1, align 8
+    call void @_ZN1e1hERK1d(ptr nonnull %a, ptr nonnull dereferenceable(16) %ref.tmp)
+    call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %ref.tmp) #3
+    call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
+    call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %tmp) #3
+    call void @_ZN1j1kEv(ptr nonnull sret(%"struct.e::f") align 8 %tmp, ptr nonnull %b)
+    call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %tmp) #3
+    call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
+    call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %a) #3
     ret void
   }
 
   ; Function Attrs: argmemonly nounwind willreturn
-  declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #1
+  declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
 
-  declare void @_ZN1e1hERK1d(%struct.e*, %class.d* dereferenceable(16)) local_unnamed_addr #2
+  declare void @_ZN1e1hERK1d(ptr, ptr dereferenceable(16)) local_unnamed_addr #2
 
   declare { <2 x float>, <2 x float> } @_Zng1d(<2 x float>, <2 x float>) local_unnamed_addr #2
 
   ; Function Attrs: argmemonly nounwind willreturn
-  declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #1
+  declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
 
-  declare void @_ZN1j1kEv(%"struct.e::f"* sret(%"struct.e::f") align 8, %struct.j*) local_unnamed_addr #2
+  declare void @_ZN1j1kEv(ptr sret(%"struct.e::f") align 8, ptr) local_unnamed_addr #2
 
   ; Function Attrs: nounwind
-  declare void @llvm.stackprotector(i8*, i8**) #3
+  declare void @llvm.stackprotector(ptr, ptr) #3
 
   attributes #0 = { ssp uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="64" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="penryn" "target-features"="+cx16,+cx8,+fxsr,+mmx,+sahf,+sse,+sse2,+sse3,+sse4.1,+ssse3,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
   attributes #1 = { argmemonly nounwind willreturn }
@@ -148,8 +140,8 @@ machineFunctionInfo: {}
 body:             |
   bb.0.entry:
     ; CHECK-LABEL: name: _Z1gv
-    ; CHECK: [[MOVSDrm:%[0-9]+]]:vr128 = MOVSDrm $rip, 1, $noreg, @i, $noreg :: (dereferenceable load (s64) from `<2 x float>* bitcast (%class.d* @i to <2 x float>*)`)
-    ; CHECK-NEXT: [[MOVSDrm1:%[0-9]+]]:vr128 = MOVSDrm $rip, 1, $noreg, @i + 8, $noreg :: (dereferenceable load (s64) from `<2 x float>* bitcast (float* getelementptr inbounds (%class.d, %class.d* @i, i64 0, i32 0, i64 2) to <2 x float>*)`)
+    ; CHECK: [[MOVSDrm:%[0-9]+]]:vr128 = MOVSDrm $rip, 1, $noreg, @i, $noreg :: (dereferenceable load (s64) from @i)
+    ; CHECK-NEXT: [[MOVSDrm1:%[0-9]+]]:vr128 = MOVSDrm $rip, 1, $noreg, @i + 8, $noreg :: (dereferenceable load (s64) from `ptr getelementptr inbounds (%class.d, ptr @i, i64 0, i32 0, i64 2)`)
     ; CHECK-NEXT: ADJCALLSTACKDOWN64 0, 0, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp
     ; CHECK-NEXT: $xmm0 = COPY [[MOVSDrm]]
     ; CHECK-NEXT: $xmm1 = COPY [[MOVSDrm1]]
@@ -157,8 +149,8 @@ body:             |
     ; CHECK-NEXT: ADJCALLSTACKUP64 0, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp
     ; CHECK-NEXT: [[COPY:%[0-9]+]]:vr128 = COPY $xmm0
     ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vr128 = COPY $xmm1
-    ; CHECK-NEXT: MOVLPDmr %stack.3.tmp, 1, $noreg, 0, $noreg, [[COPY]] :: (store (s64) into %ir.3)
-    ; CHECK-NEXT: MOVLPDmr %stack.3.tmp, 1, $noreg, 8, $noreg, [[COPY1]] :: (store (s64) into %ir.5)
+    ; CHECK-NEXT: MOVLPDmr %stack.3.tmp, 1, $noreg, 0, $noreg, [[COPY]] :: (store (s64) into %ir.tmp)
+    ; CHECK-NEXT: MOVLPDmr %stack.3.tmp, 1, $noreg, 8, $noreg, [[COPY1]] :: (store (s64) into %ir.1)
     ; CHECK-NEXT: ADJCALLSTACKDOWN64 0, 0, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp
     ; CHECK-NEXT: [[LEA64r:%[0-9]+]]:gr64 = LEA64r %stack.0.a, 1, $noreg, 0, $noreg
     ; CHECK-NEXT: [[LEA64r1:%[0-9]+]]:gr64 = LEA64r %stack.3.tmp, 1, $noreg, 0, $noreg
@@ -176,8 +168,8 @@ body:             |
     ; CHECK-NEXT: RET 0
     LIFETIME_START %stack.0.a
     LIFETIME_START %stack.1.ref.tmp
-    %0:vr128 = MOVSDrm $rip, 1, $noreg, @i, $noreg :: (dereferenceable load (s64) from `<2 x float>* bitcast (%class.d* @i to <2 x float>*)`)
-    %1:vr128 = MOVSDrm $rip, 1, $noreg, @i + 8, $noreg :: (dereferenceable load (s64) from `<2 x float>* bitcast (float* getelementptr inbounds (%class.d, %class.d* @i, i64 0, i32 0, i64 2) to <2 x float>*)`)
+    %0:vr128 = MOVSDrm $rip, 1, $noreg, @i, $noreg :: (dereferenceable load (s64) from @i)
+    %1:vr128 = MOVSDrm $rip, 1, $noreg, @i + 8, $noreg :: (dereferenceable load (s64) from `ptr getelementptr inbounds (%class.d, ptr @i, i64 0, i32 0, i64 2)`)
     ADJCALLSTACKDOWN64 0, 0, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp
     $xmm0 = COPY %0
     $xmm1 = COPY %1
@@ -185,8 +177,8 @@ body:             |
     ADJCALLSTACKUP64 0, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp
     %2:vr128 = COPY $xmm0
     %3:vr128 = COPY $xmm1
-    MOVLPDmr %stack.1.ref.tmp, 1, $noreg, 0, $noreg, %2 :: (store (s64) into %ir.2)
-    MOVLPDmr %stack.1.ref.tmp, 1, $noreg, 8, $noreg, %3 :: (store (s64) into %ir.4)
+    MOVLPDmr %stack.1.ref.tmp, 1, $noreg, 0, $noreg, %2 :: (store (s64) into %ir.ref.tmp)
+    MOVLPDmr %stack.1.ref.tmp, 1, $noreg, 8, $noreg, %3 :: (store (s64) into %ir.1)
     ADJCALLSTACKDOWN64 0, 0, 0, implicit-def dead $rsp, implicit-def dead $eflags, implicit-def dead $ssp, implicit $rsp, implicit $ssp
     %4:gr64 = LEA64r %stack.0.a, 1, $noreg, 0, $noreg
     %5:gr64 = LEA64r %stack.1.ref.tmp, 1, $noreg, 0, $noreg


        


More information about the llvm-commits mailing list