mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
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
This commit is contained in:
parent
6da12e6767
commit
0ca2f28458
@ -176,14 +176,13 @@ public:
|
|||||||
/// get copied into the caller.
|
/// get copied into the caller.
|
||||||
SmallVector<AllocaInst*, 4> StaticAllocas;
|
SmallVector<AllocaInst*, 4> StaticAllocas;
|
||||||
|
|
||||||
/// DevirtualizedCalls - InlineFunction fills this in with callsites that were
|
/// InlinedCalls - InlineFunction fills this in with callsites that were
|
||||||
/// inlined from the callee that went from being indirect calls to direct
|
/// inlined from the callee. This is only filled in if CG is non-null.
|
||||||
/// calls due to inlining. This is only filled in if CG is non-null.
|
SmallVector<WeakVH, 8> InlinedCalls;
|
||||||
SmallVector<WeakVH, 2> DevirtualizedCalls;
|
|
||||||
|
|
||||||
void reset() {
|
void reset() {
|
||||||
StaticAllocas.clear();
|
StaticAllocas.clear();
|
||||||
DevirtualizedCalls.clear();
|
InlinedCalls.clear();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -420,17 +420,17 @@ bool Inliner::runOnSCC(CallGraphSCC &SCC) {
|
|||||||
continue;
|
continue;
|
||||||
++NumInlined;
|
++NumInlined;
|
||||||
|
|
||||||
// If inlining this function devirtualized any call sites, throw them
|
// If inlining this function gave us any new call sites, throw them
|
||||||
// onto our worklist to process. They are useful inline candidates.
|
// onto our worklist to process. They are useful inline candidates.
|
||||||
if (!InlineInfo.DevirtualizedCalls.empty()) {
|
if (!InlineInfo.InlinedCalls.empty()) {
|
||||||
// Create a new inline history entry for this, so that we remember
|
// Create a new inline history entry for this, so that we remember
|
||||||
// that these new callsites came about due to inlining Callee.
|
// that these new callsites came about due to inlining Callee.
|
||||||
int NewHistoryID = InlineHistory.size();
|
int NewHistoryID = InlineHistory.size();
|
||||||
InlineHistory.push_back(std::make_pair(Callee, InlineHistoryID));
|
InlineHistory.push_back(std::make_pair(Callee, InlineHistoryID));
|
||||||
|
|
||||||
for (unsigned i = 0, e = InlineInfo.DevirtualizedCalls.size();
|
for (unsigned i = 0, e = InlineInfo.InlinedCalls.size();
|
||||||
i != e; ++i) {
|
i != e; ++i) {
|
||||||
Value *Ptr = InlineInfo.DevirtualizedCalls[i];
|
Value *Ptr = InlineInfo.InlinedCalls[i];
|
||||||
CallSites.push_back(std::make_pair(CallSite(Ptr), NewHistoryID));
|
CallSites.push_back(std::make_pair(CallSite(Ptr), NewHistoryID));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -201,7 +201,11 @@ static void UpdateCallGraphAfterInlining(CallSite CS,
|
|||||||
// add. Check for this case.
|
// add. Check for this case.
|
||||||
Instruction *NewCall = dyn_cast<Instruction>(VMI->second);
|
Instruction *NewCall = dyn_cast<Instruction>(VMI->second);
|
||||||
if (NewCall == 0) continue;
|
if (NewCall == 0) continue;
|
||||||
|
|
||||||
|
// Remember that this call site got inlined for the client of
|
||||||
|
// InlineFunction.
|
||||||
|
IFI.InlinedCalls.push_back(NewCall);
|
||||||
|
|
||||||
// It's possible that inlining the callsite will cause it to go from an
|
// It's possible that inlining the callsite will cause it to go from an
|
||||||
// indirect to a direct call by resolving a function pointer. If this
|
// indirect to a direct call by resolving a function pointer. If this
|
||||||
// happens, set the callee of the new call site to a more precise
|
// happens, set the callee of the new call site to a more precise
|
||||||
@ -212,14 +216,10 @@ static void UpdateCallGraphAfterInlining(CallSite CS,
|
|||||||
// Indirect call site resolved to direct call.
|
// Indirect call site resolved to direct call.
|
||||||
CallerNode->addCalledFunction(CallSite::get(NewCall), CG[F]);
|
CallerNode->addCalledFunction(CallSite::get(NewCall), CG[F]);
|
||||||
|
|
||||||
// Remember that this callsite got devirtualized for the client of
|
|
||||||
// InlineFunction.
|
|
||||||
IFI.DevirtualizedCalls.push_back(NewCall);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
CallerNode->addCalledFunction(CallSite::get(NewCall), I->second);
|
CallerNode->addCalledFunction(CallSite::get(NewCall), I->second);
|
||||||
IFI.DevirtualizedCalls.push_back(NewCall);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update the call graph by deleting the edge from Callee to Caller. We must
|
// Update the call graph by deleting the edge from Callee to Caller. We must
|
||||||
|
Loading…
Reference in New Issue
Block a user