aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Scalar/LoopInterchange.cpp
diff options
context:
space:
mode:
authorPete Cooper <peter_cooper@apple.com>2015-07-27 18:37:58 +0000
committerPete Cooper <peter_cooper@apple.com>2015-07-27 18:37:58 +0000
commit11bd958cb673b1af9892ed820087b8a4cc62a480 (patch)
treee25f15b7f615e8f8825c798ce7a4d4b1326fb440 /llvm/lib/Transforms/Scalar/LoopInterchange.cpp
parentc1b7c09ac40cbf803edd310b3b8d5e9d2701ab77 (diff)
downloadllvm-11bd958cb673b1af9892ed820087b8a4cc62a480.zip
llvm-11bd958cb673b1af9892ed820087b8a4cc62a480.tar.gz
llvm-11bd958cb673b1af9892ed820087b8a4cc62a480.tar.bz2
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... llvm-svn: 243302
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LoopInterchange.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopInterchange.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopInterchange.cpp b/llvm/lib/Transforms/Scalar/LoopInterchange.cpp
index 75fe0c7..9d7e57f 100644
--- a/llvm/lib/Transforms/Scalar/LoopInterchange.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopInterchange.cpp
@@ -817,6 +817,9 @@ bool LoopInterchangeLegality::currentLimitations() {
InnerIndexVarInc =
dyn_cast<Instruction>(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.