[PATCH] D133255: [RISCV] Transform VMERGE_VVM_<LMUL>_TU with all ones mask to VADD_VI_<LMUL>_TU.

Yeting Kuo via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 4 23:11:25 PDT 2022


fakepaper56 marked 2 inline comments as done.
fakepaper56 added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp:2509
+// Return true if we can make sure mask of N is all-ones mask.
+static bool useAllOnesMask(SDNode *N, unsigned MaskOpIdx) {
   // Check that we're using V0 as a mask register.
----------------
craig.topper wrote:
> use -> uses?
Done.


================
Comment at: llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp:2718
+// Transform (VMERGE_VVM_<LMUL>_TU false, false, true, allones, vl, sew) to
+// (VADD_VI_<LMUL>_TU false, true, 0, vl, sew). It may decrase uses of VMSET.
+bool RISCVDAGToDAGISel::performVMergeToVAdd(SDNode *N) {
----------------
craig.topper wrote:
> decrase -> decrease
Done.


================
Comment at: llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp:2721
+  // Check merge operand is same as false operand.
+  if (N->getOperand(0) != N->getOperand(1))
+    return false;
----------------
craig.topper wrote:
> Should we move this check and `useAllOnesMask` up to the caller? They are common to performVMergeToVAdd and performCombineVMergeAndVOps.
Good point. Done.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133255/new/

https://reviews.llvm.org/D133255



More information about the llvm-commits mailing list