forked from OSchip/llvm-project
Fix an issue where phiMap was not being updated properly when doing load PRE.
Diagnosis and patch thanks to Jakub Staszak. llvm-svn: 72562
This commit is contained in:
parent
87b037168e
commit
04cfdd38a2
|
@ -1125,6 +1125,11 @@ bool GVN::processNonLocalLoad(LoadInst *LI,
|
||||||
LI->getAlignment(),
|
LI->getAlignment(),
|
||||||
UnavailablePred->getTerminator());
|
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;
|
DenseMap<BasicBlock*, Value*> BlockReplValues;
|
||||||
BlockReplValues.insert(ValuesPerBlock.begin(), ValuesPerBlock.end());
|
BlockReplValues.insert(ValuesPerBlock.begin(), ValuesPerBlock.end());
|
||||||
BlockReplValues[UnavailablePred] = NewLoad;
|
BlockReplValues[UnavailablePred] = NewLoad;
|
||||||
|
|
Loading…
Reference in New Issue