[PATCH] D155932: [RISCV] Add subclasses of Sched to simplify code

Wang Pengcheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 25 03:59:59 PDT 2023


wangpc added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVInstrInfoV.td:101
 
+class SchedNary<string write, list<string> reads,
+                string mx, int sew = 0, bit maskedOnly = 0>: Sched<[]> {
----------------
michaelmaitland wrote:
> michaelmaitland wrote:
> > Can we add docstrings for these functions since they will be used by many different classes?
> These classes are only used in `RISCVInstrVPseudos.td`. Do they belong in that file?
Now they are used. :-)


================
Comment at: llvm/lib/Target/RISCV/RISCVInstrInfoV.td:111
+  defvar IsMasked = !ne(!find(NAME, "_MASK"), -1);
+  defvar AddReadVMask = !or(maskedOnly, IsMasked);
+  let SchedRW = !listconcat(WriteList, ReadList,
----------------
michaelmaitland wrote:
> I don't know the case convention for TableGen, but it looks like we're mixing camel and pascal case here (and we also use underscores in other places too). Is there a reason for mixing case conventions here?
Fixed.
Just my convention:
* pascal case for classes, multiclasses, fields.
* camel case for iterators, arguments, `defvar`s, subroutines, the `return` value of subroutines.
Usually, I don't use underscores or mix the cases. But sometimes I will in order to match existed code (some of them are inherited from target independent TableGen infrastructures).
We can do some cleanups in the future to keep the style consistent once we reach an agreement.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D155932



More information about the llvm-commits mailing list