Skip to content

Commit 25801f0

Browse files
committed
TableGen/AsmMatcherEmitter: Trust that stable_sort works
A debug build of AsmMatcherEmitter would use a quadratic algorithm to check whether std::stable_sort() actually sorted. Let's hope the authors of our C++ standard library did that testing for us. Removing the check gives a 3x speedup in the X86 case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288655 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 2b86a87 commit 25801f0

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

utils/TableGen/AsmMatcherEmitter.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2719,16 +2719,6 @@ void AsmMatcherEmitter::run(raw_ostream &OS) {
27192719
const std::unique_ptr<MatchableInfo> &b){
27202720
return *a < *b;});
27212721

2722-
#ifndef NDEBUG
2723-
// Verify that the table is now sorted
2724-
for (auto I = Info.Matchables.begin(), E = Info.Matchables.end(); I != E;
2725-
++I) {
2726-
for (auto J = I; J != E; ++J) {
2727-
assert(!(**J < **I));
2728-
}
2729-
}
2730-
#endif // NDEBUG
2731-
27322722
DEBUG_WITH_TYPE("instruction_info", {
27332723
for (const auto &MI : Info.Matchables)
27342724
MI->dump();

0 commit comments

Comments
 (0)