mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-19 04:32:19 +00:00
Minor optimization efficiency improvement:
- Run mem2reg promotion first - Only rerun passes if the previous thing changed something git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8490 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
37f92e2568
commit
fe7ea0da17
@ -58,12 +58,14 @@ Pass *createScalarReplAggregatesPass() { return new SROA(); }
|
|||||||
|
|
||||||
|
|
||||||
bool SROA::runOnFunction(Function &F) {
|
bool SROA::runOnFunction(Function &F) {
|
||||||
bool Changed = false, LocalChange;
|
bool Changed = performPromotion(F);
|
||||||
do {
|
while (1) {
|
||||||
LocalChange = performScalarRepl(F);
|
bool LocalChange = performScalarRepl(F);
|
||||||
LocalChange |= performPromotion(F);
|
if (!LocalChange) break; // No need to repromote if no scalarrepl
|
||||||
Changed |= LocalChange;
|
Changed = true;
|
||||||
} while (LocalChange);
|
LocalChange = performPromotion(F);
|
||||||
|
if (!LocalChange) break; // No need to re-scalarrepl if no promotion
|
||||||
|
}
|
||||||
|
|
||||||
return Changed;
|
return Changed;
|
||||||
}
|
}
|
||||||
@ -75,7 +77,7 @@ bool SROA::performPromotion(Function &F) {
|
|||||||
|
|
||||||
BasicBlock &BB = F.getEntryNode(); // Get the entry node for the function
|
BasicBlock &BB = F.getEntryNode(); // Get the entry node for the function
|
||||||
|
|
||||||
bool Changed = false;
|
bool Changed = false;
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
Allocas.clear();
|
Allocas.clear();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user