summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/ScalarEvolutionExpander.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/Analysis/ScalarEvolutionExpander.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/Analysis/ScalarEvolutionExpander.cpp')
-rw-r--r--llvm/lib/Analysis/ScalarEvolutionExpander.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp b/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
index f506514a618..8e5a40008d8 100644
--- a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
+++ b/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
@@ -935,8 +935,7 @@ SCEVExpander::getAddRecExprPHILiterally(const SCEVAddRecExpr *Normalized,
BasicBlock *Header = L->getHeader();
Builder.SetInsertPoint(Header, Header->begin());
pred_iterator HPB = pred_begin(Header), HPE = pred_end(Header);
- PHINode *PN = Builder.CreatePHI(ExpandTy, "lsr.iv");
- PN->reserveOperandSpace(std::distance(HPB, HPE));
+ PHINode *PN = Builder.CreatePHI(ExpandTy, std::distance(HPB, HPE), "lsr.iv");
rememberInstruction(PN);
// Create the step instructions and populate the PHI.
@@ -1143,8 +1142,8 @@ Value *SCEVExpander::visitAddRecExpr(const SCEVAddRecExpr *S) {
// specified loop.
BasicBlock *Header = L->getHeader();
pred_iterator HPB = pred_begin(Header), HPE = pred_end(Header);
- CanonicalIV = PHINode::Create(Ty, "indvar", Header->begin());
- CanonicalIV->reserveOperandSpace(std::distance(HPB, HPE));
+ CanonicalIV = PHINode::Create(Ty, std::distance(HPB, HPE), "indvar",
+ Header->begin());
rememberInstruction(CanonicalIV);
Constant *One = ConstantInt::get(Ty, 1);
OpenPOWER on IntegriCloud