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

Daniel Dunbar daniel at zuster.org
Sat Mar 21 17:49:03 PDT 2009


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.

What do you think?

 - Daniel

2009/3/21 Chris Lattner <sabre at nondot.org>

> 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;
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20090321/d1bc9cbb/attachment.html>


More information about the cfe-commits mailing list