1 # RUN: llc -run-pass=peephole-opt %s -o - | FileCheck %s
5 source_filename = "<stdin>"
6 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
7 target triple = "thumb-none--eabi"
9 define i32 @f(i32 %a, i32 %b) {
11 %mul = mul nsw i32 %b, %a
12 %cmp = icmp eq i32 %mul, 0
13 %conv = zext i1 %cmp to i32
20 # CHECK-LABEL: name: f
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
52 # CHECK: tMOVi8 1, 14, $noreg
53 # CHECK: tMOVi8 0, 14, $noreg
54 # CHECK: tMUL %1, %0, 14, $noreg
62 %2, $cpsr = tMUL %1, %0, 14, $noreg
63 %3, $cpsr = tMOVi8 1, 14, $noreg
64 %4, $cpsr = tMOVi8 0, 14, $noreg
65 tCMPi8 killed %2, 0, 14, $noreg, implicit-def $cpsr
66 tBcc %bb.2.entry, 0, $cpsr
71 %5 = PHI %4, %bb.1.entry, %3, %bb.0.entry
73 tBX_RET 14, $noreg, implicit $r0