[PATCH] D147131: [PoC][TabgleGen] Add new bang operator !apply

Artem Belevich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 29 10:26:13 PDT 2023


tra added a comment.

It would be great to update tablegen documentation, too.

On the surface, I think we're reinventing a lambda here.



================
Comment at: llvm/lib/TableGen/Record.cpp:1898
+  std::string OpStr = Op->getAsUnquotedString();
+  if (OpStr == "add")
+    return BinOpInit::get(BinOpInit::ADD, Args[0], Args[1], ReturnType)
----------------
How about `mul`, `div`, and `mod` ?


================
Comment at: llvm/lib/TableGen/Record.cpp:1898
+  std::string OpStr = Op->getAsUnquotedString();
+  if (OpStr == "add")
+    return BinOpInit::get(BinOpInit::ADD, Args[0], Args[1], ReturnType)
----------------
tra wrote:
> How about `mul`, `div`, and `mod` ?
Does it mean that we make all these ops a reserved keyword which would no longer be available to users for other purposes?

E.g. here: https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/AMDGPU/SIRegisterInfo.td#L123



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147131



More information about the llvm-commits mailing list