1# RUN: llc -run-pass=peephole-opt %s -o - | FileCheck %s
2
3# CHECK: [[IN:%.*]]:gprnopc = COPY $r0
4# CHECK: [[SUM1TMP:%.*]]:rgpr = t2ADDri [[IN]], 25600
5# CHECK: [[SUM1:%.*]]:rgpr = t2ADDri killed [[SUM1TMP]], 133
6
7# CHECK: [[SUM2TMP:%.*]]:rgpr = t2SUBri [[IN]], 25600
8# CHECK: [[SUM2:%.*]]:rgpr = t2SUBri killed [[SUM2TMP]], 133
9
10# CHECK: [[SUM3TMP:%.*]]:rgpr = t2SUBri [[IN]], 25600
11# CHECK: [[SUM3:%.*]]:rgpr = t2SUBri killed [[SUM3TMP]], 133
12
13# CHECK: [[SUM4TMP:%.*]]:rgpr = t2ADDri killed [[IN]], 25600
14# CHECK: [[SUM4:%.*]]:rgpr = t2ADDri killed [[SUM4TMP]], 133
15
16
17--- |
18  target datalayout = "e-m:o-p:32:32-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32"
19  target triple = "thumbv7-apple-ios"
20
21  define i32 @foo(i32 %in) {
22    ret i32 undef
23  }
24...
25---
26name:            foo
27registers:
28  - { id: 0, class: gprnopc }
29  - { id: 1, class: rgpr }
30  - { id: 2, class: rgpr }
31  - { id: 3, class: rgpr }
32  - { id: 4, class: rgpr }
33  - { id: 5, class: rgpr }
34  - { id: 6, class: rgpr }
35  - { id: 7, class: rgpr }
36  - { id: 8, class: rgpr }
37liveins:
38  - { reg: '$r0', virtual-reg: '%0' }
39body:             |
40  bb.0 (%ir-block.0):
41    liveins: $r0
42    %0 = COPY $r0
43    %1 = t2MOVi32imm -25733
44    %2 = t2SUBrr %0, killed %1, 14, $noreg, $noreg
45
46    %3 = t2MOVi32imm 25733
47    %4 = t2SUBrr %0, killed %3, 14, $noreg, $noreg
48
49    %5 = t2MOVi32imm -25733
50    %6= t2ADDrr %0, killed %5, 14, $noreg, $noreg
51
52    %7 = t2MOVi32imm 25733
53    %8 = t2ADDrr killed %0, killed %7, 14, $noreg, $noreg
54
55    $r0 = COPY killed %8
56    tBX_RET 14, $noreg, implicit $r0
57
58...
59