[PATCH] D115128: [TableGen][CodeEmitter] Introducing the VarLenCodeEmitterGen infrastructure

Min-Yih Hsu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 7 03:19:34 PST 2022


myhsu added inline comments.


================
Comment at: llvm/utils/TableGen/VarLenCodeEmitterGen.cpp:103
+      ArrayRef<const CodeGenInstruction *> NumberedInstructions,
+      CodeGenTarget &Target, int HwMode = -1);
+
----------------
craig.topper wrote:
> nit. Is the default for HwMode ever used? The call when HwModes is empty passes -1
good point, I'm fixing this on the callsite.


================
Comment at: llvm/utils/TableGen/VarLenCodeEmitterGen.cpp:324
+  for (unsigned I = 0; I < Bits.getNumWords(); ++I, ++Index)
+    (I ? SS : SS.indent(4))
+        << "UINT64_C(" << utostr(Bits.getRawData()[I]) << "),";
----------------
craig.topper wrote:
> Can the indent call be done before the loop?
> 
> Though I'm not sure about the indent. The NumBits and Index don't have a new line after them so we're not at the start of a line here.
> Though I'm not sure about the indent. The NumBits and Index don't have a new line after them so we're not at the start of a line here.

`IS` and `SS` are actually separate streams for different parts of the code. And `SS.indent(4)` is indeed at the start of a line (line 391 prints the newline for it).


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

https://reviews.llvm.org/D115128



More information about the llvm-commits mailing list