[PATCH] D142083: [X86][NFC] Move MemoryFoldTable2Addr MemoryFoldTable0~4 into X86InstrFoldTables.def
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 19 00:42:28 PST 2023
craig.topper added inline comments.
================
Comment at: llvm/lib/Target/X86/X86InstrFoldTables.def:1
+static const X86MemoryFoldTableEntry MemoryFoldTable2Addr[] = {
+{X86::ADD16ri8_DB,X86::ADD16mi8,TB_NO_REVERSE},
----------------
skan wrote:
> We should not define a C++ array in a def file.
> Try sth like
> ```
> #ifndef X86_MEM_FOLD_2ADDR
> #define X86_MEM_FOLD_2ADDR(REG,MEM,FLAG)
> X86_MEM_FOLD_2ADDR(ADD16ri8_DB,ADD16mi8,TB_NO_REVERSE)
> X86_MEM_FOLD_2ADDR(ADD16ri_DB,ADD16mi,TB_NO_REVERSE)
> #endif
> #undef X86_MEM_FOLD_2ADDR
> ```
>
> And in X86InstrFoldTables.cpp
>
> ```
> static const X86MemoryFoldTableEntry MemoryFoldTable2Addr[] = {
> #define X86_MEM_FOLD_2ADDR (REG,MEM,FLAG) {X86::REG, X86::MEM, FLAG},
> }
> ```
>
Could make it a .inc file instead of .def?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D142083/new/
https://reviews.llvm.org/D142083
More information about the llvm-commits
mailing list