[PATCH] D144154: [X86]Use Class to refactor ArithMetic td file in X86

Kan Shengchen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 16 19:18:31 PST 2023


skan added inline comments.


================
Comment at: llvm/lib/Target/X86/X86InstrArithmetic.td:58
 class X86TypeInfo<ValueType vt, string instrsuffix, RegisterClass regclass,
                   PatFrag loadnode, X86MemOperand memoperand, ImmType immkind,
                   Operand immoperand, SDPatternOperator immoperator,
----------------
`X86TypeInfo` and `Xi*` are common  and might be used by at other instruction TDs. The fact is that we always use  X86InstrArithmetic.td and  X86InstrFormats..td together, and the former is bigger than the latter. Moving can make X86InstrArithmetic.td easier to read by reducing the size of a big file. 


================
Comment at: llvm/lib/Target/X86/X86InstrArithmetic.td:459
 
+//  UnaryOpM - Instructions like "inc [mem]"
+class UnaryOpM<bits<8> opcode, Format f, string mnemonic, X86TypeInfo info,
----------------
Could we change this comment? I never like this style of comment b/c it looks almost same as  "INCDECM - Instructions like "inc [mem]". which is confusing.

We may change the comment to “Unary instructions with a memory operand”

Similarly for other classes in this file like `BinOpMI8`, etc.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144154



More information about the llvm-commits mailing list