1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -o - %s -mtriple=armv7-- -verify-machineinstrs -run-pass=peephole-opt | FileCheck %s
4 # Make sure we do not crash on this input.
5 # Note that this input could in principle be optimized, but right now we don't
6 # have this case implemented so the output should simply be unchanged.
10 tracksRegLiveness: true
12 ; CHECK-LABEL: name: func0
14 ; CHECK: successors: %bb.2(0x40000000), %bb.1(0x40000000)
15 ; CHECK: Bcc %bb.2, 1 /* CC::ne */, undef $cpsr
17 ; CHECK: successors: %bb.3(0x80000000)
18 ; CHECK: [[DEF:%[0-9]+]]:dpr = IMPLICIT_DEF
19 ; CHECK: [[VMOVRRD:%[0-9]+]]:gpr, [[VMOVRRD1:%[0-9]+]]:gpr = VMOVRRD [[DEF]], 14 /* CC::al */, $noreg
22 ; CHECK: successors: %bb.3(0x80000000)
23 ; CHECK: [[DEF1:%[0-9]+]]:spr = IMPLICIT_DEF
24 ; CHECK: [[VMOVRS:%[0-9]+]]:gpr = VMOVRS [[DEF1]], 14 /* CC::al */, $noreg
26 ; CHECK: [[PHI:%[0-9]+]]:gpr = PHI [[VMOVRRD]], %bb.1, [[VMOVRS]], %bb.2
27 ; CHECK: [[VMOVSR:%[0-9]+]]:spr = VMOVSR [[PHI]], 14 /* CC::al */, $noreg
29 Bcc %bb.2, 1, undef $cpsr
33 %1:gpr, %2:gpr = VMOVRRD %0:dpr, 14, $noreg
38 %4:gpr = VMOVRS %3:spr, 14, $noreg
41 %5:gpr = PHI %1, %bb.1, %4, %bb.2
42 %6:spr = VMOVSR %5, 14, $noreg
47 tracksRegLiveness: true
49 ; CHECK-LABEL: name: func1
51 ; CHECK: successors: %bb.2(0x40000000), %bb.1(0x40000000)
52 ; CHECK: Bcc %bb.2, 1 /* CC::ne */, undef $cpsr
54 ; CHECK: successors: %bb.3(0x80000000)
55 ; CHECK: [[DEF:%[0-9]+]]:spr = IMPLICIT_DEF
56 ; CHECK: [[VMOVRS:%[0-9]+]]:gpr = VMOVRS [[DEF]], 14 /* CC::al */, $noreg
59 ; CHECK: successors: %bb.3(0x80000000)
60 ; CHECK: [[DEF1:%[0-9]+]]:spr = IMPLICIT_DEF
61 ; CHECK: [[VMOVRS1:%[0-9]+]]:gpr = VMOVRS [[DEF1]], 14 /* CC::al */, $noreg
63 ; CHECK: [[PHI:%[0-9]+]]:spr = PHI [[DEF]], %bb.1, [[DEF1]], %bb.2
64 ; CHECK: [[PHI1:%[0-9]+]]:gpr = PHI [[VMOVRS]], %bb.1, [[VMOVRS1]], %bb.2
65 ; CHECK: [[COPY:%[0-9]+]]:spr = COPY [[PHI]]
67 Bcc %bb.2, 1, undef $cpsr
71 %0:gpr = VMOVRS %1, 14, $noreg
76 %2:gpr = VMOVRS %3:spr, 14, $noreg
79 %4:gpr = PHI %0, %bb.1, %2, %bb.2
80 %5:spr = VMOVSR %4, 14, $noreg
83 # The current implementation doesn't perform any transformations if undef
84 # operands are involved.
88 tracksRegLiveness: true
90 ; CHECK-LABEL: name: func-undefops
92 ; CHECK: successors: %bb.2(0x40000000), %bb.1(0x40000000)
93 ; CHECK: Bcc %bb.2, 1 /* CC::ne */, undef $cpsr
95 ; CHECK: successors: %bb.3(0x80000000)
96 ; CHECK: [[VMOVRS:%[0-9]+]]:gpr = VMOVRS undef %1:spr, 14 /* CC::al */, $noreg
99 ; CHECK: successors: %bb.3(0x80000000)
100 ; CHECK: [[VMOVRS1:%[0-9]+]]:gpr = VMOVRS undef %3:spr, 14 /* CC::al */, $noreg
102 ; CHECK: [[PHI:%[0-9]+]]:gpr = PHI [[VMOVRS]], %bb.1, [[VMOVRS1]], %bb.2
103 ; CHECK: [[VMOVSR:%[0-9]+]]:spr = VMOVSR [[PHI]], 14 /* CC::al */, $noreg
105 Bcc %bb.2, 1, undef $cpsr
108 %0:gpr = VMOVRS undef %1:spr, 14, $noreg
112 %2:gpr = VMOVRS undef %3:spr, 14, $noreg
115 %4:gpr = PHI %0, %bb.1, %2, %bb.2
116 %5:spr = VMOVSR %4, 14, $noreg