[all-commits] [llvm/llvm-project] de373e: [SelectionDAG] Extend immAll(Ones|Zeros)V to handl...

Fraser Cormack via All-commits all-commits at lists.llvm.org
Sat Jan 9 09:11:54 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: de373ef779880e923636d90cdb277e4db84c7479
      https://github.com/llvm/llvm-project/commit/de373ef779880e923636d90cdb277e4db84c7479
  Author: Fraser Cormack <fraser at codeplay.com>
  Date:   2021-01-09 (Sat, 09 Jan 2021)

  Changed paths:
    M llvm/include/llvm/CodeGen/SelectionDAGNodes.h
    M llvm/include/llvm/Target/TargetSelectionDAG.td
    M llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
    M llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
    M llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td
    M llvm/utils/TableGen/DAGISelMatcher.h
    M llvm/utils/TableGen/DAGISelMatcherGen.cpp

  Log Message:
  -----------
  [SelectionDAG] Extend immAll(Ones|Zeros)V to handle ISD::SPLAT_VECTOR

The TableGen immAllOnesV and immAllZerosV helpers implicitly wrapped the
ISD::isBuildVectorAll(Ones|Zeros) helper functions. This was inhibiting
their use for targets such as RISC-V which use ISD::SPLAT_VECTOR. In
particular, RISC-V had to define its own 'vnot' fragment.

In order to extend the scope of these nodes to include support for
ISD::SPLAT_VECTOR, two new ISD predicate functions have been introduced:
ISD::isConstantSplatVectorAll(Ones|Zeros). These effectively supersede
the older "isBuildVector" predicates, which are now simple wrappers for
the new functions. They pass a defaulted boolean toggle which preserves
the old behaviour. It is hoped that in time all call-sites can be ported
to the "isConstantSplatVector" functions.

While the use of ISD::isBuildVectorAll(Ones|Zeros) has not changed, the
behaviour of the TableGen immAll(Ones|Zeros)V **has**. To test the new
functionality, the custom RISC-V TableGen fragment has been removed and
replaced with the built-in 'vnot'. To test their use as pattern-roots, two
splat patterns have been updated accordingly.

Reviewed By: craig.topper

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




More information about the All-commits mailing list