[all-commits] [llvm/llvm-project] 582f8e: [LV] Keep track of cost-based ScalarAfterVec in VP...

Florian Hahn via All-commits all-commits at lists.llvm.org
Mon Sep 19 10:15:14 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 582f8ef19fe791e66c0bbe090edebfd74ba2b55d
      https://github.com/llvm/llvm-project/commit/582f8ef19fe791e66c0bbe090edebfd74ba2b55d
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2022-09-19 (Mon, 19 Sep 2022)

  Changed paths:
    M llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
    M llvm/lib/Transforms/Vectorize/VPlan.cpp
    M llvm/lib/Transforms/Vectorize/VPlan.h
    M llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
    M llvm/test/Transforms/LoopVectorize/AArch64/epilog-vectorization-widen-inductions.ll
    M llvm/test/Transforms/LoopVectorize/AArch64/sve-live-out-pointer-induction.ll
    M llvm/test/Transforms/LoopVectorize/AArch64/sve-widen-gep.ll
    M llvm/test/Transforms/LoopVectorize/AArch64/sve-widen-phi.ll
    M llvm/test/Transforms/LoopVectorize/X86/interleave-opaque-pointers.ll
    M llvm/test/Transforms/LoopVectorize/opaque-ptr.ll

  Log Message:
  -----------
  [LV] Keep track of cost-based ScalarAfterVec in VPWidenPointerInd.

Epilogue vectorization uses isScalarAfterVectorization to check if
widened versions for inductions need to be generated and bails out in
those cases.

At the moment, there are scenarios where isScalarAfterVectorization
returns true but VPWidenPointerInduction::onlyScalarsGenerated would
return false, causing widening.

This can lead to widened phis with incorrect start values being created
in the epilogue vector body.

This patch addresses the issue by storing the cost-model decision in
VPWidenPointerInductionRecipe and restoring the behavior before 151c144.
This effectively reverts 151c144, but the long-term fix is to properly
support widened inductions during epilogue vectorization

Fixes #57712.




More information about the All-commits mailing list