84 lines · plain
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py2# RUN: llc -run-pass=thumb2-reduce-size %s -o - | FileCheck %s3 4--- |5 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"6 target triple = "thumbv8m.main-arm-none-eabi"7 8 ; Function Attrs: norecurse nounwind readnone9 define i32 @test(i32 %x, i32 %y) local_unnamed_addr #0 {10 entry:11 %cmp6 = icmp sgt i32 %y, 012 br i1 %cmp6, label %for.body.preheader, label %for.cond.cleanup13 14 for.body.preheader: ; preds = %entry15 br label %for.body16 17 for.cond.cleanup: ; preds = %for.body, %entry18 %sum.0.lcssa = phi i32 [ 1, %entry ], [ %mul, %for.body ]19 ret i32 %sum.0.lcssa20 21 for.body: ; preds = %for.body, %for.body.preheader22 %lsr.iv1 = phi i32 [ %lsr.iv.next2, %for.body ], [ %x, %for.body.preheader ]23 %lsr.iv = phi i32 [ %lsr.iv.next, %for.body ], [ %y, %for.body.preheader ]24 %sum.07 = phi i32 [ %mul, %for.body ], [ 1, %for.body.preheader ]25 %mul = mul nsw i32 %lsr.iv1, %sum.0726 %lsr.iv.next = add i32 %lsr.iv, -127 %lsr.iv.next2 = add i32 %lsr.iv1, 128 %exitcond = icmp eq i32 %lsr.iv.next, 029 br i1 %exitcond, label %for.cond.cleanup, label %for.body30 }31 32 attributes #0 = { norecurse nounwind readnone "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="cortex-m7" "target-features"="-d32,+dsp,+fp-armv8,-fp64,+hwdiv,+strict-align,+thumb-mode,-crc,-dotprod,-hwdiv-arm,-ras" "use-soft-float"="false" }33 34...35---36name: test37tracksRegLiveness: true38liveins:39 - { reg: '$r0', virtual-reg: '' }40 - { reg: '$r1', virtual-reg: '' }41body: |42 ; CHECK-LABEL: name: test43 ; CHECK: bb.0.entry:44 ; CHECK: successors: %bb.1(0x40000000), %bb.2(0x40000000)45 ; CHECK: liveins: $r0, $r146 ; CHECK: $r2 = tMOVr $r0, 14 /* CC::al */, $noreg47 ; CHECK: $r0, dead $cpsr = tMOVi8 1, 14 /* CC::al */, $noreg48 ; CHECK: tCMPi8 $r1, 1, 14 /* CC::al */, $noreg, implicit-def $cpsr49 ; CHECK: t2Bcc %bb.2, 11 /* CC::lt */, killed $cpsr50 ; CHECK: bb.1.for.body:51 ; CHECK: successors: %bb.2(0x40000000), %bb.1(0x40000000)52 ; CHECK: liveins: $r0, $r1, $r253 ; CHECK: $r0, dead $cpsr = tMUL $r2, killed $r0, 14 /* CC::al */, $noreg54 ; CHECK: $r2, dead $cpsr = tADDi8 killed $r2, 1, 14 /* CC::al */, $noreg55 ; CHECK: $r1, $cpsr = tSUBi8 killed $r1, 1, 14 /* CC::al */, $noreg56 ; CHECK: t2Bcc %bb.1, 1 /* CC::ne */, killed $cpsr57 ; CHECK: bb.2.for.cond.cleanup:58 ; CHECK: liveins: $r059 ; CHECK: tBX_RET 14 /* CC::al */, $noreg, implicit $r060 bb.0.entry:61 successors: %bb.1.for.body, %bb.2.for.cond.cleanup62 liveins: $r0, $r163 64 $r2 = tMOVr $r0, 14, _65 $r0 = t2MOVi 1, 14, _, _66 t2CMPri $r1, 1, 14, _, implicit-def $cpsr67 t2Bcc %bb.2.for.cond.cleanup, 11, killed $cpsr68 69 bb.1.for.body:70 successors: %bb.2.for.cond.cleanup, %bb.1.for.body71 liveins: $r0, $r1, $r272 73 $r0 = t2MUL $r2, killed $r0, 14, _74 $r2 = t2ADDri killed $r2, 1, 14, _, _75 $r1 = t2SUBri killed $r1, 1, 14, _, def $cpsr76 t2Bcc %bb.1.for.body, 1, killed $cpsr77 78 bb.2.for.cond.cleanup:79 liveins: $r080 81 tBX_RET 14, _, implicit $r082 83...84