]> granicus.if.org Git - llvm/commitdiff
TableGen/AsmMatcherEmitter: Trust that stable_sort works
authorMatthias Braun <matze@braunis.de>
Mon, 5 Dec 2016 08:15:57 +0000 (08:15 +0000)
committerMatthias Braun <matze@braunis.de>
Mon, 5 Dec 2016 08:15:57 +0000 (08:15 +0000)
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

utils/TableGen/AsmMatcherEmitter.cpp

index a403ab7d6b5101a8cc6db4d3f1d2233ec2b3c4f8..a8a984db19b6b4abcf5b5f50b37b4415f1525a49 100644 (file)
@@ -2719,16 +2719,6 @@ void AsmMatcherEmitter::run(raw_ostream &OS) {
                       const std::unique_ptr<MatchableInfo> &b){
                      return *a < *b;});
 
-#ifndef NDEBUG
-  // Verify that the table is now sorted
-  for (auto I = Info.Matchables.begin(), E = Info.Matchables.end(); I != E;
-       ++I) {
-    for (auto J = I; J != E; ++J) {
-      assert(!(**J < **I));
-    }
-  }
-#endif // NDEBUG
-
   DEBUG_WITH_TYPE("instruction_info", {
       for (const auto &MI : Info.Matchables)
         MI->dump();