Lines Matching refs:Function
13 // argument is *only* loaded, then it can pass the value into the function
18 // This pass also handles aggregate arguments that are passed into a function,
21 // more than three operands to the function, because passing thousands of
79 CallGraphNode *DoPromotion(Function *F,
117 /// PromoteArguments - This method checks the specified function to see if there
118 /// are any promotable arguments and if it is safe to promote the function (for
123 Function *F = CGN->getFunction();
131 for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end();
138 // transform functions that have indirect callers. Also see if the function
168 << " than " << maxElements << " arguments to the function.\n");
192 // function, we could end up infinitely peeling the function argument.
220 /// all callees pass in a valid pointer for the specified function argument.
222 Function *Callee = Arg->getParent();
225 Function::arg_iterator(Arg));
227 // Look at all call sites of the function. At this pointer we know we only
435 << "than " << maxElements << " arguments to the function.\n");
449 // the function to each of the load instructions.
480 // If the path from the entry of the function to each load is free of
487 /// arguments, and returns the new function. At this point, we know that it's
489 CallGraphNode *ArgPromotion::DoPromotion(Function *F,
493 // Start by computing a new prototype for the function, which is the same as
494 // the old function, but has modified arguments.
510 // original function so that we can tell the alias analysis implementation
527 for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end(); I != E;
580 // Add a parameter to the function for each element passed in.
595 // Add any function attributes.
602 // Construct the new function type using the new arguments.
605 // Create the new function body and insert it into the module.
606 Function *NF = Function::Create(NFTy, F->getLinkage(), F->getName());
614 // the function.
632 // Loop over all of the callers of the function, transforming the call sites
651 for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end();
726 // Add any function attributes.
767 // Since we have now created the new function, splice the body of the old
768 // function right into the new function, leaving the old rotting hulk of the
769 // function empty.
775 for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end(),
835 << "' in function '" << F->getName() << "'\n");
848 Function::arg_iterator TheArg = I2;
862 << "' of function '" << NF->getName() << "'\n");
881 // Tell the alias analysis that the old function is about to disappear.
887 // Now that the old function is dead, delete it. If there is a dangling
888 // reference to the CallgraphNode, just leave the dead function around for
894 F->setLinkage(Function::ExternalLinkage);