llvm.org GIT mirror llvm / dd77fb6
Merge 99620 from mainline. Do not sibcall if stack needs to be dynamically aligned. git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_27@99955 91177308-0d34-0410-b5e6-96231b3b80d8 Tanya Lattner 10 years ago
2 changed file(s) with 19 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
23062306 return false;
23072307
23082308 // If -tailcallopt is specified, make fastcc functions tail-callable.
2309 const MachineFunction &MF = DAG.getMachineFunction();
23092310 const Function *CallerF = DAG.getMachineFunction().getFunction();
23102311 if (GuaranteedTailCallOpt) {
23112312 if (IsTailCallConvention(CalleeCC) &&
23162317
23172318 // Look for obvious safe cases to perform tail call optimization that does not
23182319 // requite ABI changes. This is what gcc calls sibcall.
2320
2321 // Can't do sibcall if stack needs to be dynamically re-aligned. PEI needs to
2322 // emit a special epilogue.
2323 if (RegInfo->needsStackRealignment(MF))
2324 return false;
23192325
23202326 // Do not sibcall optimize vararg calls for now.
23212327 if (isVarArg)
215215 }
216216
217217 declare fastcc %struct.ns* @foo7(%struct.cp* byval align 4, i8 signext) nounwind ssp
218
219
220
221 define void @t19() alignstack(32) nounwind {
222 entry:
223 ; CHECK: t19:
224 ; CHECK: andl $-32
225 ; CHECK: call {{_?}}foo
226 tail call void @foo() nounwind
227 ret void
228 }
229
230 declare void @foo()