1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=x86_64-- -run-pass machinelicm -mcpu=skx -verify-machineinstrs -o - %s | FileCheck %s
4 @x = dso_local global i32 0, align 4
5 @z = dso_local local_unnamed_addr global [1024 x i32] zeroinitializer, align 16
6 @y = dso_local local_unnamed_addr constant ptr null, align 8
8 ; Function Attrs: nofree norecurse nosync nounwind uwtable writeonly mustprogress
9 define dso_local void @_Z3foov() local_unnamed_addr #0 {
10 %1 = load ptr, ptr @y, align 8, !tbaa !3
11 %2 = icmp eq ptr %1, @x
12 %3 = zext i1 %2 to i32
17 %lsr.iv = phi i64 [ %lsr.iv.next, %5 ], [ -4096, %0 ]
18 %uglygep = getelementptr i8, ptr @z, i64 %lsr.iv
19 %scevgep = getelementptr i32, ptr %uglygep, i64 1024
20 store i32 %3, ptr %scevgep, align 4, !tbaa !7
21 %lsr.iv.next = add nsw i64 %lsr.iv, 4
22 %6 = icmp eq i64 %lsr.iv.next, 0
23 br i1 %6, label %4, label %5, !llvm.loop !9
26 attributes #0 = { nofree norecurse nosync nounwind uwtable writeonly mustprogress "frame-pointer"="none" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+x87,-aes,-avx,-avx2,-avx512bf16,-avx512bitalg,-avx512bw,-avx512cd,-avx512dq,-avx512er,-avx512f,-avx512ifma,-avx512pf,-avx512vbmi,-avx512vbmi2,-avx512vl,-avx512vnni,-avx512vp2intersect,-avx512vpopcntdq,-avxvnni,-f16c,-fma,-fma4,-gfni,-kl,-pclmul,-sha,-sse,-sse2,-sse3,-sse4.1,-sse4.2,-sse4a,-ssse3,-vaes,-vpclmulqdq,-widekl,-xop" "tune-cpu"="generic" }
28 !llvm.module.flags = !{!0, !1}
30 !0 = !{i32 1, !"wchar_size", i32 4}
31 !1 = !{i32 7, !"uwtable", i32 1}
32 !2 = !{!"clang version 13.0.0 (https://github.com/llvm/llvm-project.git c42dd5dbb015afaef99cf876195c474c63c2393e)"}
34 !4 = !{!"any pointer", !5, i64 0}
35 !5 = !{!"omnipotent char", !6, i64 0}
36 !6 = !{!"Simple C++ TBAA"}
38 !8 = !{!"int", !5, i64 0}
39 !9 = distinct !{!9, !10, !11}
40 !10 = !{!"llvm.loop.mustprogress"}
41 !11 = !{!"llvm.loop.unroll.disable"}
47 exposesReturnsTwice: false
49 regBankSelected: false
52 tracksRegLiveness: true
57 isFrameAddressTaken: false
58 isReturnAddressTaken: false
67 maxCallFrameSize: 4294967295
68 cvBytesOfCalleeSavedRegisters: 0
69 hasOpaqueSPAdjustment: false
71 hasMustTailInVarArgFunc: false
79 debugValueSubstitutions: []
81 machineFunctionInfo: {}
83 ; CHECK-LABEL: name: _Z3foov
84 ; CHECK: bb.0 (%ir-block.0):
85 ; CHECK-NEXT: successors: %bb.2(0x80000000)
87 ; CHECK-NEXT: renamable $eax = MOV32r0 implicit-def dead $eflags
88 ; CHECK-NEXT: renamable $rcx = MOV64ri32 -4096
89 ; CHECK-NEXT: [[MOV64ri32_:%[0-9]+]]:gr64 = MOV64ri32 -4096
90 ; CHECK-NEXT: [[MOV64rm:%[0-9]+]]:gr64 = MOV64rm $rip, 1, $noreg, @y, $noreg :: (dereferenceable invariant load (s64) from @y, !tbaa !3)
91 ; CHECK-NEXT: JMP_1 %bb.2
93 ; CHECK-NEXT: bb.1 (%ir-block.4):
96 ; CHECK-NEXT: bb.2 (%ir-block.5):
97 ; CHECK-NEXT: successors: %bb.1(0x04000000), %bb.2(0x7c000000)
98 ; CHECK-NEXT: liveins: $eax, $rcx
100 ; CHECK-NEXT: CMP64ri32 [[MOV64rm]], @x, implicit-def $eflags
101 ; CHECK-NEXT: renamable $al = SETCCr 4, implicit killed $eflags, implicit killed $eax, implicit-def $eax
102 ; CHECK-NEXT: MOV32mr renamable $rcx, 1, $noreg, @z + 4096, $noreg, renamable $eax :: (store (s32) into %ir.scevgep, !tbaa !7)
103 ; CHECK-NEXT: renamable $rcx = ADD64ri8 killed renamable $rcx, 4, implicit-def $eflags
104 ; CHECK-NEXT: JCC_1 %bb.1, 4, implicit killed $eflags
105 ; CHECK-NEXT: JMP_1 %bb.2
107 successors: %bb.2(0x80000000)
108 renamable $eax = MOV32r0 implicit-def dead $eflags
109 renamable $rcx = MOV64ri32 -4096
114 successors: %bb.1(0x04000000), %bb.2(0x7c000000)
116 %2:gr64 = MOV64ri32 -4096
117 CMP64mi32 $rip, 1, $noreg, @y, $noreg, @x, implicit-def $eflags :: (dereferenceable invariant load (s64) from @y, !tbaa !3)
118 renamable $al = SETCCr 4, implicit killed $eflags, implicit killed $eax, implicit-def $eax
119 MOV32mr renamable $rcx, 1, $noreg, @z + 4096, $noreg, renamable $eax :: (store (s32) into %ir.scevgep, !tbaa !7)
120 renamable $rcx = ADD64ri8 killed renamable $rcx, 4, implicit-def $eflags
121 JCC_1 %bb.1, 4, implicit killed $eflags