[all-commits] [llvm/llvm-project] 645254: [DAGCombiner] Fold vecreduce_or/and if operand is ...

sdesmalen-arm via All-commits all-commits at lists.llvm.org
Sat Feb 5 06:36:28 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6452549f300cf1a8198708bb4d0ed3344ae05018
      https://github.com/llvm/llvm-project/commit/6452549f300cf1a8198708bb4d0ed3344ae05018
  Author: Sander de Smalen <sander.desmalen at arm.com>
  Date:   2022-02-05 (Sat, 05 Feb 2022)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    A llvm/test/CodeGen/AArch64/sve-vecreduce-fold.ll

  Log Message:
  -----------
  [DAGCombiner] Fold vecreduce_or/and if operand is insert_subvector.

Fold:
  vecreduce_or(insert_subvec(zeroinitializer, vec))
  -> vecreduce_or(vec)

  vecreduce_and(insert_subvec(allones, vec))
  -> vecreduce_and(vec)

  vecreduce_and/or(insert_subvec(undef, vec))
  -> vecreduce_and/or(vec)

This is useful for SVE which uses insert/extract subvector
to convert fixed-width to/from scalable vectors.

Reviewed By: bsmith

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




More information about the All-commits mailing list