mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-01 08:28:19 +00:00
Disable PRE for landing pads.
PRE needs the landing pads to have their critical edges split. Doing this for a landing pad is non-trivial. Abandon the attempt to perform PRE when we come across a landing pad. (Reviewed by Owen!) llvm-svn: 137876
This commit is contained in:
parent
2b25bb15ec
commit
fa8d0e1aea
@ -1446,8 +1446,8 @@ bool GVN::processNonLocalLoad(LoadInst *LI) {
|
|||||||
for (unsigned i = 0, e = UnavailableBlocks.size(); i != e; ++i)
|
for (unsigned i = 0, e = UnavailableBlocks.size(); i != e; ++i)
|
||||||
Blockers.insert(UnavailableBlocks[i]);
|
Blockers.insert(UnavailableBlocks[i]);
|
||||||
|
|
||||||
// Lets find first basic block with more than one predecessor. Walk backwards
|
// Let's find the first basic block with more than one predecessor. Walk
|
||||||
// through predecessors if needed.
|
// backwards through predecessors if needed.
|
||||||
BasicBlock *LoadBB = LI->getParent();
|
BasicBlock *LoadBB = LI->getParent();
|
||||||
BasicBlock *TmpBB = LoadBB;
|
BasicBlock *TmpBB = LoadBB;
|
||||||
|
|
||||||
@ -1519,10 +1519,19 @@ bool GVN::processNonLocalLoad(LoadInst *LI) {
|
|||||||
<< Pred->getName() << "': " << *LI << '\n');
|
<< Pred->getName() << "': " << *LI << '\n');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (LoadBB->isLandingPad()) {
|
||||||
|
DEBUG(dbgs()
|
||||||
|
<< "COULD NOT PRE LOAD BECAUSE OF LANDING PAD CRITICAL EDGE '"
|
||||||
|
<< Pred->getName() << "': " << *LI << '\n');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
unsigned SuccNum = GetSuccessorNumber(Pred, LoadBB);
|
unsigned SuccNum = GetSuccessorNumber(Pred, LoadBB);
|
||||||
NeedToSplit.push_back(std::make_pair(Pred->getTerminator(), SuccNum));
|
NeedToSplit.push_back(std::make_pair(Pred->getTerminator(), SuccNum));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!NeedToSplit.empty()) {
|
if (!NeedToSplit.empty()) {
|
||||||
toSplit.append(NeedToSplit.begin(), NeedToSplit.end());
|
toSplit.append(NeedToSplit.begin(), NeedToSplit.end());
|
||||||
return false;
|
return false;
|
||||||
@ -2071,6 +2080,9 @@ bool GVN::performPRE(Function &F) {
|
|||||||
// Nothing to PRE in the entry block.
|
// Nothing to PRE in the entry block.
|
||||||
if (CurrentBlock == &F.getEntryBlock()) continue;
|
if (CurrentBlock == &F.getEntryBlock()) continue;
|
||||||
|
|
||||||
|
// Don't perform PRE on a landing pad.
|
||||||
|
if (CurrentBlock->isLandingPad()) continue;
|
||||||
|
|
||||||
for (BasicBlock::iterator BI = CurrentBlock->begin(),
|
for (BasicBlock::iterator BI = CurrentBlock->begin(),
|
||||||
BE = CurrentBlock->end(); BI != BE; ) {
|
BE = CurrentBlock->end(); BI != BE; ) {
|
||||||
Instruction *CurInst = BI++;
|
Instruction *CurInst = BI++;
|
||||||
|
Loading…
Reference in New Issue
Block a user