[PATCH] D130895: [RISCV] Make VL choosing for a splat-like VMV based on its users

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 15 14:55:16 PDT 2022


craig.topper added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp:2464
+  assert(!Range.empty() && "Invalid range");
+  std::pair<SDValue, uint64_t> MaxVL{SDValue{}, 0};
+  for (SDNode *Node : Range) {
----------------
I think this would be cleaner as two named variables.


================
Comment at: llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp:2544
+  Ops[Node->getNumOperands() - 1] = VL;
+  CurDAG->UpdateNodeOperands(Node, Ops);
+}
----------------
UpdateNodeOperands potentially returns a different pointer than `Node` if it triggered CSE internally. In that case you need to Replace all uses of `Node` with the value returned and not run any of the code in caller. See the UpdateNodeOperands call in `X86DAGToDAGISel::tryShiftAmountMod` for a similar case.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130895



More information about the llvm-commits mailing list