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