[all-commits] [llvm/llvm-project] 0ad275: [InstCombine] Fold vector.reduce.op(vector.reverse...

David Sherwood via All-commits all-commits at lists.llvm.org
Fri May 17 04:58:37 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0ad275c1588065c9f4ef45a6a88f062182ad446b
      https://github.com/llvm/llvm-project/commit/0ad275c1588065c9f4ef45a6a88f062182ad446b
  Author: David Sherwood <david.sherwood at arm.com>
  Date:   2024-05-17 (Fri, 17 May 2024)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
    M llvm/test/Transforms/InstCombine/vector-logical-reductions.ll
    M llvm/test/Transforms/InstCombine/vector-reductions.ll

  Log Message:
  -----------
  [InstCombine] Fold vector.reduce.op(vector.reverse(X)) -> vector.reduce.op(X) (#91743)

For all of the following reductions:

vector.reduce.or
vector.reduce.and
vector.reduce.xor
vector.reduce.add
vector.reduce.mul
vector.reduce.umin
vector.reduce.umax
vector.reduce.smin
vector.reduce.smax
vector.reduce.fmin
vector.reduce.fmax

if the input operand is the result of a vector.reverse then we can
perform a reduction on the vector.reverse input instead since the answer
is the same. If the reassociation is permitted we can also do the same
folds for these:

vector.reduce.fadd
vector.reduce.fmul



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