Tail call optimisation was previously disabled on all targets other than
iOS5.0+. This enables the tail call optimisation on all Thumb 2 capable
platforms.
The test adjustments are to remove the IR hint "tail" to function invocation.
The tests were designed assuming that tail call optimisations would not kick in
which no longer holds true.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203575
91177308-0d34-0410-b5e6-
96231b3b80d8
if (isTargetMachO()) {
IsR9Reserved = ReserveR9 | !HasV6Ops;
SupportsTailCall = !isTargetIOS() || !getTargetTriple().isOSVersionLT(5, 0);
- } else
+ } else {
IsR9Reserved = ReserveR9;
+ SupportsTailCall = !isThumb1Only();
+ }
if (!isThumb() || hasThumb2())
PostRAScheduler = true;
double %p8, ; --> Stack
i32 %p9) #0 { ; --> R0, not Stack+8
entry:
- tail call void @fooUseI32(i32 %p9)
+ call void @fooUseI32(i32 %p9)
ret void
}
; CHECK: pop {r11, lr}
; CHECK: add sp, sp, #16
- tail call void @useLong(i64 %c)
+ call void @useLong(i64 %c)
ret void
}
; CHECK: pop {r11, lr}
; CHECK: add sp, sp, #8
- tail call void @usePtr(%struct8bytes8align* %b)
+ call void @usePtr(%struct8bytes8align* %b)
ret void
}
; CHECK: pop {r11, lr}
; CHECK: add sp, sp, #16
- tail call void @usePtr(%struct8bytes8align* %a)
+ call void @usePtr(%struct8bytes8align* %a)
ret void
}
; CHECK: add sp, sp, #16
; CHECK: mov pc, lr
- tail call void @usePtr(%struct8bytes8align* %b)
+ call void @usePtr(%struct8bytes8align* %b)
ret void
}
; CHECK: add sp, sp, #16
; CHECK: mov pc, lr
- tail call void @usePtr(%struct8bytes8align* %a)
+ call void @usePtr(%struct8bytes8align* %a)
ret void
}
; CHECK: pop {r11, lr}
; CHECK: mov pc, lr
- tail call void @usePtr(%struct8bytes8align* %d)
+ call void @usePtr(%struct8bytes8align* %d)
ret void
}
define void @test2() {
entry:
- tail call void @throw_exception_2()
+ call void @throw_exception_2()
ret void
}
define void @test2() {
entry:
- tail call void @throw_exception_2()
+ call void @throw_exception_2()
ret void
}
-; RUN: llc < %s -mtriple=armv7-none-linux-gnueabi -mattr=+v7,+vfp3,-neon | FileCheck %s
+; RUN: llc < %s -mtriple=armv7-none-linux-gnueabi -mattr=+v7,+vfp3,-neon | FileCheck %s
; PR15611. Check that we don't crash when constant folding v1i32 types.
%tmp3 = insertelement <4 x i32> %tmp2, i32 0, i32 3
%tmp4 = add <4 x i32> %tmp3, <i32 -1, i32 -1, i32 -1, i32 -1>
; CHECK: bl bar
- tail call void @bar(<4 x i32> %tmp4)
+ call void @bar(<4 x i32> %tmp4)
ret void
}