1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -run-pass=peephole-opt %s -o - | FileCheck %s
3 # RUN: llc -passes=peephole-opt %s -o - | FileCheck %s
7 source_filename = "<stdin>"
8 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
9 target triple = "thumb-none--eabi"
11 define i32 @f(i32 %a, i32 %b) {
13 %mul = mul nsw i32 %b, %a
14 %cmp = icmp eq i32 %mul, 0
15 %conv = zext i1 %cmp to i32
23 exposesReturnsTwice: false
25 regBankSelected: false
27 tracksRegLiveness: true
29 - { id: 0, class: tgpr }
30 - { id: 1, class: tgpr }
31 - { id: 2, class: tgpr }
32 - { id: 3, class: tgpr }
33 - { id: 4, class: tgpr }
34 - { id: 5, class: tgpr }
36 - { reg: '$r0', virtual-reg: '%0' }
37 - { reg: '$r1', virtual-reg: '%1' }
39 isFrameAddressTaken: false
40 isReturnAddressTaken: false
49 hasOpaqueSPAdjustment: false
51 hasMustTailInVarArgFunc: false
54 ; CHECK-LABEL: name: f
56 ; CHECK: successors: %bb.2(0x40000000), %bb.1(0x40000000)
57 ; CHECK: liveins: $r0, $r1
58 ; CHECK: [[COPY:%[0-9]+]]:tgpr = COPY $r1
59 ; CHECK: [[COPY1:%[0-9]+]]:tgpr = COPY $r0
60 ; CHECK: %3:tgpr, $cpsr = tMOVi8 1, 14 /* CC::al */, $noreg
61 ; CHECK: %4:tgpr, $cpsr = tMOVi8 0, 14 /* CC::al */, $noreg
62 ; CHECK: %2:tgpr, $cpsr = tMUL [[COPY]], [[COPY1]], 14 /* CC::al */, $noreg
63 ; CHECK: tBcc %bb.2, 0 /* CC::eq */, $cpsr
65 ; CHECK: successors: %bb.2(0x80000000)
67 ; CHECK: [[PHI:%[0-9]+]]:tgpr = PHI %4, %bb.1, %3, %bb.0
68 ; CHECK: $r0 = COPY [[PHI]]
69 ; CHECK: tBX_RET 14 /* CC::al */, $noreg, implicit $r0
75 %2, $cpsr = tMUL %1, %0, 14, $noreg
76 %3, $cpsr = tMOVi8 1, 14, $noreg
77 %4, $cpsr = tMOVi8 0, 14, $noreg
78 tCMPi8 killed %2, 0, 14, $noreg, implicit-def $cpsr
79 tBcc %bb.2.entry, 0, $cpsr
84 %5 = PHI %4, %bb.1.entry, %3, %bb.0.entry
86 tBX_RET 14, $noreg, implicit $r0