llvm.org GIT mirror llvm / 0ca2f28
rename InlineInfo.DevirtualizedCalls -> InlinedCalls to reflect that it includes all inlined calls now, not just devirtualized ones. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102824 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 10 years ago
3 changed file(s) with 13 addition(s) and 14 deletion(s). Raw diff Collapse all Expand all
175175 /// get copied into the caller.
176176 SmallVector StaticAllocas;
177177
178 /// DevirtualizedCalls - InlineFunction fills this in with callsites that were
179 /// inlined from the callee that went from being indirect calls to direct
180 /// calls due to inlining. This is only filled in if CG is non-null.
181 SmallVector DevirtualizedCalls;
178 /// InlinedCalls - InlineFunction fills this in with callsites that were
179 /// inlined from the callee. This is only filled in if CG is non-null.
180 SmallVector InlinedCalls;
182181
183182 void reset() {
184183 StaticAllocas.clear();
185 DevirtualizedCalls.clear();
184 InlinedCalls.clear();
186185 }
187186 };
188187
419419 continue;
420420 ++NumInlined;
421421
422 // If inlining this function devirtualized any call sites, throw them
422 // If inlining this function gave us any new call sites, throw them
423423 // onto our worklist to process. They are useful inline candidates.
424 if (!InlineInfo.DevirtualizedCalls.empty()) {
424 if (!InlineInfo.InlinedCalls.empty()) {
425425 // Create a new inline history entry for this, so that we remember
426426 // that these new callsites came about due to inlining Callee.
427427 int NewHistoryID = InlineHistory.size();
428428 InlineHistory.push_back(std::make_pair(Callee, InlineHistoryID));
429429
430 for (unsigned i = 0, e = InlineInfo.DevirtualizedCalls.size();
430 for (unsigned i = 0, e = InlineInfo.InlinedCalls.size();
431431 i != e; ++i) {
432 Value *Ptr = InlineInfo.DevirtualizedCalls[i];
432 Value *Ptr = InlineInfo.InlinedCalls[i];
433433 CallSites.push_back(std::make_pair(CallSite(Ptr), NewHistoryID));
434434 }
435435 }
200200 // add. Check for this case.
201201 Instruction *NewCall = dyn_cast(VMI->second);
202202 if (NewCall == 0) continue;
203
203
204 // Remember that this call site got inlined for the client of
205 // InlineFunction.
206 IFI.InlinedCalls.push_back(NewCall);
207
204208 // It's possible that inlining the callsite will cause it to go from an
205209 // indirect to a direct call by resolving a function pointer. If this
206210 // happens, set the callee of the new call site to a more precise
211215 // Indirect call site resolved to direct call.
212216 CallerNode->addCalledFunction(CallSite::get(NewCall), CG[F]);
213217
214 // Remember that this callsite got devirtualized for the client of
215 // InlineFunction.
216 IFI.DevirtualizedCalls.push_back(NewCall);
217218 continue;
218219 }
219220
220221 CallerNode->addCalledFunction(CallSite::get(NewCall), I->second);
221 IFI.DevirtualizedCalls.push_back(NewCall);
222222 }
223223
224224 // Update the call graph by deleting the edge from Callee to Caller. We must