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