From e0938d8a87a6c8b12f68fbe784a270dd2d552331 Mon Sep 17 00:00:00 2001 From: Jay Foad Date: Wed, 30 Mar 2011 11:19:20 +0000 Subject: (Almost) always call reserveOperandSpace() on newly created PHINodes. llvm-svn: 128535 --- llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp') diff --git a/llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp b/llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp index ccb8287d796..24d20d0e84d 100644 --- a/llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp +++ b/llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp @@ -117,6 +117,7 @@ bool UnifyFunctionExitNodes::runOnFunction(Function &F) { } else { // If the function doesn't return void... add a PHI node to the block... PN = PHINode::Create(F.getReturnType(), "UnifiedRetVal"); + PN->reserveOperandSpace(ReturningBlocks.size()); NewRetBlock->getInstList().push_back(PN); ReturnInst::Create(F.getContext(), PN, NewRetBlock); } -- cgit v1.2.3