Lines Matching refs:Function
173 /// value out of a function, it will have an entry in this map, indicating
174 /// what the known return value for the function is.
175 DenseMap<Function*, LatticeVal> TrackedRetVals;
179 DenseMap<std::pair<Function*, unsigned>, LatticeVal> TrackedMultipleRetVals;
181 /// MRVFunctionsTracked - Each function in TrackedMultipleRetVals is
183 SmallPtrSet<Function*, 16> MRVFunctionsTracked;
188 SmallPtrSet<Function*, 16> TrackingIncomingArguments;
236 /// and out of the specified function (which cannot have its address taken),
238 void AddTrackedFunction(Function *F) {
249 void AddArgumentTrackedFunction(Function *F) {
257 /// ResolvedUndefsIn - While solving the dataflow for a function, we assume
262 bool ResolvedUndefsIn(Function &F);
276 const DenseMap<Function*, LatticeVal> &getTrackedRetVals() {
339 if (Function *F = dyn_cast<Function>(V))
340 dbgs() << "Function '" << F->getName() << "'\n";
365 /// value. This function handles the case when the value hasn't been seen yet
388 /// value/field pair. This function handles the case when the value hasn't
709 Function *F = I.getParent()->getParent();
712 // If we are tracking the return value of this function, merge it in.
714 DenseMap<Function*, LatticeVal>::iterator TFRVI =
1079 Function *F = CS.getCalledFunction();
1090 // Otherwise, if we have a single return value case, and if the function is
1118 // If this is a local function that doesn't have its address taken, mark its
1120 // the formal arguments of the function.
1126 for (Function::arg_iterator AI = F->arg_begin(), E = F->arg_end();
1128 // If this argument is byval, and if the function is not readonly, there
1146 // If this is a single/zero retval case, see if we're tracking the function.
1151 // If we are tracking this callee, propagate the result of the function
1157 DenseMap<Function*, LatticeVal>::iterator TFRVI = TrackedRetVals.find(F);
1224 /// ResolvedUndefsIn - While solving the dataflow for a function, we assume
1242 bool SCCPSolver::ResolvedUndefsIn(Function &F) {
1243 for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB) {
1256 if (Function *F = CS.getCalledFunction())
1430 if (Function *F = CallSite(I).getCalledFunction())
1498 /// SCCP Class - This class uses the SCCPSolver to implement a per-function
1511 // algorithm, and return true if the function was modified.
1513 bool runOnFunction(Function &F);
1553 // and return true if the function was modified.
1555 bool SCCP::runOnFunction(Function &F) {
1556 DEBUG(dbgs() << "SCCP on function '" << F.getName() << "'\n");
1561 // Mark the first block of the function as being executable.
1564 // Mark all arguments to the function as being overdefined.
1565 for (Function::arg_iterator AI = F.arg_begin(), E = F.arg_end(); AI != E;++AI)
1578 // If we decided that there are basic blocks that are dead in this function,
1580 // as we cannot modify the CFG of the function.
1582 for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB) {
1589 // Iterate over all of the instructions in a function, replacing them with
1668 // Make sure we are calling the function, not passing the address.
1676 // blockaddress doesn't take the address of the function, it takes addr
1695 SmallPtrSet<Function*, 32> AddressTakenFunctions;
1704 // If this is a strong or ODR definition of this function, then we can
1709 // If this function only has direct calls that we can see, we can track its
1721 // Assume the function is called.
1725 for (Function::arg_iterator AI = F->arg_begin(), E = F->arg_end();
1758 for (Function::arg_iterator AI = F->arg_begin(), E = F->arg_end();
1779 for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB) {
1831 // Now that all instructions in the function are constant folded, erase dead
1882 // If we inferred constant or undef return values for a function, we replaced
1884 // actually returning anything from the function. Replace all return
1889 // if the address of the function isn't taken. In cases where a return is the
1890 // last use of a function, the order of processing functions would affect
1895 const DenseMap<Function*, LatticeVal> &RV = Solver.getTrackedRetVals();
1896 for (DenseMap<Function*, LatticeVal>::const_iterator I = RV.begin(),
1898 Function *F = I->first;
1902 // We can only do this if we know that nothing else can call the function.
1906 for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB)
1914 Function *F = ReturnsToZap[i]->getParent()->getParent();