================ @@ -340,8 +340,14 @@ Value *VPInstruction::generateInstruction(VPTransformState &State, auto *Phi = State.get(getOperand(0), 0); // The loop step is equal to the vectorization factor (num of SIMD // elements) times the unroll factor (num of SIMD instructions). - Value *Step = - createStepForVF(Builder, Phi->getType(), State.VF, State.UF); + Value *Step; + { + BasicBlock *VectorPH = State.CFG.getPreheaderBBFor(this); + IRBuilder<> PHBuilder(VectorPH->getTerminator()); + // Step is loop-invariant, calls to vscale will be placed in the + // preheader. + Step = createStepForVF(PHBuilder, Phi->getType(), State.VF, State.UF); + } ---------------- fhahn wrote:
The cow has been remove in https://github.com/llvm/llvm-project/commit/a5891fa4d2b76cf9dec96da9ded59fc4937d3342 https://github.com/llvm/llvm-project/pull/74762 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits