llvm.org GIT mirror llvm / 94794dd
Add an extra safety check in front of the optimization in r141442. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141470 91177308-0d34-0410-b5e6-96231b3b80d8 Andrew Trick 8 years ago
1 changed file(s) with 9 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
907907 if (IncV->getType() != Type::getInt1PtrTy(SE.getContext(), AS)
908908 && IncV->getType() != Type::getInt8PtrTy(SE.getContext(), AS))
909909 return false;
910 // Ensure the operands dominate the insertion point. I don't know of a
911 // case when this would not be true, so this is somewhat untested.
912 if (L == IVIncInsertLoop) {
913 for (User::op_iterator OI = IncV->op_begin()+1,
914 OE = IncV->op_end(); OI != OE; ++OI)
915 if (Instruction *OInst = dyn_cast(OI))
916 if (!SE.DT->dominates(OInst, IVIncInsertPos))
917 return false;
918 }
910919 break;
911920 }
912921 IncV = dyn_cast(IncV->getOperand(0));