[PATCH] D134703: [RISCV][ISel] Refactor the formation of VW operations

Quentin Colombet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 26 22:01:33 PDT 2022


qcolombet added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:8137
 
-// Try to form vwadd(u).wv/wx or vwsub(u).wv/wx. It might later be optimized to
-// vwadd(u).vv/vx or vwsub(u).vv/vx.
-static SDValue combineADDSUB_VLToVWADDSUB_VL(SDNode *N, SelectionDAG &DAG,
-                                             bool Commute = false) {
-  assert((N->getOpcode() == RISCVISD::ADD_VL ||
-          N->getOpcode() == RISCVISD::SUB_VL) &&
-         "Unexpected opcode");
-  bool IsAdd = N->getOpcode() == RISCVISD::ADD_VL;
-  SDValue Op0 = N->getOperand(0);
-  SDValue Op1 = N->getOperand(1);
-  if (Commute)
-    std::swap(Op0, Op1);
+namespace {
+// Forward declaration of the structure holding the necessary information to
----------------
Everything in this anonymous namespace is the boilderplate code I was talking about in the description.


================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:8659
+static SDValue
+combineBinOp_VLToVWBinOp_VL(SDNode *N, TargetLowering::DAGCombinerInfo &DCI) {
+  SelectionDAG &DAG = DCI.DAG;
----------------
The main entry point is here.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134703



More information about the llvm-commits mailing list