[PATCH] D142084: [X86][MemFold] Upgrade the mechanism of auto-generated Memory Folding Table

Phoebe Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 19 03:17:07 PST 2023


pengfei added inline comments.


================
Comment at: llvm/utils/TableGen/X86FoldTablesEmitter.cpp:50
+  // Used for RegOp->MemOp conversion. Encoded as Log2(Align) + 1 to allow 0
+  // to mean align of 0.
+  // (stored in bits 8 - 11)
----------------
1?


================
Comment at: llvm/utils/TableGen/X86FoldTablesEmitter.cpp:75
   const char *MemInstStr;
-  UnfoldStrategy Strategy;
+  // uint16_t Strategy;
+  uint16_t Strategy;
----------------
Remove.


================
Comment at: llvm/utils/TableGen/X86FoldTablesEmitter.cpp:237
+    // Comparator function
+    bool operator()(const CodeGenInstruction *LHS,
+                    const CodeGenInstruction *RHS) const {
----------------
Should be a space here.


================
Comment at: llvm/utils/TableGen/X86FoldTablesEmitter.cpp:239
+                    const CodeGenInstruction *RHS) const {
+      bool LHSpseudo = LHS->TheDef->getValueAsBit("isPseudo");
+      bool RHSpseudo = RHS->TheDef->getValueAsBit("isPseudo");
----------------
Add assert to make sure `LHS` and `RHS` not null?


================
Comment at: llvm/utils/TableGen/X86FoldTablesEmitter.cpp:503
+  if (isManual) {
+    Result.CannotUnfold = (S & TB_NO_REVERSE) != 0;
+    Result.CannotFold = (S & TB_NO_FORWARD) != 0;
----------------
How about `!!(S & TB_NO_REVERSE)`?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142084



More information about the llvm-commits mailing list