[llvm] [NVPTX] Misc table-gen cleanup (NFC) (PR #142877)

Artem Belevich via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 6 13:51:43 PDT 2025


================
@@ -513,14 +498,14 @@ class CpAsyncBulkStr<bit mc, bit ch, bit mask = 0> {
 }
 
 multiclass CP_ASYNC_BULK_S2G_INTR<bit has_ch> {
-  def NAME : NVPTXInst<(outs), (ins ADDR:$dst, ADDR:$src, Int32Regs:$size, Int64Regs:$ch),
+  def "" : NVPTXInst<(outs), (ins ADDR:$dst, ADDR:$src, Int32Regs:$size, Int64Regs:$ch),
----------------
Artem-B wrote:

Both `""` and NAME are somewhat odd.
- NAME is an explicit special case, saying that it will be replaced with the name of the enveloping multiclass instance name.
- `""` appends an empty string to the multiclass instance name, and essentially has the same effect, but it's an odd-looking thing that was not intentionally designed, and just happens to work. TableGen could've easily required a non-empty string here.

I personally am biased towards using `NAME`, but `""` is common enough in practical use , so I'm not against it.
There are ~30 uses of `def ""`in LLVM vs ~60 for NAME, which sort of confirms that my bias towards NAME may be shared by others.


https://github.com/llvm/llvm-project/pull/142877


More information about the llvm-commits mailing list