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 i32* 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 i32*, i32** @y, align 8, !tbaa !3
11 %2 = icmp eq i32* %1, @x
12 %3 = zext i1 %2 to i32
17 %lsr.iv = phi i64 [ %lsr.iv.next, %5 ], [ -4096, %0 ]
18 %uglygep = getelementptr i8, i8* bitcast ([1024 x i32]* @z to i8*), i64 %lsr.iv
19 %uglygep2 = bitcast i8* %uglygep to i32*
20 %scevgep = getelementptr i32, i32* %uglygep2, i64 1024
21 store i32 %3, i32* %scevgep, align 4, !tbaa !7
22 %lsr.iv.next = add nsw i64 %lsr.iv, 4
23 %6 = icmp eq i64 %lsr.iv.next, 0
24 br i1 %6, label %4, label %5, !llvm.loop !9
27 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" }
29 !llvm.module.flags = !{!0, !1}
31 !0 = !{i32 1, !"wchar_size", i32 4}
32 !1 = !{i32 7, !"uwtable", i32 1}
33 !2 = !{!"clang version 13.0.0 (https://github.com/llvm/llvm-project.git c42dd5dbb015afaef99cf876195c474c63c2393e)"}
35 !4 = !{!"any pointer", !5, i64 0}
36 !5 = !{!"omnipotent char", !6, i64 0}
37 !6 = !{!"Simple C++ TBAA"}
39 !8 = !{!"int", !5, i64 0}
40 !9 = distinct !{!9, !10, !11}
41 !10 = !{!"llvm.loop.mustprogress"}
42 !11 = !{!"llvm.loop.unroll.disable"}
48 exposesReturnsTwice: false
50 regBankSelected: false
53 tracksRegLiveness: true
58 isFrameAddressTaken: false
59 isReturnAddressTaken: false
68 maxCallFrameSize: 4294967295
69 cvBytesOfCalleeSavedRegisters: 0
70 hasOpaqueSPAdjustment: false
72 hasMustTailInVarArgFunc: false
80 debugValueSubstitutions: []
82 machineFunctionInfo: {}
84 ; CHECK-LABEL: name: _Z3foov
85 ; CHECK: bb.0 (%ir-block.0):
86 ; CHECK: successors: %bb.2(0x80000000)
87 ; CHECK: renamable $eax = MOV32r0 implicit-def dead $eflags
88 ; CHECK: renamable $rcx = MOV64ri32 -4096
89 ; CHECK: [[MOV64ri32_:%[0-9]+]]:gr64 = MOV64ri32 -4096
90 ; CHECK: [[MOV64rm:%[0-9]+]]:gr64 = MOV64rm $rip, 1, $noreg, @y, $noreg :: (dereferenceable load (s64) from @y, !tbaa !3)
92 ; CHECK: bb.1 (%ir-block.4):
94 ; CHECK: bb.2 (%ir-block.5):
95 ; CHECK: successors: %bb.1(0x04000000), %bb.2(0x7c000000)
96 ; CHECK: liveins: $eax, $rcx
97 ; CHECK: CMP64ri32 [[MOV64rm]], @x, implicit-def $eflags
98 ; CHECK: renamable $al = SETCCr 4, implicit killed $eflags, implicit killed $eax, implicit-def $eax
99 ; CHECK: MOV32mr renamable $rcx, 1, $noreg, @z + 4096, $noreg, renamable $eax :: (store (s32) into %ir.scevgep, !tbaa !7)
100 ; CHECK: renamable $rcx = ADD64ri8 killed renamable $rcx, 4, implicit-def $eflags
101 ; CHECK: JCC_1 %bb.1, 4, implicit killed $eflags
104 successors: %bb.2(0x80000000)
105 renamable $eax = MOV32r0 implicit-def dead $eflags
106 renamable $rcx = MOV64ri32 -4096
111 successors: %bb.1(0x04000000), %bb.2(0x7c000000)
113 %2:gr64 = MOV64ri32 -4096
114 CMP64mi32 $rip, 1, $noreg, @y, $noreg, @x, implicit-def $eflags :: (dereferenceable load (s64) from @y, !tbaa !3)
115 renamable $al = SETCCr 4, implicit killed $eflags, implicit killed $eax, implicit-def $eax
116 MOV32mr renamable $rcx, 1, $noreg, @z + 4096, $noreg, renamable $eax :: (store (s32) into %ir.scevgep, !tbaa !7)
117 renamable $rcx = ADD64ri8 killed renamable $rcx, 4, implicit-def $eflags
118 JCC_1 %bb.1, 4, implicit killed $eflags