[PATCH] D153948: [RISCV][NFC] Refactor lowerToScalableOp.

Fraser Cormack via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 29 04:14:38 PDT 2023


frasercrmck added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:4625
+bool RISCVTargetLowering::hasMergeOp(unsigned Opcode) const {
+  assert(Opcode > RISCVISD::FIRST_NUMBER &&
+         Opcode <= RISCVISD::STRICT_VFROUND_NOEXCEPT_VL && "not a valid op");
----------------
jacquesguan wrote:
> frasercrmck wrote:
> > I wonder if we want stronger checks here so people don't insert an op in the wrong place and have weird stuff happen.
> change to `report_fatal_error`?
I was thinking more along the lines of `static_asserts` that check that nodes are defined roughly as we expect, or that there are as many nodes in between the ranges as we expect. That way someone can't insert any op in between `RISCVISD::VWMUL_VL` and `RISCVISD::VFWSUB_W_VL` (for example) without seeing a compile-time error and having to think about whether it has a merge op and whether the code needs updating.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D153948



More information about the llvm-commits mailing list