[PATCH] D121402: [X86][NFC] Move table from getRelaxedOpcodeArith into its own class
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 11 22:44:38 PST 2022
MaskRay 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!");
+ }
----------------
skan wrote:
> Where did you check the unique after the change??
oh, should use adjacent_find. My bad
================
Comment at: llvm/lib/Target/X86/MCTargetDesc/X86InstrRelaxTables.cpp:132
+
+ sort(Table.begin(), Table.end());
+
----------------
craig.topper wrote:
> MaskRay wrote:
> > `llvm::sort(Table)`
> Does `sort(Table)` work?
llvm::sort is preferred to avoid pitfalls related to argument-dependent lookup, since std::sort exists.
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