[PATCH] D159368: [RISCV] Remove SEW operand for load/store and SEW-aware pseudos

Wang Pengcheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 6 01:00:21 PDT 2023


wangpc marked an inline comment as done.
wangpc added a comment.

In D159368#4638327 <https://reviews.llvm.org/D159368#4638327>, @michaelmaitland wrote:

> I wonder if it would be a good idea to add a function `getSEW(MachineInstr)` which gets the SEW from the Opcode or from the Operand, depending on how the pseudo tracks SEW. This indirection would remove the complication of having inconsistent pseudos. WDYT?

Done, I added a `getSEWOp`.



================
Comment at: llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp:51-57
+static unsigned getLog2SEW(const MachineInstr &MI) {
+  uint64_t TSFlags = MI.getDesc().TSFlags;
+  assert(RISCVII::hasSEW(TSFlags) && "The instruction doesn't have SEW value!");
+  if (RISCVII::hasSEWOp(TSFlags))
+    return MI.getOperand(RISCVII::getSEWOpNum(MI.getDesc())).getImm();
+
+  return 3 + RISCVII::getVSEW(TSFlags);
----------------
kito-cheng wrote:
> This seems could be a separated NFC refactor patch?
No, we have changed how it is used. We should use `getSEWOp` now.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D159368



More information about the llvm-commits mailing list