llvm.org GIT mirror llvm / 6d2f9ce
Reenable tail calls for iOS 5.0 and later. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141370 91177308-0d34-0410-b5e6-96231b3b80d8 Bob Wilson 8 years ago
4 changed file(s) with 15 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
12211221 MachineFunction &MF = DAG.getMachineFunction();
12221222 bool IsStructRet = (Outs.empty()) ? false : Outs[0].Flags.isSRet();
12231223 bool IsSibCall = false;
1224 // Temporarily disable tail calls so things don't break.
1225 if (!EnableARMTailCalls)
1224 // Disable tail calls if they're not supported.
1225 if (!EnableARMTailCalls && !Subtarget->supportsTailCall())
12261226 isTailCall = false;
12271227 if (isTailCall) {
12281228 // Check if it's really possible to do a tail call.
5959 , PostRAScheduler(false)
6060 , IsR9Reserved(ReserveR9)
6161 , UseMovt(false)
62 , SupportsTailCall(false)
6263 , HasFP16(false)
6364 , HasD16(false)
6465 , HasHardwareDivide(false)
112113 else {
113114 IsR9Reserved = ReserveR9 | !HasV6Ops;
114115 UseMovt = DarwinUseMOVT && hasV6T2Ops();
116 const Triple &T = getTargetTriple();
117 SupportsTailCall = T.getOS() == Triple::IOS && !T.isOSVersionLT(5, 0);
115118 }
116119
117120 if (!isThumb() || hasThumb2())
9191 /// UseMovt - True if MOVT / MOVW pairs are used for materialization of 32-bit
9292 /// imms (including global addresses).
9393 bool UseMovt;
94
95 /// SupportsTailCall - True if the OS supports tail call. The dynamic linker
96 /// must be able to synthesize call stubs for interworking between ARM and
97 /// Thumb.
98 bool SupportsTailCall;
9499
95100 /// HasFP16 - True if subtarget supports half-precision FP (We support VFP+HF
96101 /// only so far)
233238 bool isR9Reserved() const { return IsR9Reserved; }
234239
235240 bool useMovt() const { return UseMovt && hasV6T2Ops(); }
241 bool supportsTailCall() const { return SupportsTailCall; }
236242
237243 bool allowsUnalignedMem() const { return AllowsUnalignedMem; }
238244
0 ; RUN: llc < %s -mtriple=armv6-apple-darwin -mattr=+vfp2 -arm-tail-calls | FileCheck %s -check-prefix=CHECKV6
11 ; RUN: llc < %s -mtriple=armv6-linux-gnueabi -relocation-model=pic -mattr=+vfp2 -arm-tail-calls | FileCheck %s -check-prefix=CHECKELF
22 ; RUN: llc < %s -mtriple=thumbv7-apple-darwin -arm-tail-calls | FileCheck %s -check-prefix=CHECKT2D
3 ; RUN: llc < %s -mtriple=thumbv7-apple-ios5.0 | FileCheck %s -check-prefix=CHECKT2D
4
5 ; Enable tailcall optimization for iOS 5.0
6 ; rdar://9120031
37
48 @t = weak global i32 ()* null ; [#uses=1]
59