summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bytecode/Reader/InstructionReader.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-10-09 22:46:58 +0000
committerChris Lattner <sabre@nondot.org>2003-10-09 22:46:58 +0000
commit2ec9de30cd9dbc4d02e1a3f47a6cf988166e681b (patch)
tree4d5e45f45f2cf2d03019c21bc5fd71ae25381962 /llvm/lib/Bytecode/Reader/InstructionReader.cpp
parent5a485c811717f666b30543706a6bb00246bd0e71 (diff)
downloadbcm5719-llvm-2ec9de30cd9dbc4d02e1a3f47a6cf988166e681b.tar.gz
bcm5719-llvm-2ec9de30cd9dbc4d02e1a3f47a6cf988166e681b.zip
Reserve space for PHI nodes when we read them in. This provides a VERY
tasty 15% speedup on the testcase from Bill. llvm-svn: 8993
Diffstat (limited to 'llvm/lib/Bytecode/Reader/InstructionReader.cpp')
-rw-r--r--llvm/lib/Bytecode/Reader/InstructionReader.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Bytecode/Reader/InstructionReader.cpp b/llvm/lib/Bytecode/Reader/InstructionReader.cpp
index a763d66b227..b415025a578 100644
--- a/llvm/lib/Bytecode/Reader/InstructionReader.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud