Skip to content

Commit bbdc0bb

Browse files
committed
[VPlan] Get types and step from VPWidenPointerInductionRecipe (NFC).
1 parent 2067e60 commit bbdc0bb

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3194,7 +3194,7 @@ void VPWidenPointerInductionRecipe::execute(VPTransformState &State) {
31943194
// A pointer induction, performed by using a gep
31953195
BasicBlock::iterator InductionLoc = State.Builder.GetInsertPoint();
31963196
Value *ScalarStepValue = State.get(getOperand(1), VPLane(0));
3197-
Type *PhiType = IndDesc.getStep()->getType();
3197+
Type *PhiType = State.TypeAnalysis.inferScalarType(getOperand(1));
31983198
Value *RuntimeVF = getRuntimeVF(State.Builder, PhiType, State.VF);
31993199
// Add induction update using an incorrect block temporarily. The phi node
32003200
// will be fixed after VPlan execution. Note that at this point the latch
@@ -3246,7 +3246,8 @@ void VPWidenPointerInductionRecipe::print(raw_ostream &O, const Twine &Indent,
32463246
printAsOperand(O, SlotTracker);
32473247
O << " = WIDEN-POINTER-INDUCTION ";
32483248
getStartValue()->printAsOperand(O, SlotTracker);
3249-
O << ", " << *IndDesc.getStep();
3249+
O << ", ";
3250+
getOperand(1)->printAsOperand(O, SlotTracker);
32503251
if (getNumOperands() == 4) {
32513252
O << ", ";
32523253
getOperand(2)->printAsOperand(O, SlotTracker);

llvm/test/Transforms/LoopVectorize/AArch64/sve-widen-gep.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ target triple = "aarch64-unknown-linux-gnu"
2222
; CHECK-NEXT: <x1> vector loop: {
2323
; CHECK-NEXT: vector.body:
2424
; CHECK-NEXT: EMIT vp<[[CAN_IV:%.+]]> = CANONICAL-INDUCTION
25-
; CHECK-NEXT: EMIT ir<%ptr.iv.2> = WIDEN-POINTER-INDUCTION ir<%start.2>, 1
25+
; CHECK-NEXT: EMIT ir<%ptr.iv.2> = WIDEN-POINTER-INDUCTION ir<%start.2>, ir<1>
2626
; CHECK-NEXT: vp<[[PTR_IDX:%.+]]> = DERIVED-IV ir<0> + vp<[[CAN_IV]]> * ir<8>
2727
; CHECK-NEXT: vp<[[PTR_IDX_STEPS:%.+]]> = SCALAR-STEPS vp<[[PTR_IDX]]>, ir<8>
2828
; CHECK-NEXT: EMIT vp<[[PTR_IV_1:%.+]]> = ptradd ir<%start.1>, vp<[[PTR_IDX_STEPS]]>

0 commit comments

Comments
 (0)