mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-25 21:18:19 +00:00
ARM / x86_64 varargs: Don't save regparms in prologue without va_start
There's no need to do this if the user doesn't call va_start. In the future, we're going to have thunks that forward these register parameters with musttail calls, and they won't need these spills for handling va_start. Most of the test suite changes are adding va_start calls to existing tests to keep things working. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216294 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -138,6 +138,14 @@ void FunctionLoweringInfo::set(const Function &fn, MachineFunction &mf,
|
||||
}
|
||||
}
|
||||
|
||||
// Look for calls to the @llvm.va_start intrinsic. We can omit some
|
||||
// prologue boilerplate for variadic functions that don't examine their
|
||||
// arguments.
|
||||
if (const auto *II = dyn_cast<IntrinsicInst>(I)) {
|
||||
if (II->getIntrinsicID() == Intrinsic::vastart)
|
||||
MF->getFrameInfo()->setHasVAStart(true);
|
||||
}
|
||||
|
||||
// Mark values used outside their block as exported, by allocating
|
||||
// a virtual register for them.
|
||||
if (isUsedOutsideOfDefiningBlock(I))
|
||||
|
||||
Reference in New Issue
Block a user