Make more use of PHINode::getNumIncomingValues().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128406 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jay Foad
2011-03-28 13:03:10 +00:00
parent fb4a8344b6
commit fd4a5497b6
2 changed files with 5 additions and 5 deletions

View File

@ -601,7 +601,7 @@ Instruction *InstCombiner::FoldOpIntoPhi(Instruction &I) {
// Okay, we can do the transformation: create the new PHI node.
PHINode *NewPN = PHINode::Create(I.getType(), "");
NewPN->reserveOperandSpace(PN->getNumOperands()/2);
NewPN->reserveOperandSpace(PN->getNumIncomingValues());
InsertNewInstBefore(NewPN, *PN);
NewPN->takeName(PN);