[cfe-commits] r128534 - in /cfe/trunk/lib/CodeGen: CGBuiltin.cpp CGObjC.cpp CGObjCGNU.cpp

Jay Foad jay.foad at gmail.com
Wed Mar 30 04:19:06 PDT 2011


Author: foad
Date: Wed Mar 30 06:19:06 2011
New Revision: 128534

URL: http://llvm.org/viewvc/llvm-project?rev=128534&view=rev
Log:
(Almost) always call reserveOperandSpace() on newly created PHINodes.

Modified:
    cfe/trunk/lib/CodeGen/CGBuiltin.cpp
    cfe/trunk/lib/CodeGen/CGObjC.cpp
    cfe/trunk/lib/CodeGen/CGObjCGNU.cpp

Modified: cfe/trunk/lib/CodeGen/CGBuiltin.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBuiltin.cpp?rev=128534&r1=128533&r2=128534&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGBuiltin.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBuiltin.cpp Wed Mar 30 06:19:06 2011
@@ -475,6 +475,7 @@
     PHINode *Result =
       Builder.CreatePHI(ConvertType(E->getArg(0)->getType()),
                         "fpclassify_result");
+    Result->reserveOperandSpace(4);
 
     // if (V==0) return FP_ZERO
     Builder.SetInsertPoint(Begin);

Modified: cfe/trunk/lib/CodeGen/CGObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjC.cpp?rev=128534&r1=128533&r2=128534&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjC.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjC.cpp Wed Mar 30 06:19:06 2011
@@ -831,10 +831,12 @@
 
   // 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

Modified: cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCGNU.cpp?rev=128534&r1=128533&r2=128534&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCGNU.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCGNU.cpp Wed Mar 30 06:19:06 2011
@@ -1145,6 +1145,7 @@
     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 @@
           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);





More information about the cfe-commits mailing list