llvm.org GIT mirror llvm / f241349
[ARM] Enable shrink-wrapping by default. Differential Revision: http://reviews.llvm.org/D14357 rdar://problem/21942589 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252825 91177308-0d34-0410-b5e6-96231b3b80d8 Quentin Colombet 4 years ago
12 changed file(s) with 32 addition(s) and 18 deletion(s). Raw diff Collapse all Expand all
5656 void adjustForSegmentedStacks(MachineFunction &MF,
5757 MachineBasicBlock &MBB) const override;
5858
59 /// Returns true if the target will correctly handle shrink wrapping.
60 bool enableShrinkWrapping(const MachineFunction &MF) const override {
61 return true;
62 }
63
5964 private:
6065 void emitPushInst(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI,
6166 const std::vector &CSI, unsigned StmOpc,
8282 define void @t7() nounwind {
8383 entry:
8484 ; CHECKT2D-LABEL: t7:
85 ; CHECKT2D: blxeq _foo
86 ; CHECKT2D-NEXT: pop.w
87 ; CHECKT2D-NEXT: b.w _foo
85 ; CHECKT2D: it ne
86 ; CHECKT2D-NEXT: bne.w _foo
87 ; CHECKT2D-NEXT: push
88 ; CHECKT2D-NEXT: mov r7, sp
89 ; CHECKT2D-NEXT: blx _foo
8890 br i1 undef, label %bb, label %bb1.lr.ph
8991
9092 bb1.lr.ph:
None ; RUN: llc -mtriple=thumbv7-apple-none-macho < %s | FileCheck %s
0 ; Disable shrink-wrapping on the first test otherwise we wouldn't
1 ; exerce the path for PR18136.
2 ; RUN: llc -mtriple=thumbv7-apple-none-macho < %s -enable-shrink-wrap=false | FileCheck %s
13 ; RUN: llc -mtriple=thumbv6m-apple-none-macho -disable-fp-elim < %s | FileCheck %s --check-prefix=CHECK-T1
24 ; RUN: llc -mtriple=thumbv7-apple-darwin-ios -disable-fp-elim < %s | FileCheck %s --check-prefix=CHECK-IOS
35 ; RUN: llc -mtriple=thumbv7--linux-gnueabi -disable-fp-elim < %s | FileCheck %s --check-prefix=CHECK-LINUX
1212
1313 define i32 @t1(i32 %a, i32 %b) {
1414 ; A8-LABEL: t1:
15 ; A8: poplt {r7, pc}
15 ; A8: bxlt lr
1616
1717 ; SWIFT-LABEL: t1:
18 ; SWIFT: pop {r7, pc}
18 ; SWIFT: bxlt lr
1919 ; SWIFT: pop {r7, pc}
2020 entry:
2121 %tmp1 = icmp sgt i32 %a, 10 ; [#uses=1]
22 define void @foo(i32 %X, i32 %Y) {
33 entry:
44 ; CHECK: cmpne
5 ; CHECK: pophi
5 ; CHECK: bxhi lr
66 %tmp1 = icmp ult i32 %X, 4 ; [#uses=1]
77 %tmp4 = icmp eq i32 %Y, 0 ; [#uses=1]
88 %tmp7 = or i1 %tmp4, %tmp1 ; [#uses=1]
44 declare void @abort()
55
66 define fastcc void @t(%struct.SString* %word, i8 signext %c) {
7 ; CHECK: popne
7 ; CHECK-NOT: pop
8 ; CHECK: bxne
9 ; CHECK-NOT: pop
810 entry:
911 %tmp1 = icmp eq %struct.SString* %word, null ; [#uses=1]
1012 br i1 %tmp1, label %cond_true, label %cond_false
2626 entry:
2727 ; CHECK-LABEL: f2:
2828 ; CHECK: cmp
29 ; CHECK: poplt
29 ; CHECK: bxlt
3030 ; CHECK-NOT: cmp
3131 ; CHECK: movle
3232 %0 = load i32, i32* @foo, align 4
2222
2323 ; CHECK: .globl baz
2424 ; CHECK-NEXT: .align 2
25 ; CHECK: adr.w
25 ; CHECK: tbb
2626 define i32 @baz() {
2727 %1 = load i32, i32* @c, align 4
2828 switch i32 %1, label %7 [
1818 define void @f1(i32 %x) optsize {
1919 ; CHECK-LABEL: f1:
2020 ; CHECK: cmp r0, #1
21 ; CHECK: it eq
21 ; CHECK: it ne
22 ; CHECK-NEXT: bxne lr
2223 %p = icmp eq i32 %x, 1
2324 br i1 %p, label %t, label %f
2425
3334 define void @f2(i32 %x) {
3435 ; CHECK-LABEL: f2:
3536 ; CHECK: cmp r0, #0
36 ; CHECK: it eq
37 ; CHECK: it ne
38 ; CHECK-NEXT: bxne lr
3739 %p = icmp eq i32 %x, 0
3840 br i1 %p, label %t, label %f
3941
7171 define void @t3(i32 %a, i32 %b) nounwind {
7272 entry:
7373 ; CHECK-LABEL: t3:
74 ; CHECK: itt ge
75 ; CHECK: movge r0, r1
76 ; CHECK: blge {{_?}}foo
74 ; CHECK: it lt
75 ; CHECK-NEXT: bxlt lr
76 ; CHECK: mov r0, r1
77 ; CHECK: bl {{_?}}foo
7778 %tmp1 = icmp sgt i32 %a, 10 ; [#uses=1]
7879 br i1 %tmp1, label %cond_true, label %UnifiedReturnBlock
7980
77 ; CHECK: it ne
88 ; CHECK: cmpne
99 ; CHECK: it hi
10 ; CHECK: pophi {r7, pc}
10 ; CHECK: bxhi lr
1111 %tmp1 = icmp ult i32 %X, 4 ; [#uses=1]
1212 %tmp4 = icmp eq i32 %Y, 0 ; [#uses=1]
1313 %tmp7 = or i1 %tmp4, %tmp1 ; [#uses=1]
6868 entry:
6969 ; CHECK-LABEL: t1:
7070 ; CHECK: it ne
71 ; CHECK: popne {r7, pc}
71 ; CHECK: bxne lr
7272 %tmp1 = icmp eq %struct.SString* %word, null ; [#uses=1]
7373 br i1 %tmp1, label %cond_true, label %cond_false
7474
88 ; CHECK-NEXT: b
99 ; CHECK: [[JUMPTARGET]]:{{.*}}%if.else173
1010 ; CHECK-NEXT: mov.w
11 ; CHECK-NEXT: pop
11 ; CHECK-NEXT: bx lr
1212 ; CHECK-NEXT: %if.else145
1313 ; CHECK-NEXT: mov.w
1414