mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-12 13:38:21 +00:00
LoopSimplify shouldn't split loop backedges that use indirectbr. PR7867.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111061 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -622,6 +622,11 @@ LoopSimplify::InsertUniqueBackedgeBlock(Loop *L, BasicBlock *Preheader) {
|
||||
std::vector<BasicBlock*> BackedgeBlocks;
|
||||
for (pred_iterator I = pred_begin(Header), E = pred_end(Header); I != E; ++I){
|
||||
BasicBlock *P = *I;
|
||||
|
||||
// Indirectbr edges cannot be split, so we must fail if we find one.
|
||||
if (isa<IndirectBrInst>(P->getTerminator()))
|
||||
return 0;
|
||||
|
||||
if (P != Preheader) BackedgeBlocks.push_back(P);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user