summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/GVN.cpp
diff options
context:
space:
mode:
authorJay Foad <jay.foad@gmail.com>2011-03-30 11:28:46 +0000
committerJay Foad <jay.foad@gmail.com>2011-03-30 11:28:46 +0000
commit52131344a2cbb29f60b75417d32f886032007b1f (patch)
treec82d45a3c7045d0fe4b46727a46b1ede4a8e4e64 /llvm/lib/Transforms/Scalar/GVN.cpp
parente0938d8a87a6c8b12f68fbe784a270dd2d552331 (diff)
downloadbcm5719-llvm-52131344a2cbb29f60b75417d32f886032007b1f.tar.gz
bcm5719-llvm-52131344a2cbb29f60b75417d32f886032007b1f.zip
Remove PHINode::reserveOperandSpace(). Instead, add a parameter to
PHINode::Create() giving the (known or expected) number of operands. llvm-svn: 128537
Diffstat (limited to 'llvm/lib/Transforms/Scalar/GVN.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/GVN.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/GVN.cpp b/llvm/lib/Transforms/Scalar/GVN.cpp
index 9a7591e6c30..45fd665b1cb 100644
--- a/llvm/lib/Transforms/Scalar/GVN.cpp
+++ b/llvm/lib/Transforms/Scalar/GVN.cpp
@@ -1945,10 +1945,9 @@ bool GVN::performPRE(Function &F) {
// Create a PHI to make the value available in this block.
pred_iterator PB = pred_begin(CurrentBlock), PE = pred_end(CurrentBlock);
- PHINode* Phi = PHINode::Create(CurInst->getType(),
+ PHINode* Phi = PHINode::Create(CurInst->getType(), std::distance(PB, PE),
CurInst->getName() + ".pre-phi",
CurrentBlock->begin());
- Phi->reserveOperandSpace(std::distance(PB, PE));
for (pred_iterator PI = PB; PI != PE; ++PI) {
BasicBlock *P = *PI;
Phi->addIncoming(predMap[P], P);
OpenPOWER on IntegriCloud