[all-commits] [llvm/llvm-project] 1fbb6b: [LV] Prefer FLT_MIN/MAX for fmin/fmax reductions w...

Philip Reames via All-commits all-commits at lists.llvm.org
Tue Sep 3 12:22:16 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1fbb6b4efc9e9d257f0f7e5065f40f9b9677ca7c
      https://github.com/llvm/llvm-project/commit/1fbb6b4efc9e9d257f0f7e5065f40f9b9677ca7c
  Author: Philip Reames <preames at rivosinc.com>
  Date:   2024-09-03 (Tue, 03 Sep 2024)

  Changed paths:
    M llvm/lib/Analysis/IVDescriptors.cpp
    M llvm/test/Transforms/LoopVectorize/AArch64/scalable-reduction-inloop-cond.ll
    M llvm/test/Transforms/LoopVectorize/RISCV/vectorize-force-tail-with-evl-inloop-reduction.ll
    M llvm/test/Transforms/LoopVectorize/reduction-inloop-cond.ll

  Log Message:
  -----------
  [LV] Prefer FLT_MIN/MAX for fmin/fmax reductions with ninf (#107141)

Analogous to 2c7786e94a1058bd4f96794a1d4f70dcb86e5cc5, cleanup a case
where the vectorizer is emitting a non-canonical identity value given
the available flags. We use largest/smallest value during ISEL, and VP
expansion, but not during vectorization.

Since the fmin/fmax/fminimum/fmaximum intrinsics don't require a start
value, this difference is only visible when masking of inactive lanes is
required.

Primary motivation of this change is simply to remove a difference
between version of code which reason about the identity value of a
reduction so I can kill all but one off.

In review, it was pointed out that this is actually a functional fix as well. 
The old code used inf on a noinf reduction instruction - whose
result is poison!  That wasn't the intent of the code.



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