[all-commits] [llvm/llvm-project] 37a94b: [LICM][MustExec] Make must-exec logic for IV condi...

Nikita Popov via All-commits all-commits at lists.llvm.org
Thu Aug 8 07:31:41 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 37a94b7eddeab0ae42207699fb9be37587172a9e
      https://github.com/llvm/llvm-project/commit/37a94b7eddeab0ae42207699fb9be37587172a9e
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2024-08-08 (Thu, 08 Aug 2024)

  Changed paths:
    M llvm/lib/Analysis/MustExecute.cpp
    M llvm/test/Transforms/LICM/hoist-mustexec.ll
    M llvm/test/Transforms/PhaseOrdering/AArch64/peel-multiple-unreachable-exits-for-vectorization.ll

  Log Message:
  -----------
  [LICM][MustExec] Make must-exec logic for IV condition commutative (#93150)

MustExec has special logic to determine whether the first loop iteration
will always be executed, by simplifying the IV comparison with the start
value. Currently, this code assumes that the IV is on the LHS of the
comparison, but this is not guaranteed. Make sure it handles the
commuted variant as well.

The changed PhaseOrdering test previously performed peeling to make the
loads dereferenceable -- as a side effect, this also reduced the exit
count by one, avoiding the awkward <= MAX case.

Now we know up-front the the loads are dereferenceable and can be simply
hoisted. As such, we retain the original exit count and now have to
handle it by widening the exit count calculation to i128. This is a
regression, but at least it preserves the vectorization, which was the
original goal. I'm not sure what else can be done about that test.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list