diff options
author | Reid Kleckner <rnk@google.com> | 2016-02-03 19:34:28 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2016-02-03 19:34:28 +0000 |
commit | 45b6159ed34dd4ce6e58ac67d66044b057d9001f (patch) | |
tree | 43058b5501437557d70d25d988b6e78dda579980 /llvm/utils/TableGen/CodeGenInstruction.cpp | |
parent | f42ef3efcad9095920232a0a710a80c5c4720170 (diff) | |
download | bcm5719-llvm-45b6159ed34dd4ce6e58ac67d66044b057d9001f.tar.gz bcm5719-llvm-45b6159ed34dd4ce6e58ac67d66044b057d9001f.zip |
Minor performance tweaks to llvm-tblgen (and a few that might be a good idea)
Summary:
This patch adds a reserve call to an expensive function
(`llvm::LoadIntrinsics`), and may fix a few other low hanging
performance fruit (I've put them in comments for now, so we can
discuss).
**Motivation:**
As I'm sure other developers do, when I build LLVM, I build the entire
project with the same config (`Debug`, `MinSizeRel`, `Release`, or
`RelWithDebInfo`). However, the `Debug` config also builds llvm-tblgen
in `Debug` mode. Later build steps that run llvm-tblgen then can
actually be the slowest steps in the entire build. Nobody likes slow
builds.
Reviewers: rnk, dblaikie
Differential Revision: http://reviews.llvm.org/D16832
Patch by Alexander G. Riccio
llvm-svn: 259683
Diffstat (limited to 'llvm/utils/TableGen/CodeGenInstruction.cpp')
-rw-r--r-- | llvm/utils/TableGen/CodeGenInstruction.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/utils/TableGen/CodeGenInstruction.cpp b/llvm/utils/TableGen/CodeGenInstruction.cpp index 366e8ec7fac..bd26beb3567 100644 --- a/llvm/utils/TableGen/CodeGenInstruction.cpp +++ b/llvm/utils/TableGen/CodeGenInstruction.cpp @@ -49,7 +49,9 @@ CGIOperandList::CGIOperandList(Record *R) : TheDef(R) { unsigned MIOperandNo = 0; std::set<std::string> OperandNames; - for (unsigned i = 0, e = InDI->getNumArgs()+OutDI->getNumArgs(); i != e; ++i){ + unsigned e = InDI->getNumArgs() + OutDI->getNumArgs(); + OperandList.reserve(e); + for (unsigned i = 0; i != e; ++i){ Init *ArgInit; std::string ArgName; if (i < NumDefs) { |