mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-29 07:36:06 +00:00
Fix a bug that was causing major slowdowns in povray. This was due to LCSSA
not handling PHI nodes correctly when determining if a value was live-out. This patch reduces the number of detected live-out variables in the testcase from 6565 to 485. llvm-svn: 28771
This commit is contained in:
parent
f570feeae3
commit
3f8ff0449a
@ -91,6 +91,7 @@ const PassInfo *llvm::LCSSAID = X.getPassInfo();
|
||||
/// runOnFunction - Process all loops in the function, inner-most out.
|
||||
bool LCSSA::runOnFunction(Function &F) {
|
||||
bool changed = false;
|
||||
|
||||
LI = &getAnalysis<LoopInfo>();
|
||||
DF = &getAnalysis<DominanceFrontier>();
|
||||
DT = &getAnalysis<DominatorTree>();
|
||||
@ -162,7 +163,6 @@ void LCSSA::processInstruction(Instruction* Instr,
|
||||
phi = new PHINode(Instr->getType(), Instr->getName()+".lcssa",
|
||||
(*BBI)->begin());
|
||||
workList.push_back(cast<PHINode>(phi));
|
||||
Phis[*BBI] = phi;
|
||||
}
|
||||
}
|
||||
|
||||
@ -253,6 +253,11 @@ SetVector<Instruction*> LCSSA::getLoopValuesUsedOutsideLoop(Loop *L) {
|
||||
for (Value::use_iterator UI = I->use_begin(), E = I->use_end(); UI != E;
|
||||
++UI) {
|
||||
BasicBlock *UserBB = cast<Instruction>(*UI)->getParent();
|
||||
if (PHINode* p = dyn_cast<PHINode>(*UI)) {
|
||||
unsigned OperandNo = UI.getOperandNo();
|
||||
UserBB = p->getIncomingBlock(OperandNo/2);
|
||||
}
|
||||
|
||||
if (!inLoop(UserBB)) {
|
||||
AffectedValues.insert(I);
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user