From 3403084886b3d0fc23eee2b5708f0ac0329423e0 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 22 Mar 2009 00:32:22 +0000 Subject: [PATCH] don't set the name of a call instruction to "call" in release-asserts build. This shaves another 3% off. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67460 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGCall.cpp | 19 +++++++++---------- lib/CodeGen/CGDecl.cpp | 2 +- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp index fd33b50e79..d7f52c6295 100644 --- a/lib/CodeGen/CGCall.cpp +++ b/lib/CodeGen/CGCall.cpp @@ -1815,29 +1815,29 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo, } 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 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo, 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: diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp index 49ac20a9bc..acf16561cc 100644 --- a/lib/CodeGen/CGDecl.cpp +++ b/lib/CodeGen/CGDecl.cpp @@ -237,7 +237,7 @@ void CodeGenFunction::EmitLocalBlockVarDecl(const VarDecl &D) { 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; -- 2.40.0