[PATCH] D126116: [X86][BOLT] Use getOperandType to determine memory access size

Kan Shengchen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 5 23:08:47 PDT 2022


skan added inline comments.


================
Comment at: bolt/lib/Target/X86/X86MCPlusBuilder.cpp:1009-1054
+    switch (X86::getOperandType(Inst, MemOpNo)) {
+    default:
+      return 0;
+    case i8mem:
+    case i8mem_NOREX:
+      return 1;
+    case i16mem:
----------------
Could we avoid writing this table manually here? We already have similar things e.g `X86Disassembler::getMemOperandSize`? Maybe we can add one bit for class `X86MemAsmOperand`, and auto-generate this table.


================
Comment at: llvm/lib/Target/X86/X86InstrInfo.cpp:9651
 #define GET_INSTRINFO_HELPERS
+#define GET_INSTRINFO_OPERAND_TYPE
 #include "X86GenInstrInfo.inc"
----------------
I am worried about this will increase the build time and memory usage a lot..
Should we put this into a bolt-only file?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126116



More information about the llvm-commits mailing list