- // Cast is either an sext or zext up to this point.
- // We should not widen an indvar if arithmetics on the wider indvar are more
- // expensive than those on the narrower indvar. We check only the cost of ADD
- // because at least an ADD is required to increment the induction variable. We
- // could compute more comprehensively the cost of all instructions on the
- // induction variable when necessary.
- if (TTI &&
- TTI->getArithmeticInstrCost(Instruction::Add, Ty) >
- TTI->getArithmeticInstrCost(Instruction::Add,
- Cast->getOperand(0)->getType())) {
- return;
- }
-