1# RUN: llc -run-pass=peephole-opt %s -o - | FileCheck %s 2 3--- | 4 ; ModuleID = '<stdin>' 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" 8 9 define i32 @f(i32 %a, i32 %b) { 10 entry: 11 %mul = mul nsw i32 %b, %a 12 %cmp = icmp eq i32 %mul, 0 13 %conv = zext i1 %cmp to i32 14 ret i32 %conv 15 } 16 17... 18--- 19name: f 20# CHECK-LABEL: name: f 21alignment: 1 22exposesReturnsTwice: false 23legalized: false 24regBankSelected: false 25selected: false 26tracksRegLiveness: true 27registers: 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 } 34liveins: 35 - { reg: '$r0', virtual-reg: '%0' } 36 - { reg: '$r1', virtual-reg: '%1' } 37frameInfo: 38 isFrameAddressTaken: false 39 isReturnAddressTaken: false 40 hasStackMap: false 41 hasPatchPoint: false 42 stackSize: 0 43 offsetAdjustment: 0 44 maxAlignment: 0 45 adjustsStack: false 46 hasCalls: false 47 maxCallFrameSize: 0 48 hasOpaqueSPAdjustment: false 49 hasVAStart: false 50 hasMustTailInVarArgFunc: false 51 52# CHECK: tMOVi8 1, 14, $noreg 53# CHECK: tMOVi8 0, 14, $noreg 54# CHECK: tMUL %1, %0, 14, $noreg 55# CHECK-NOT: tCMPi8 56body: | 57 bb.0.entry: 58 liveins: $r0, $r1 59 60 %1 = COPY $r1 61 %0 = COPY $r0 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 67 68 bb.1.entry: 69 70 bb.2.entry: 71 %5 = PHI %4, %bb.1.entry, %3, %bb.0.entry 72 $r0 = COPY %5 73 tBX_RET 14, $noreg, implicit $r0 74 75... 76