[PATCH] D121402: [X86][NFC] Move table from getRelaxedOpcodeArith into its own class

Kan Shengchen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 11 22:41:41 PST 2022


skan added inline comments.


================
Comment at: llvm/lib/Target/X86/MCTargetDesc/X86InstrRelaxTables.cpp:134
+    // Now that it's sorted, ensure its unique.
+    assert(llvm::is_sorted(Table) && "Short form table is not unique!");
+  }
----------------
Where did you check the unique after the change??


================
Comment at: llvm/lib/Target/X86/MCTargetDesc/X86InstrRelaxTables.cpp:138
+
+  void addTableEntry(const X86InstrRelaxTableEntry &Entry) {
+    Table.push_back({Entry.DstOp, Entry.KeyOp});
----------------
craig.topper wrote:
> Does this method provide much value versus calling push_back directly in the loop?
https://llvm.org/doxygen/classllvm_1_1ManagedStatic.html I think the ShortTable is seldom used, AFAIK, it is used only bolt. So we avoid the construction at most of the time.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121402



More information about the llvm-commits mailing list