@@ -2386,7 +2386,7 @@ static Value *
23862386emitTransformedIndex (IRBuilderBase &B, Value *Index, Value *StartValue,
23872387 Value *Step,
23882388 InductionDescriptor::InductionKind InductionKind,
2389- BinaryOperator *InductionBinOp) {
2389+ const BinaryOperator *InductionBinOp) {
23902390 Type *StepTy = Step->getType ();
23912391 Value *CastedIndex = StepTy->isIntegerTy ()
23922392 ? B.CreateSExtOrTrunc (Index, StepTy)
@@ -9479,19 +9479,17 @@ void VPDerivedIVRecipe::execute(VPTransformState &State) {
94799479
94809480 // Fast-math-flags propagate from the original induction instruction.
94819481 IRBuilder<>::FastMathFlagGuard FMFG (State.Builder );
9482- if (IndDesc.getInductionBinOp () &&
9483- isa<FPMathOperator>(IndDesc.getInductionBinOp ()))
9484- State.Builder .setFastMathFlags (
9485- IndDesc.getInductionBinOp ()->getFastMathFlags ());
9482+ if (BinOp && isa<FPMathOperator>(BinOp))
9483+ State.Builder .setFastMathFlags (BinOp->getFastMathFlags ());
94869484
94879485 Value *Step = State.get (getStepValue (), VPIteration (0 , 0 ));
94889486 Value *CanonicalIV = State.get (getCanonicalIV (), VPIteration (0 , 0 ));
9489- Value *DerivedIV = emitTransformedIndex (
9490- State. Builder , CanonicalIV, getStartValue ()->getLiveInIRValue (), Step ,
9491- IndDesc. getKind (), IndDesc. getInductionBinOp () );
9487+ Value *DerivedIV = emitTransformedIndex (State. Builder , CanonicalIV,
9488+ getStartValue ()->getLiveInIRValue (),
9489+ Step, Kind, BinOp );
94929490 DerivedIV->setName (" offset.idx" );
94939491 if (ResultTy != DerivedIV->getType ()) {
9494- assert (Step->getType ()->isIntegerTy () &&
9492+ assert (IsTruncated && Step->getType ()->isIntegerTy () &&
94959493 " Truncation requires an integer step" );
94969494 DerivedIV = State.Builder .CreateTrunc (DerivedIV, ResultTy);
94979495 }
0 commit comments