1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -run-pass=peephole-opt %s -o - -verify-machineinstrs | FileCheck %s
4 # Make sure the MOVCC to conditional instruction peephole doesn't change the
5 # register class to one that's invalid.
8 target triple = "armv7-unknown-unknown"
9 define i32 @test(i32 %x, i32 %y) {
15 tracksRegLiveness: true
19 ; CHECK-LABEL: name: test
20 ; CHECK: liveins: $r0, $r1
21 ; CHECK: [[COPY:%[0-9]+]]:gpr = COPY $r0
22 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $r1
23 ; CHECK-NEXT: [[MOVsi:%[0-9]+]]:gpr = MOVsi [[COPY1]], 27, 14 /* CC::al */, $noreg, $noreg
24 ; CHECK-NEXT: [[ORRrsi:%[0-9]+]]:gpr = ORRrsi [[MOVsi]], [[COPY1]], 234, 14 /* CC::al */, $noreg, $noreg
25 ; CHECK-NEXT: [[MOVsi1:%[0-9]+]]:gpr = MOVsi [[COPY1]], 155, 14 /* CC::al */, $noreg, $noreg
26 ; CHECK-NEXT: [[ORRrsi1:%[0-9]+]]:gprnopc = ORRrsi killed [[MOVsi1]], killed [[MOVsi]], 106, 14 /* CC::al */, $noreg, $noreg
27 ; CHECK-NEXT: TSTri [[COPY1]], 1, 14 /* CC::al */, $noreg, implicit-def $cpsr
28 ; CHECK-NEXT: [[UXTH:%[0-9]+]]:gprnopc = UXTH killed [[ORRrsi1]], 0, 0 /* CC::eq */, $cpsr, implicit [[ORRrsi]](tied-def 0)
29 ; CHECK-NEXT: $r0 = COPY killed [[UXTH]]
30 ; CHECK-NEXT: BX_RET 14 /* CC::al */, $noreg, implicit $r0
33 %2:gpr = MOVsi %1:gpr, 27, 14, $noreg, $noreg
34 %3:gpr = ORRrsi %2:gpr, %1:gpr, 234, 14, $noreg, $noreg
35 %4:gpr = MOVsi %1:gpr, 155, 14, $noreg, $noreg
36 %5:gprnopc = ORRrsi killed %4:gpr, killed %2:gpr, 106, 14, $noreg, $noreg
37 %6:gprnopc = UXTH killed %5:gprnopc, 0, 14, $noreg
38 TSTri %1:gpr, 1, 14, $noreg, implicit-def $cpsr
39 %7:gpr = MOVCCr %3:gpr, killed %6:gprnopc, 0, $cpsr
41 BX_RET 14, $noreg, implicit $r0