[PATCH] D131551: [RISCV] Fold scalable binary integer vector op and vector select op to RVV VL Op.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 14 18:53:54 PDT 2022


craig.topper added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:8290
+  if (N0.getOpcode() == ISD::VSELECT) {
+    N0 = N->getOperand(1);
+    N1 = N->getOperand(0);
----------------
std::swap?


================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:8324
+    OP_CASE(ADD, 0)
+    OP_CASE(SUB, 0)
+    OP_CASE(MUL, 1)
----------------
Some of these operations aren't commutable. If the select is on the LHS of the SUB this transform isn't valid.


================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:8330
+    OP_CASE(SDIV, 1)
+    OP_CASE(UREM, 1)
+    OP_CASE(SREM, 1)
----------------
1 is not an identity value for urem or srem, it would always return 0.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131551



More information about the llvm-commits mailing list