mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-10 14:36:12 +00:00
ArgPromo: Bail out earlier for varargs functions
llvm-svn: 234224
This commit is contained in:
parent
a5e3c1760f
commit
95456c7ea7
@ -207,6 +207,13 @@ CallGraphNode *ArgPromotion::PromoteArguments(CallGraphNode *CGN) {
|
|||||||
// Make sure that it is local to this module.
|
// Make sure that it is local to this module.
|
||||||
if (!F || !F->hasLocalLinkage()) return nullptr;
|
if (!F || !F->hasLocalLinkage()) return nullptr;
|
||||||
|
|
||||||
|
// Don't promote arguments for variadic functions. Adding, removing, or
|
||||||
|
// changing non-pack parameters can change the classification of pack
|
||||||
|
// parameters. Frontends encode that classification at the call site in the
|
||||||
|
// IR, while in the callee the classification is determined dynamically based
|
||||||
|
// on the number of registers consumed so far.
|
||||||
|
if (F->isVarArg()) return nullptr;
|
||||||
|
|
||||||
// First check: see if there are any pointer arguments! If not, quick exit.
|
// First check: see if there are any pointer arguments! If not, quick exit.
|
||||||
SmallVector<Argument*, 16> PointerArgs;
|
SmallVector<Argument*, 16> PointerArgs;
|
||||||
for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end(); I != E; ++I)
|
for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end(); I != E; ++I)
|
||||||
@ -227,12 +234,6 @@ CallGraphNode *ArgPromotion::PromoteArguments(CallGraphNode *CGN) {
|
|||||||
isSelfRecursive = true;
|
isSelfRecursive = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Don't promote arguments for variadic functions. Adding, removing, or
|
|
||||||
// changing non-pack parameters can change the classification of pack
|
|
||||||
// parameters. Frontends encode that classification at the call site in the
|
|
||||||
// IR, while in the callee the classification is determined dynamically based
|
|
||||||
// on the number of registers consumed so far.
|
|
||||||
if (F->isVarArg()) return nullptr;
|
|
||||||
const DataLayout &DL = F->getParent()->getDataLayout();
|
const DataLayout &DL = F->getParent()->getDataLayout();
|
||||||
|
|
||||||
// Check to see which arguments are promotable. If an argument is promotable,
|
// Check to see which arguments are promotable. If an argument is promotable,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user