diff options
author | Jay Foad <jay.foad@gmail.com> | 2011-03-30 11:19:20 +0000 |
---|---|---|
committer | Jay Foad <jay.foad@gmail.com> | 2011-03-30 11:19:20 +0000 |
commit | e0938d8a87a6c8b12f68fbe784a270dd2d552331 (patch) | |
tree | 98d4fbcf8ebe8ec03e205e22d98469b177234a95 /llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp | |
parent | 27e20c3c586da61e5fe9218aa9fe5733e34c18c2 (diff) | |
download | bcm5719-llvm-e0938d8a87a6c8b12f68fbe784a270dd2d552331.tar.gz bcm5719-llvm-e0938d8a87a6c8b12f68fbe784a270dd2d552331.zip |
(Almost) always call reserveOperandSpace() on newly created PHINodes.
llvm-svn: 128535
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp index dcf7be1a91a..9976d82b8be 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp @@ -197,6 +197,7 @@ Value *InstCombiner::EvaluateInDifferentType(Value *V, const Type *Ty, case Instruction::PHI: { PHINode *OPN = cast<PHINode>(I); PHINode *NPN = PHINode::Create(Ty); + NPN->reserveOperandSpace(OPN->getNumIncomingValues()); for (unsigned i = 0, e = OPN->getNumIncomingValues(); i != e; ++i) { Value *V =EvaluateInDifferentType(OPN->getIncomingValue(i), Ty, isSigned); NPN->addIncoming(V, OPN->getIncomingBlock(i)); |