[PATCH] D32684: [X86] Adding new LLVM TableGen backend that generates the X86 backend memory folding tables.
Ayman Musa via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 4 00:34:34 PDT 2017
aymanmus marked 2 inline comments as done.
aymanmus added inline comments.
================
Comment at: utils/TableGen/X86FoldTablesEmitter.cpp:118
+ // For manually mapping instructions that do not match by their encoding.
+ const std::vector<ManualMapEntry> ManualMapSet = {
+ { "ADD16ri_DB", "ADD16mi", NO_UNFOLD },
----------------
craig.topper wrote:
> aymanmus wrote:
> > craig.topper wrote:
> > > Why does this need to be vector? Why not a regular array or std::array?
> > Defining an array as a class member requires stating it's size (ManualMapSet[18]), while std::vector doesn't. I thought this table might be dynamic and changed from time to time, so this way can be more friendly for future tuning.
> > What do you think?
> The number is required even if you put the array contents with it?
Yes, ManualMapSet[] =... would result in defining 0 sized array, and the compiler would give the following messages:
- warning: ISO C++ forbids zero-size array `ManualMapSet`
- error: too many initializers for `const {anonymous}::X86FoldTablesEmitter::ManualMapEntry [0]`
https://reviews.llvm.org/D32684
More information about the llvm-commits
mailing list