1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=thumbv8.1m.main -mattr=+mve -run-pass=arm-low-overhead-loops %s -o - | FileCheck %s
5 @arr = external dso_local local_unnamed_addr global [0 x i32], align 4
7 define dso_local arm_aapcs_vfpcc void @foo(i32 %i) {
9 %tobool.not11 = icmp eq i32 %i, 0
10 br i1 %tobool.not11, label %for.end5, label %vector.ph.preheader
12 vector.ph.preheader: ; preds = %entry
13 %active.lane.mask = call <4 x i1> @llvm.get.active.lane.mask.v4i1.i32(i32 0, i32 3)
16 vector.ph: ; preds = %vector.ph.preheader, %vector.ph
17 %i.addr.012 = phi i32 [ %math, %vector.ph ], [ %i, %vector.ph.preheader ]
18 call void @llvm.masked.store.v4i32.p0v4i32(<4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32>* bitcast ([0 x i32]* @arr to <4 x i32>*), i32 4, <4 x i1> %active.lane.mask)
19 %0 = call { i32, i1 } @llvm.uadd.with.overflow.i32(i32 %i.addr.012, i32 1)
20 %math = extractvalue { i32, i1 } %0, 0
21 %ov = extractvalue { i32, i1 } %0, 1
22 br i1 %ov, label %for.end5, label %vector.ph
24 for.end5: ; preds = %vector.ph, %entry
28 declare <4 x i1> @llvm.get.active.lane.mask.v4i1.i32(i32, i32)
29 declare void @llvm.masked.store.v4i32.p0v4i32(<4 x i32>, <4 x i32>*, i32 immarg, <4 x i1>)
30 declare { i32, i1 } @llvm.uadd.with.overflow.i32(i32, i32)
36 tracksRegLiveness: true
39 - { reg: '$r0', virtual-reg: '' }
44 cvBytesOfCalleeSavedRegisters: 0
53 value: '<4 x i32> <i32 0, i32 1, i32 2, i32 3>'
55 isTargetSpecific: false
56 machineFunctionInfo: {}
58 ; CHECK-LABEL: name: foo
60 ; CHECK: successors: %bb.3(0x30000000), %bb.1(0x50000000)
62 ; CHECK: tCBZ $r0, %bb.3
63 ; CHECK: bb.1.vector.ph.preheader:
64 ; CHECK: successors: %bb.2(0x80000000)
66 ; CHECK: renamable $r1 = tLEApcrel %const.0, 14 /* CC::al */, $noreg
67 ; CHECK: renamable $q0 = MVE_VMOVimmi32 3, 0, $noreg, undef renamable $q0
68 ; CHECK: renamable $q1 = MVE_VLDRWU32 killed renamable $r1, 0, 0, $noreg :: (load (s128) from constant-pool, align 8)
69 ; CHECK: $r1 = t2MOVi16 target-flags(arm-lo16) @arr, 14 /* CC::al */, $noreg
70 ; CHECK: $r1 = t2MOVTi16 killed $r1, target-flags(arm-hi16) @arr, 14 /* CC::al */, $noreg
71 ; CHECK: renamable $vpr = MVE_VCMPu32 killed renamable $q0, killed renamable $q1, 8, 0, $noreg
72 ; CHECK: renamable $q0 = MVE_VMOVimmi32 2, 0, $noreg, undef renamable $q0
73 ; CHECK: bb.2.vector.ph:
74 ; CHECK: successors: %bb.3(0x04000000), %bb.2(0x7c000000)
75 ; CHECK: liveins: $vpr, $q0, $r0, $r1
76 ; CHECK: renamable $r0, $cpsr = tADDi8 killed renamable $r0, 1, 14 /* CC::al */, $noreg
77 ; CHECK: MVE_VPST 8, implicit $vpr
78 ; CHECK: MVE_VSTRWU32 renamable $q0, renamable $r1, 0, 1, renamable $vpr :: (store (s128) into `<4 x i32>* bitcast ([0 x i32]* @arr to <4 x i32>*)`, align 4)
79 ; CHECK: tBcc %bb.2, 3 /* CC::lo */, killed $cpsr
80 ; CHECK: bb.3.for.end5:
81 ; CHECK: tBX_RET 14 /* CC::al */, $noreg
82 ; CHECK: bb.4 (align 8):
83 ; CHECK: CONSTPOOL_ENTRY 0, %const.0, 16
85 successors: %bb.3(0x30000000), %bb.1(0x50000000)
90 bb.1.vector.ph.preheader:
91 successors: %bb.2(0x80000000)
94 renamable $r1 = tLEApcrel %const.0, 14 /* CC::al */, $noreg
95 renamable $q0 = MVE_VMOVimmi32 3, 0, $noreg, undef renamable $q0
96 renamable $q1 = MVE_VLDRWU32 killed renamable $r1, 0, 0, $noreg :: (load (s128) from constant-pool, align 8)
97 $r1 = t2MOVi16 target-flags(arm-lo16) @arr, 14 /* CC::al */, $noreg
98 $r1 = t2MOVTi16 killed $r1, target-flags(arm-hi16) @arr, 14 /* CC::al */, $noreg
99 renamable $vpr = MVE_VCMPu32 killed renamable $q0, killed renamable $q1, 8, 0, $noreg
100 renamable $q0 = MVE_VMOVimmi32 2, 0, $noreg, undef renamable $q0
103 successors: %bb.3(0x04000000), %bb.2(0x7c000000)
104 liveins: $vpr, $q0, $r0, $r1
106 renamable $r0, $cpsr = tADDi8 killed renamable $r0, 1, 14 /* CC::al */, $noreg
107 MVE_VPST 8, implicit $vpr
108 MVE_VSTRWU32 renamable $q0, renamable $r1, 0, 1, renamable $vpr :: (store (s128) into `<4 x i32>* bitcast ([0 x i32]* @arr to <4 x i32>*)`, align 4)
109 tBcc %bb.2, 3 /* CC::lo */, killed $cpsr
112 tBX_RET 14 /* CC::al */, $noreg
115 CONSTPOOL_ENTRY 0, %const.0, 16