[all-commits] [llvm/llvm-project] ac65fb: [LoopVectorize] Fix incorrect order of invariant s...

Igor Kirillov via All-commits all-commits at lists.llvm.org
Thu Aug 31 09:22:54 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ac65fb869977185b44757b94dc5130bd08c6f7e2
      https://github.com/llvm/llvm-project/commit/ac65fb869977185b44757b94dc5130bd08c6f7e2
  Author: Igor Kirillov <igor.kirillov at arm.com>
  Date:   2023-08-31 (Thu, 31 Aug 2023)

  Changed paths:
    M llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
    M llvm/test/Transforms/LoopVectorize/reduction-with-invariant-store.ll

  Log Message:
  -----------
  [LoopVectorize] Fix incorrect order of invariant stores when there are multiple reductions.

When a loop has multiple reductions, each with an intermediate invariant
store, the order in which those reductions are processed is not considered.
This can result in the invariant stores outside the loop not preserving the
original order.
This patch sorts VPReductionPHIRecipes by the order in which they have
stores in the original loop before running
`InnerLoopVectorizer::fixReduction` function, and it helps to maintain
the correct order of stores.

Fixes https://github.com/llvm/llvm-project/issues/64047

Differential Revision: https://reviews.llvm.org/D157631




More information about the All-commits mailing list