[PATCH] D101294: [LoopVectorize] Fix scalarisation crash in widenPHIInstruction for scalable vectors
David Sherwood via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 5 05:35:14 PDT 2021
david-arm marked 2 inline comments as done.
david-arm added inline comments.
================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:4783
+ Value *UnitStepVec = nullptr, *PtrIndSplat = nullptr;
+ if (!IsUniform && VF.isScalable()) {
+ Type *VecIVTy = VectorType::get(PtrInd->getType(), VF);
----------------
sdesmalen wrote:
> Can we unify this approach for both scalable and fixed-width vectors? Or phrased differently, is there still value in the per-lane calculation for fixed-width vectors? I would expect InstCombine to simplify any extract-elements from the splat + stepvector, if those are needed individually.
Hi @sdesmalen, so I looked into this and there is a problem for fixed-width vectors because the vector GEP could be created in a different block to the actual extractelement operation. I have added an appropriate fold in instcombine anyway - see D101900 - as you're right that this is useful. However, for non-uniform scalarisation with scalable vectors I have changed the code below to avoid caching the per-lane values with the `continue;` line.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D101294/new/
https://reviews.llvm.org/D101294
More information about the llvm-commits
mailing list