diff options
author | Reid Kleckner <reid@kleckner.net> | 2014-08-22 21:59:26 +0000 |
---|---|---|
committer | Reid Kleckner <reid@kleckner.net> | 2014-08-22 21:59:26 +0000 |
commit | 2d9bb65b3dee3d84a523f043b6059bce2a4a1032 (patch) | |
tree | a39fce08ce3ce54169beeb4149fc349c91e4fc5b /llvm/lib/CodeGen | |
parent | af74250ec00c8c324109e8513030e10b480c23a3 (diff) | |
download | bcm5719-llvm-2d9bb65b3dee3d84a523f043b6059bce2a4a1032.tar.gz bcm5719-llvm-2d9bb65b3dee3d84a523f043b6059bce2a4a1032.zip |
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.
llvm-svn: 216294
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp index 1c85248eb84..c9da6fd83ee 100644 --- a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp @@ -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)) |