Teach LSR to avoid calling SplitCriticalEdge on edges with indirectbr.

llvm-svn: 86193
This commit is contained in:
Dan Gohman 2009-11-05 23:34:59 +00:00
parent 98693a3ac2
commit a1bf0c0acc
1 changed files with 1 additions and 0 deletions

View File

@ -490,6 +490,7 @@ void BasedUser::RewriteInstructionToUseNewBase(const SCEV *const &NewBase,
// is the canonical backedge for this loop, as this can make some
// inserted code be in an illegal position.
if (e != 1 && PHIPred->getTerminator()->getNumSuccessors() > 1 &&
!isa<IndirectBrInst>(PHIPred->getTerminator()) &&
(PN->getParent() != L->getHeader() || !L->contains(PHIPred))) {
// First step, split the critical edge.