mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
Implement optimization for direct function call case. This dramatically
reduces the number of function nodes created and speeds up analysis by about 10% overall. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5495 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -163,8 +163,12 @@ bool Steens::run(Module &M) {
|
||||
DSCallSite &CurCall = Calls[i];
|
||||
|
||||
// Loop over the called functions, eliminating as many as possible...
|
||||
std::vector<GlobalValue*> CallTargets =
|
||||
CurCall.getCallee().getNode()->getGlobals();
|
||||
std::vector<GlobalValue*> CallTargets;
|
||||
if (CurCall.isDirectCall())
|
||||
CallTargets.push_back(CurCall.getCalleeFunc());
|
||||
else
|
||||
CallTargets = CurCall.getCalleeNode()->getGlobals();
|
||||
|
||||
for (unsigned c = 0; c != CallTargets.size(); ) {
|
||||
// If we can eliminate this function call, do so!
|
||||
bool Eliminated = false;
|
||||
|
Reference in New Issue
Block a user