diff options
author | Chris Lattner <sabre@nondot.org> | 2010-03-19 01:07:44 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-03-19 01:07:44 +0000 |
commit | e14d2e210dc7fe28009f44818a057622a73322e4 (patch) | |
tree | 11dfa7f51cfb967dcfc7e8a68fb26b250371b3c5 /utils/TableGen/InstrInfoEmitter.cpp | |
parent | 6a91b18e5777f39e52e93221453abfa4553b6f93 (diff) | |
download | llvm-e14d2e210dc7fe28009f44818a057622a73322e4.tar.gz llvm-e14d2e210dc7fe28009f44818a057622a73322e4.tar.bz2 llvm-e14d2e210dc7fe28009f44818a057622a73322e4.tar.xz |
Finally change the instruction looking map to be a densemap from
record* -> instrinfo instead of std::string -> instrinfo.
This speeds up tblgen on cellcpu from 7.28 -> 5.98s with a debug
build (20%).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98916 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/InstrInfoEmitter.cpp')
-rw-r--r-- | utils/TableGen/InstrInfoEmitter.cpp | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/utils/TableGen/InstrInfoEmitter.cpp b/utils/TableGen/InstrInfoEmitter.cpp index 72c4e73ca1..8f7550b848 100644 --- a/utils/TableGen/InstrInfoEmitter.cpp +++ b/utils/TableGen/InstrInfoEmitter.cpp @@ -39,16 +39,10 @@ static void PrintBarriers(std::vector<Record*> &Barriers, // Instruction Itinerary Information. //===----------------------------------------------------------------------===// -struct RecordNameComparator { - bool operator()(const Record *Rec1, const Record *Rec2) const { - return Rec1->getName() < Rec2->getName(); - } -}; - void InstrInfoEmitter::GatherItinClasses() { std::vector<Record*> DefList = Records.getAllDerivedDefinitions("InstrItinClass"); - std::sort(DefList.begin(), DefList.end(), RecordNameComparator()); + std::sort(DefList.begin(), DefList.end(), LessRecord()); for (unsigned i = 0, N = DefList.size(); i < N; i++) ItinClassMap[DefList[i]->getName()] = i; |