1 # RUN: llc -run-pass arm-prera-ldst-opt %s -o - | FileCheck %s
2 # RUN: llc -run-pass arm-prera-ldst-opt -arm-prera-ldst-opt-reorder-limit=3 %s -o - | FileCheck %s
3 # RUN: llc -run-pass arm-prera-ldst-opt -arm-prera-ldst-opt-reorder-limit=2 %s -o - | FileCheck %s --check-prefix=CHECK-LIMIT
5 target triple = "thumbv7---eabi"
7 define void @a(i32* nocapture %x, i32 %y, i32 %z) {
12 define void @b(i32* nocapture %x, i32 %y, i32 %z) {
18 # CHECK-LABEL: name: a
21 tracksRegLiveness: true
23 - { reg: '$r0', virtual-reg: '%0' }
24 - { reg: '$r1', virtual-reg: '%1' }
25 - { reg: '$r2', virtual-reg: '%2' }
28 liveins: $r0, $r1, $r2
33 %3 : rgpr = t2MUL %2, %2, 14, $noreg
34 %4 : rgpr = t2MUL %1, %1, 14, $noreg
35 %5 : rgpr = t2MOVi32imm -858993459
36 %6 : rgpr, %7 : rgpr = t2UMULL killed %3, %5, 14, $noreg
37 %8 : rgpr, %9 : rgpr = t2UMULL killed %4, %5, 14, $noreg
38 t2STRi12 %1, %0, 0, 14, $noreg :: (store 4)
39 %10 : rgpr = t2LSLri %2, 1, 14, $noreg, $noreg
40 t2STRi12 killed %10, %0, 4, 14, $noreg :: (store 4)
42 ; Make sure we move the paired stores next to each other, and
43 ; insert them in an appropriate location.
45 ; CHECK-NEXT: t2STRi12 killed %10,
49 %11 : rgpr = t2MOVi 55, 14, $noreg, $noreg
50 %12 : gprnopc = t2ADDrs %11, killed %7, 19, 14, $noreg, $noreg
51 t2STRi12 killed %12, %0, 16, 14, $noreg :: (store 4)
52 %13 : gprnopc = t2ADDrs %11, killed %9, 19, 14, $noreg, $noreg
53 t2STRi12 killed %13, %0, 20, 14, $noreg :: (store 4)
55 ; Make sure we move the paired stores next to each other.
56 ; CHECK: t2STRi12 killed %12,
57 ; CHECK-NEXT: t2STRi12 killed %13,
61 # CHECK-LABEL: name: b
64 tracksRegLiveness: true
66 - { reg: '$r0', virtual-reg: '%0' }
67 - { reg: '$r1', virtual-reg: '%1' }
68 - { reg: '$r2', virtual-reg: '%2' }
71 liveins: $r0, $r1, $r2
76 t2STRi12 %1, %0, 0, 14, $noreg :: (store 4)
77 %10 : rgpr = t2LSLri %2, 1, 14, $noreg, $noreg
78 t2STRi12 killed %10, %0, 4, 14, $noreg :: (store 4)
79 %3 : rgpr = t2MUL %2, %2, 14, $noreg
80 t2STRi12 %3, %0, 8, 14, $noreg :: (store 4)
82 ; Make sure we move the paired stores next to each other, and
83 ; insert them in an appropriate location.
84 ; CHECK: t2STRi12 {{.*}}, 0
85 ; CHECK-NEXT: t2STRi12 {{.*}}, 4
86 ; CHECK-NEXT: t2STRi12 {{.*}}, 8
88 ; CHECK-NEXT: t2MOVi32imm
90 ; CHECK-LIMIT-LABEL: name: b
91 ; CHECK-LIMIT: t2STRi12 {{.*}}, 0
92 ; CHECK-LIMIT-NEXT: t2STRi12 {{.*}}, 4
93 ; CHECK-LIMIT-NEXT: t2MUL
94 ; CHECK-LIMIT-NEXT: t2STRi12 {{.*}}, 8
96 %4 : rgpr = t2MUL %1, %1, 14, $noreg
97 %5 : rgpr = t2MOVi32imm -858993459
98 %6 : rgpr, %7 : rgpr = t2UMULL killed %3, %5, 14, $noreg
99 %8 : rgpr, %9 : rgpr = t2UMULL killed %4, %5, 14, $noreg
100 %10 : rgpr = t2LSLri %2, 1, 14, $noreg, $noreg
101 %11 : rgpr = t2MOVi 55, 14, $noreg, $noreg
102 %12 : gprnopc = t2ADDrs %11, killed %7, 19, 14, $noreg, $noreg
103 t2STRi12 killed %12, %0, 16, 14, $noreg :: (store 4)
104 %13 : gprnopc = t2ADDrs %11, killed %9, 19, 14, $noreg, $noreg
105 t2STRi12 killed %13, %0, 20, 14, $noreg :: (store 4)
107 ; Make sure we move the paired stores next to each other.
108 ; CHECK: t2STRi12 {{.*}}, 16
109 ; CHECK-NEXT: t2STRi12 {{.*}}, 20