1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 12:41:49 +01:00

Fix for 2006-06-26-MultipleExitsSingleBlock.

If a single exit block has multiple predecessors within the loop, it will
appear in the exit blocks list more than once.  LCSSA needs to take that into
account so that it doesn't double process that exit block.

llvm-svn: 28750
This commit is contained in:
Owen Anderson 2006-06-12 07:10:16 +00:00
parent 4796bc9bda
commit a947d699dd

View File

@ -155,13 +155,16 @@ void LCSSA::processInstruction(Instruction* Instr,
std::vector<PHINode*> workList;
for (std::vector<BasicBlock*>::const_iterator BBI = exitBlocks.begin(),
BBE = exitBlocks.end(); BBI != BBE; ++BBI)
if (DT->getNode(Instr->getParent())->dominates(DT->getNode(*BBI))) {
PHINode *phi = new PHINode(Instr->getType(), Instr->getName()+".lcssa",
BBE = exitBlocks.end(); BBI != BBE; ++BBI) {
Instruction*& phi = Phis[*BBI];
if (phi == 0 &&
DT->getNode(Instr->getParent())->dominates(DT->getNode(*BBI))) {
phi = new PHINode(Instr->getType(), Instr->getName()+".lcssa",
(*BBI)->begin());
workList.push_back(phi);
workList.push_back(cast<PHINode>(phi));
Phis[*BBI] = phi;
}
}
// Phi nodes that need to have their incoming values filled.
std::vector<PHINode*> needIncomingValues;