From: Pete Cooper Date: Mon, 27 Jul 2015 18:37:58 +0000 (+0000) Subject: Revert "Remove unnecessary null check. NFC." X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=2deaa2924e52f1e07102b395302e8a72d92d716c;p=oota-llvm.git Revert "Remove unnecessary null check. NFC." This reverts commit r243167. Duncan pointed out that dyn_cast can return null in these cases, so this was an unsafe commit to make. Sorry for the noise. Worryingly there were no tests which fail... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243302 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/LoopInterchange.cpp b/lib/Transforms/Scalar/LoopInterchange.cpp index 75fe0c77e7b..9d7e57ffeba 100644 --- a/lib/Transforms/Scalar/LoopInterchange.cpp +++ b/lib/Transforms/Scalar/LoopInterchange.cpp @@ -817,6 +817,9 @@ bool LoopInterchangeLegality::currentLimitations() { InnerIndexVarInc = dyn_cast(InnerInductionVar->getIncomingValue(0)); + if (!InnerIndexVarInc) + return true; + // Since we split the inner loop latch on this induction variable. Make sure // we do not have any instruction between the induction variable and branch // instruction.