forked from OSchip/llvm-project
Revert "[CodeGenPrepare] Scan past debug intrinsics to find select candidates (NFC)"
This causes crashes due to the interleaved dbg.value intrinsics being left at the end of basic blocks, causing the actual terminators (br, etc) to be not where they should be (not at the end of the block), leading to later crashes. Further discussion on the original commit thread. This reverts commit r340368. llvm-svn: 340794
This commit is contained in:
parent
6a9aa02ff3
commit
7d30653259
|
@ -5602,10 +5602,9 @@ bool CodeGenPrepare::optimizeSelectInst(SelectInst *SI) {
|
|||
// Find all consecutive select instructions that share the same condition.
|
||||
SmallVector<SelectInst *, 2> ASI;
|
||||
ASI.push_back(SI);
|
||||
for (Instruction *NextInst = SI->getNextNonDebugInstruction();
|
||||
NextInst != SI->getParent()->getTerminator();
|
||||
NextInst = NextInst->getNextNonDebugInstruction()) {
|
||||
SelectInst *I = dyn_cast<SelectInst>(NextInst);
|
||||
for (BasicBlock::iterator It = ++BasicBlock::iterator(SI);
|
||||
It != SI->getParent()->end(); ++It) {
|
||||
SelectInst *I = dyn_cast<SelectInst>(&*It);
|
||||
if (I && SI->getCondition() == I->getCondition()) {
|
||||
ASI.push_back(I);
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue