mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-19 03:24:09 +00:00
Revamp PredIteratorCache interface to be cleaner.
Summary: This lets us use range based for loops. Reviewers: chandlerc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9169 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235416 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -112,17 +112,17 @@ static bool processInstruction(Loop &L, Instruction &Inst, DominatorTree &DT,
|
||||
if (SSAUpdate.HasValueForBlock(ExitBB))
|
||||
continue;
|
||||
|
||||
PHINode *PN = PHINode::Create(Inst.getType(), PredCache.GetNumPreds(ExitBB),
|
||||
PHINode *PN = PHINode::Create(Inst.getType(), PredCache.size(ExitBB),
|
||||
Inst.getName() + ".lcssa", ExitBB->begin());
|
||||
|
||||
// Add inputs from inside the loop for this PHI.
|
||||
for (BasicBlock **PI = PredCache.GetPreds(ExitBB); *PI; ++PI) {
|
||||
PN->addIncoming(&Inst, *PI);
|
||||
for (BasicBlock *Pred : PredCache.get(ExitBB)) {
|
||||
PN->addIncoming(&Inst, Pred);
|
||||
|
||||
// If the exit block has a predecessor not within the loop, arrange for
|
||||
// the incoming value use corresponding to that predecessor to be
|
||||
// rewritten in terms of a different LCSSA PHI.
|
||||
if (!L.contains(*PI))
|
||||
if (!L.contains(Pred))
|
||||
UsesToRewrite.push_back(
|
||||
&PN->getOperandUse(PN->getOperandNumForIncomingValue(
|
||||
PN->getNumIncomingValues() - 1)));
|
||||
|
Reference in New Issue
Block a user