[all-commits] [llvm/llvm-project] 952959: Recommit #2: "[LV] Induction Variable does not rem...

sjoerdmeijer via All-commits all-commits at lists.llvm.org
Wed May 13 05:51:43 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 9529597cf4562c64034943dacc29a4ff4fe93d86
      https://github.com/llvm/llvm-project/commit/9529597cf4562c64034943dacc29a4ff4fe93d86
  Author: Sjoerd Meijer <sjoerd.meijer at arm.com>
  Date:   2020-05-13 (Wed, 13 May 2020)

  Changed paths:
    M llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
    M llvm/test/Transforms/LoopVectorize/AArch64/extractvalue-no-scalarization-required.ll
    M llvm/test/Transforms/LoopVectorize/AArch64/pr36032.ll
    M llvm/test/Transforms/LoopVectorize/ARM/sphinx.ll
    M llvm/test/Transforms/LoopVectorize/Hexagon/invalidate-cm-after-invalidating-interleavegroups.ll
    M llvm/test/Transforms/LoopVectorize/PowerPC/vectorize-bswap.ll
    M llvm/test/Transforms/LoopVectorize/SystemZ/predicated-first-order-recurrence.ll
    M llvm/test/Transforms/LoopVectorize/X86/constant-fold.ll
    M llvm/test/Transforms/LoopVectorize/X86/imprecise-through-phis.ll
    M llvm/test/Transforms/LoopVectorize/X86/load-deref-pred.ll
    M llvm/test/Transforms/LoopVectorize/X86/masked_load_store.ll
    M llvm/test/Transforms/LoopVectorize/X86/metadata-enable.ll
    M llvm/test/Transforms/LoopVectorize/X86/optsize.ll
    M llvm/test/Transforms/LoopVectorize/X86/pr35432.ll
    M llvm/test/Transforms/LoopVectorize/X86/pr36524.ll
    M llvm/test/Transforms/LoopVectorize/X86/small-size.ll
    M llvm/test/Transforms/LoopVectorize/X86/strided_load_cost.ll
    M llvm/test/Transforms/LoopVectorize/X86/vect.omp.force.small-tc.ll
    M llvm/test/Transforms/LoopVectorize/X86/x86-interleaved-accesses-masked-group.ll
    M llvm/test/Transforms/LoopVectorize/fcmp-vectorize.ll
    M llvm/test/Transforms/LoopVectorize/first-order-recurrence-complex.ll
    M llvm/test/Transforms/LoopVectorize/float-minmax-instruction-flag.ll
    M llvm/test/Transforms/LoopVectorize/if-pred-stores.ll
    M llvm/test/Transforms/LoopVectorize/if-reduction.ll
    M llvm/test/Transforms/LoopVectorize/multiple-strides-vectorization.ll
    M llvm/test/Transforms/LoopVectorize/pr35773.ll
    M llvm/test/Transforms/LoopVectorize/pr44488-predication.ll
    M llvm/test/Transforms/LoopVectorize/runtime-check-needed-but-empty.ll
    M llvm/test/Transforms/LoopVectorize/vector-intrinsic-call-cost.ll

  Log Message:
  -----------
  Recommit #2: "[LV] Induction Variable does not remain scalar under tail-folding."

This was reverted because of a miscompilation. At closer inspection, the
problem was actually visible in a changed llvm regression test too. This
one-line follow up fix/recommit will splat the IV, which is what we are trying
to avoid if unnecessary in general, if tail-folding is requested even if all
users are scalar instructions after vectorisation. Because with tail-folding,
the splat IV will be used by the predicate of the masked loads/stores
instructions. The previous version omitted this, which caused the
miscompilation. The original commit message was:

If tail-folding of the scalar remainder loop is applied, the primary induction
variable is splat to a vector and used by the masked load/store vector
instructions, thus the IV does not remain scalar. Because we now mark
that the IV does not remain scalar for these cases, we don't emit the vector IV
if it is not used. Thus, the vectoriser produces less dead code.

Thanks to Ayal Zaks for the direction how to fix this.




More information about the All-commits mailing list