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
This commit is contained in:
Pete Cooper 2015-07-27 18:37:58 +00:00
parent c1b7c09ac4
commit 11bd958cb6
1 changed files with 3 additions and 0 deletions

View File

@ -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.