[cfe-commits] r67460 - in /cfe/trunk/lib/CodeGen: CGCall.cpp CGDecl.cpp

Chris Lattner sabre at nondot.org
Sat Mar 21 17:32:22 PDT 2009


Author: lattner
Date: Sat Mar 21 19:32:22 2009
New Revision: 67460

URL: http://llvm.org/viewvc/llvm-project?rev=67460&view=rev
Log:
don't set the name of a call instruction to "call" in release-asserts 
build.  This shaves another 3% off.

Modified:
    cfe/trunk/lib/CodeGen/CGCall.cpp
    cfe/trunk/lib/CodeGen/CGDecl.cpp

Modified: cfe/trunk/lib/CodeGen/CGCall.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCall.cpp?rev=67460&r1=67459&r2=67460&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGCall.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCall.cpp Sat Mar 21 19:32:22 2009
@@ -1815,29 +1815,29 @@
   }    
 
   llvm::Instruction *CI = CS.getInstruction();
-  if (CI->getType() != llvm::Type::VoidTy)
+  if (Builder.isNamePreserving() && CI->getType() != llvm::Type::VoidTy)
     CI->setName("call");
 
   switch (RetAI.getKind()) {
   case ABIArgInfo::Indirect:
     if (RetTy->isAnyComplexType())
       return RValue::getComplex(LoadComplexFromAddr(Args[0], false));
-    else if (CodeGenFunction::hasAggregateLLVMType(RetTy))
+    if (CodeGenFunction::hasAggregateLLVMType(RetTy))
       return RValue::getAggregate(Args[0]);
-    else 
-      return RValue::get(EmitLoadOfScalar(Args[0], false, RetTy));
+    return RValue::get(EmitLoadOfScalar(Args[0], false, RetTy));
 
   case ABIArgInfo::Direct:
     if (RetTy->isAnyComplexType()) {
       llvm::Value *Real = Builder.CreateExtractValue(CI, 0);
       llvm::Value *Imag = Builder.CreateExtractValue(CI, 1);
       return RValue::getComplex(std::make_pair(Real, Imag));
-    } else if (CodeGenFunction::hasAggregateLLVMType(RetTy)) {
+    }
+    if (CodeGenFunction::hasAggregateLLVMType(RetTy)) {
       llvm::Value *V = CreateTempAlloca(ConvertTypeForMem(RetTy), "agg.tmp");
       Builder.CreateStore(CI, V);
       return RValue::getAggregate(V);
-    } else
-      return RValue::get(CI);
+    }
+    return RValue::get(CI);
 
   case ABIArgInfo::Ignore:
     // If we are ignoring an argument that had a result, make sure to
@@ -1850,10 +1850,9 @@
     CreateCoercedStore(CI, V, *this);
     if (RetTy->isAnyComplexType())
       return RValue::getComplex(LoadComplexFromAddr(V, false));
-    else if (CodeGenFunction::hasAggregateLLVMType(RetTy))
+    if (CodeGenFunction::hasAggregateLLVMType(RetTy))
       return RValue::getAggregate(V);
-    else
-      return RValue::get(EmitLoadOfScalar(V, false, RetTy));
+    return RValue::get(EmitLoadOfScalar(V, false, RetTy));
   }
 
   case ABIArgInfo::Expand:

Modified: cfe/trunk/lib/CodeGen/CGDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDecl.cpp?rev=67460&r1=67459&r2=67460&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGDecl.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDecl.cpp Sat Mar 21 19:32:22 2009
@@ -237,7 +237,7 @@
       
       if (isByRef)
         Alloc->setAlignment(std::max(getContext().getDeclAlignInBytes(&D),
-                                     getContext().getTypeAlign(getContext().VoidPtrTy) / 8));
+                                     unsigned(Target.getPointerAlign(0) / 8)));
       else
         Alloc->setAlignment(getContext().getDeclAlignInBytes(&D));
       DeclPtr = Alloc;





More information about the cfe-commits mailing list