Fix an issue where phiMap was not being updated properly when doing load PRE.

Diagnosis and patch thanks to Jakub Staszak.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72562 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Owen Anderson 2009-05-29 05:37:54 +00:00
parent abdbc57abb
commit 246ddf55d1

View File

@ -1125,6 +1125,11 @@ bool GVN::processNonLocalLoad(LoadInst *LI,
LI->getAlignment(),
UnavailablePred->getTerminator());
SmallPtrSet<Instruction*, 4> &p = phiMap[LI->getPointerOperand()];
for (SmallPtrSet<Instruction*, 4>::iterator I = p.begin(), E = p.end();
I != E; ++I)
ValuesPerBlock.push_back(std::make_pair((*I)->getParent(), *I));
DenseMap<BasicBlock*, Value*> BlockReplValues;
BlockReplValues.insert(ValuesPerBlock.begin(), ValuesPerBlock.end());
BlockReplValues[UnavailablePred] = NewLoad;