Teach LSR to avoid calling SplitCriticalEdge on edges with indirectbr.
authorDan Gohman <gohman@apple.com>
Thu, 5 Nov 2009 23:34:59 +0000 (23:34 +0000)
committerDan Gohman <gohman@apple.com>
Thu, 5 Nov 2009 23:34:59 +0000 (23:34 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86193 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/LoopStrengthReduce.cpp

index 288dd476e9f3d4669de84c927e3dc711250180df..4b82dbfd539e032703467a0a9055937192bc56c7 100644 (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.