Along this train; I think that we should probably just drop all names that are generic. "call" isn't really better than %n (or %tmpn) and it doesn't seem worth littering the code. If someone cares about having generic names, we can always just make the instnamer pass a little more friendly.<br>
<br>What do you think?<br><br> - Daniel<br><br><div class="gmail_quote">2009/3/21 Chris Lattner <span dir="ltr"><<a href="mailto:sabre@nondot.org">sabre@nondot.org</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Author: lattner<br>
Date: Sat Mar 21 19:32:22 2009<br>
New Revision: 67460<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=67460&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=67460&view=rev</a><br>
Log:<br>
don't set the name of a call instruction to "call" in release-asserts<br>
build.  This shaves another 3% off.<br>
<br>
Modified:<br>
    cfe/trunk/lib/CodeGen/CGCall.cpp<br>
    cfe/trunk/lib/CodeGen/CGDecl.cpp<br>
<br>
Modified: cfe/trunk/lib/CodeGen/CGCall.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCall.cpp?rev=67460&r1=67459&r2=67460&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCall.cpp?rev=67460&r1=67459&r2=67460&view=diff</a><br>

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

<br>
==============================================================================<br>
--- cfe/trunk/lib/CodeGen/CGDecl.cpp (original)<br>
+++ cfe/trunk/lib/CodeGen/CGDecl.cpp Sat Mar 21 19:32:22 2009<br>
@@ -237,7 +237,7 @@<br>
<br>
       if (isByRef)<br>
         Alloc->setAlignment(std::max(getContext().getDeclAlignInBytes(&D),<br>
-                                     getContext().getTypeAlign(getContext().VoidPtrTy) / 8));<br>
+                                     unsigned(Target.getPointerAlign(0) / 8)));<br>
       else<br>
         Alloc->setAlignment(getContext().getDeclAlignInBytes(&D));<br>
       DeclPtr = Alloc;<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br>