1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=thumbv8.1m.main-none-eabi -mattr=+mve -simplify-mir -run-pass=phi-node-elimination %s -o - | FileCheck %s
5 target datalayout = "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64"
6 target triple = "arm-arm-none-eabi"
8 ; Function Attrs: nofree norecurse nounwind
9 define void @test(ptr noalias nocapture %X, ptr noalias nocapture readonly %Y, i32 %n) {
11 %cmp6 = icmp sgt i32 %n, 0
12 br i1 %cmp6, label %for.body.preheader, label %for.cond.cleanup
14 for.body.preheader: ; preds = %entry
15 call void @llvm.memcpy.p0.p0.i32(ptr align 4 %X, ptr align 4 %Y, i32 %n, i1 false)
16 br label %for.cond.cleanup
18 for.cond.cleanup: ; preds = %for.body.preheader, %entry
22 ; Function Attrs: argmemonly nofree nosync nounwind willreturn
23 declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg)
28 tracksRegLiveness: true
30 ; CHECK-LABEL: name: test
32 ; CHECK: successors: %bb.1(0x50000000), %bb.3(0x30000000)
33 ; CHECK: liveins: $r0, $r1, $r2
34 ; CHECK: [[COPY:%[0-9]+]]:rgpr = COPY killed $r2
35 ; CHECK: [[COPY1:%[0-9]+]]:rgpr = COPY killed $r1
36 ; CHECK: [[COPY2:%[0-9]+]]:rgpr = COPY killed $r0
37 ; CHECK: t2CMPri [[COPY]], 1, 14 /* CC::al */, $noreg, implicit-def $cpsr
38 ; CHECK: t2Bcc %bb.3, 11 /* CC::lt */, killed $cpsr
39 ; CHECK: t2B %bb.1, 14 /* CC::al */, $noreg
40 ; CHECK: bb.1.for.body.preheader:
41 ; CHECK: [[t2ADDri:%[0-9]+]]:rgpr = t2ADDri [[COPY]], 15, 14 /* CC::al */, $noreg, $noreg
42 ; CHECK: [[t2BICri:%[0-9]+]]:rgpr = t2BICri killed [[t2ADDri]], 16, 14 /* CC::al */, $noreg, $noreg
43 ; CHECK: [[t2LSRri:%[0-9]+]]:gprlr = t2LSRri killed [[t2BICri]], 4, 14 /* CC::al */, $noreg, $noreg
44 ; CHECK: [[COPY3:%[0-9]+]]:rgpr = COPY [[COPY1]]
45 ; CHECK: [[COPY4:%[0-9]+]]:rgpr = COPY [[COPY2]]
46 ; CHECK: [[COPY5:%[0-9]+]]:rgpr = COPY [[COPY]]
47 ; CHECK: [[t2WhileLoopStartLR:%[0-9]+]]:gprlr = t2WhileLoopStartLR killed [[t2LSRri]], %bb.3, implicit-def dead $cpsr
49 ; CHECK: [[COPY6:%[0-9]+]]:rgpr = COPY [[COPY5]]
50 ; CHECK: [[COPY7:%[0-9]+]]:gprlr = COPY [[t2WhileLoopStartLR]]
51 ; CHECK: [[COPY8:%[0-9]+]]:rgpr = COPY [[COPY4]]
52 ; CHECK: [[COPY9:%[0-9]+]]:rgpr = COPY [[COPY3]]
53 ; CHECK: [[MVE_VCTP8_:%[0-9]+]]:vccr = MVE_VCTP8 [[COPY6]], 0, $noreg, $noreg
54 ; CHECK: [[t2SUBri:%[0-9]+]]:rgpr = t2SUBri killed [[COPY6]], 16, 14 /* CC::al */, $noreg, $noreg
55 ; CHECK: [[MVE_VLDRBU8_post:%[0-9]+]]:rgpr, [[MVE_VLDRBU8_post1:%[0-9]+]]:mqpr = MVE_VLDRBU8_post killed [[COPY9]], 16, 1, [[MVE_VCTP8_]], $noreg
56 ; CHECK: [[MVE_VSTRBU8_post:%[0-9]+]]:rgpr = MVE_VSTRBU8_post killed [[MVE_VLDRBU8_post1]], killed [[COPY8]], 16, 1, killed [[MVE_VCTP8_]], $noreg
57 ; CHECK: [[COPY10:%[0-9]+]]:rgpr = COPY [[MVE_VLDRBU8_post]]
58 ; CHECK: [[COPY10:%[0-9]+]]:rgpr = COPY [[MVE_VSTRBU8_post]]
59 ; CHECK: [[COPY10:%[0-9]+]]:rgpr = COPY [[t2SUBri]]
60 ; CHECK: [[t2LoopEndDec:%[0-9]+]]:gprlr = t2LoopEndDec killed [[COPY7]], %bb.2, implicit-def dead $cpsr
61 ; CHECK: t2B %bb.3, 14 /* CC::al */, $noreg
62 ; CHECK: bb.3.for.cond.cleanup:
63 ; CHECK: tBX_RET 14 /* CC::al */, $noreg
65 successors: %bb.1(0x50000000), %bb.3(0x30000000)
66 liveins: $r0, $r1, $r2
68 %2:rgpr = COPY killed $r2
69 %1:rgpr = COPY killed $r1
70 %0:rgpr = COPY killed $r0
71 t2CMPri %2, 1, 14 /* CC::al */, $noreg, implicit-def $cpsr
72 t2Bcc %bb.3, 11 /* CC::lt */, killed $cpsr
73 t2B %bb.1, 14 /* CC::al */, $noreg
75 bb.1.for.body.preheader:
76 successors: %bb.3(0x40000000), %bb.2(0x40000000)
78 %3:rgpr = t2ADDri %2, 15, 14 /* CC::al */, $noreg, $noreg
79 %4:rgpr = t2BICri killed %3, 16, 14 /* CC::al */, $noreg, $noreg
80 %5:gprlr = t2LSRri killed %4, 4, 14 /* CC::al */, $noreg, $noreg
81 %6:gprlr = t2WhileLoopStartLR killed %5, %bb.3, implicit-def dead $cpsr
84 successors: %bb.2(0x40000000), %bb.3(0x40000000)
86 %7:rgpr = PHI %1, %bb.1, %8, %bb.2
87 %9:rgpr = PHI %0, %bb.1, %10, %bb.2
88 %11:gprlr = PHI %6, %bb.1, %12, %bb.2
89 %13:rgpr = PHI %2, %bb.1, %14, %bb.2
90 %15:vccr = MVE_VCTP8 %13, 0, $noreg, $noreg
91 %14:rgpr = t2SUBri killed %13, 16, 14 /* CC::al */, $noreg, $noreg
92 %8:rgpr, %16:mqpr = MVE_VLDRBU8_post killed %7, 16, 1, %15, $noreg
93 %10:rgpr = MVE_VSTRBU8_post killed %16, killed %9, 16, 1, killed %15, $noreg
94 %12:gprlr = t2LoopEndDec killed %11, %bb.2, implicit-def dead $cpsr
95 t2B %bb.3, 14 /* CC::al */, $noreg
97 bb.3.for.cond.cleanup:
98 tBX_RET 14 /* CC::al */, $noreg