summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Foad <jay.foad@gmail.com>2011-03-30 11:19:06 +0000
committerJay Foad <jay.foad@gmail.com>2011-03-30 11:19:06 +0000
commit27e20c3c586da61e5fe9218aa9fe5733e34c18c2 (patch)
tree1495929e009e298d49e7d06d3d7b8588b3906923
parentb3ba775523842d15385802a788e02cb8ddf60cdf (diff)
downloadbcm5719-llvm-27e20c3c586da61e5fe9218aa9fe5733e34c18c2.tar.gz
bcm5719-llvm-27e20c3c586da61e5fe9218aa9fe5733e34c18c2.zip
(Almost) always call reserveOperandSpace() on newly created PHINodes.
llvm-svn: 128534
-rw-r--r--clang/lib/CodeGen/CGBuiltin.cpp1
-rw-r--r--clang/lib/CodeGen/CGObjC.cpp2
-rw-r--r--clang/lib/CodeGen/CGObjCGNU.cpp4
3 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp
index e6b6ee92c03..c998372d994 100644
--- a/clang/lib/CodeGen/CGBuiltin.cpp
+++ b/clang/lib/CodeGen/CGBuiltin.cpp
@@ -475,6 +475,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const FunctionDecl *FD,
PHINode *Result =
Builder.CreatePHI(ConvertType(E->getArg(0)->getType()),
"fpclassify_result");
+ Result->reserveOperandSpace(4);
// if (V==0) return FP_ZERO
Builder.SetInsertPoint(Begin);
diff --git a/clang/lib/CodeGen/CGObjC.cpp b/clang/lib/CodeGen/CGObjC.cpp
index dcdd81d1f84..386fd95593e 100644
--- a/clang/lib/CodeGen/CGObjC.cpp
+++ b/clang/lib/CodeGen/CGObjC.cpp
@@ -831,10 +831,12 @@ void CodeGenFunction::EmitObjCForCollectionStmt(const ObjCForCollectionStmt &S){
// The current index into the buffer.
llvm::PHINode *index = Builder.CreatePHI(UnsignedLongLTy, "forcoll.index");
+ index->reserveOperandSpace(3);
index->addIncoming(zero, LoopInitBB);
// The current buffer size.
llvm::PHINode *count = Builder.CreatePHI(UnsignedLongLTy, "forcoll.count");
+ count->reserveOperandSpace(3);
count->addIncoming(initialBufferLimit, LoopInitBB);
// Check whether the mutations value has changed from where it was
diff --git a/clang/lib/CodeGen/CGObjCGNU.cpp b/clang/lib/CodeGen/CGObjCGNU.cpp
index bea6f3a94c1..8611c5f9104 100644
--- a/clang/lib/CodeGen/CGObjCGNU.cpp
+++ b/clang/lib/CodeGen/CGObjCGNU.cpp
@@ -1145,6 +1145,7 @@ CGObjCGNU::GenerateMessageSend(CodeGenFunction &CGF,
if (msgRet.isScalar()) {
llvm::Value *v = msgRet.getScalarVal();
llvm::PHINode *phi = Builder.CreatePHI(v->getType());
+ phi->reserveOperandSpace(2);
phi->addIncoming(v, messageBB);
phi->addIncoming(llvm::Constant::getNullValue(v->getType()), startBB);
msgRet = RValue::get(phi);
@@ -1156,16 +1157,19 @@ CGObjCGNU::GenerateMessageSend(CodeGenFunction &CGF,
CGF.CreateTempAlloca(RetTy->getElementType(), "null");
CGF.InitTempAlloca(NullVal,
llvm::Constant::getNullValue(RetTy->getElementType()));
+ phi->reserveOperandSpace(2);
phi->addIncoming(v, messageBB);
phi->addIncoming(NullVal, startBB);
msgRet = RValue::getAggregate(phi);
} else /* isComplex() */ {
std::pair<llvm::Value*,llvm::Value*> v = msgRet.getComplexVal();
llvm::PHINode *phi = Builder.CreatePHI(v.first->getType());
+ phi->reserveOperandSpace(2);
phi->addIncoming(v.first, messageBB);
phi->addIncoming(llvm::Constant::getNullValue(v.first->getType()),
startBB);
llvm::PHINode *phi2 = Builder.CreatePHI(v.second->getType());
+ phi2->reserveOperandSpace(2);
phi2->addIncoming(v.second, messageBB);
phi2->addIncoming(llvm::Constant::getNullValue(v.second->getType()),
startBB);
OpenPOWER on IntegriCloud