[PATCH] D127787: [TableGen][X86] Emit memory operand size table

Amir Ayupov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 14 22:56:26 PDT 2022


Amir marked an inline comment as done.
Amir added inline comments.


================
Comment at: llvm/utils/TableGen/InstrInfoEmitter.cpp:468
+    SmallVector<StringRef> Matches;
+    if (!MemSizeRegex.match(Name, &Matches))
+      continue;
----------------
skan wrote:
> Could we add one field for class X86MemAsmOperand explicitly? I don't think regex is good way here...
I've extended X86MemOperand class (I think that's the one you had in mind) with `Size` field.
It's being queried explicitly.

The alternative is to check something like
```
if (Op->getValueAsString("OperandType") != "OPERAND_MEMORY" ||
    Op->isValueUnset("Size"))
  continue;
```
to be able to cover operands other than X86MemOperand/targets other than X86.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127787



More information about the llvm-commits mailing list