diff options
author | Chris Lattner <sabre@nondot.org> | 2003-10-09 22:46:58 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-10-09 22:46:58 +0000 |
commit | 4c52392ba35a763a3113f373bfb102791f8ac520 (patch) | |
tree | 6a0b0e1cb4a3ceb5bbc00c49d61c0b9c6e3e152b /lib/Bytecode/Reader | |
parent | 97622b1751228fa0481a8b1a22aa364b396c5931 (diff) | |
download | external_llvm-4c52392ba35a763a3113f373bfb102791f8ac520.zip external_llvm-4c52392ba35a763a3113f373bfb102791f8ac520.tar.gz external_llvm-4c52392ba35a763a3113f373bfb102791f8ac520.tar.bz2 |
Reserve space for PHI nodes when we read them in. This provides a VERY
tasty 15% speedup on the testcase from Bill.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8993 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode/Reader')
-rw-r--r-- | lib/Bytecode/Reader/InstructionReader.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/Bytecode/Reader/InstructionReader.cpp b/lib/Bytecode/Reader/InstructionReader.cpp index a763d66..b415025 100644 --- a/lib/Bytecode/Reader/InstructionReader.cpp +++ b/lib/Bytecode/Reader/InstructionReader.cpp @@ -125,6 +125,7 @@ Instruction *BytecodeParser::ParseInstruction(const unsigned char *&Buf, throw std::string("Invalid phi node encountered!\n"); PHINode *PN = new PHINode(InstTy); + PN->op_reserve(Args.size()); for (unsigned i = 0, e = Args.size(); i != e; i += 2) PN->addIncoming(getValue(RI.Type, Args[i]), getBasicBlock(Args[i+1])); return PN; |