llvm-project/clang/lib/CodeGen
Jeffrey Yasskin 8dfa5f1776 Fix warnings found by gcc-4.6, from -Wunused-but-set-variable and
-Wint-to-pointer-cast.

llvm-svn: 123719
2011-01-18 02:00:16 +00:00
..
ABIInfo.h Fix Whitespace. 2010-10-19 06:39:39 +00:00
BackendUtil.cpp Implement -cl-mad-enable 2010-12-04 01:51:33 +00:00
CGBlocks.cpp Move name mangling support from CodeGen to AST. In the 2011-01-13 18:57:25 +00:00
CGBlocks.h IR Gen. part of API support for __block cxx 2010-12-02 17:02:11 +00:00
CGBuilder.h Make CGBuilderTy a typedef again; its functionality has been rolled back 2010-07-06 18:43:48 +00:00
CGBuiltin.cpp Fix a latent bug where, after emitting an expression statement, we would 2011-01-12 03:41:02 +00:00
CGCXX.cpp Move name mangling support from CodeGen to AST. In the 2011-01-13 18:57:25 +00:00
CGCXXABI.cpp Make the destructor be the 'vtable anchor' of the CGCXXABI class. 2010-11-28 17:50:09 +00:00
CGCXXABI.h Move name mangling support from CodeGen to AST. In the 2011-01-13 18:57:25 +00:00
CGCall.cpp Simplify mem{cpy, move, set} creation with IRBuilder. 2010-12-30 00:13:21 +00:00
CGCall.h relax the CGFunctionInfo::CGFunctionInfo ctor to allow any sequence 2010-06-29 18:13:52 +00:00
CGClass.cpp Renamed CXXBaseOrMemberInitializer to CXXCtorInitializer. This is both shorter, 2011-01-08 20:30:50 +00:00
CGDebugInfo.cpp Simplify. 2011-01-17 22:23:07 +00:00
CGDebugInfo.h Simplify. 2011-01-17 22:23:07 +00:00
CGDecl.cpp Move name mangling support from CodeGen to AST. In the 2011-01-13 18:57:25 +00:00
CGDeclCXX.cpp Save getObjCGCAttrKind and use it in two places 2011-01-13 21:35:27 +00:00
CGException.cpp Fix a latent bug where, after emitting an expression statement, we would 2011-01-12 03:41:02 +00:00
CGException.h ARM EH uses a different personality function in C. 2010-11-07 02:35:25 +00:00
CGExpr.cpp Fix warnings found by gcc-4.6, from -Wunused-but-set-variable and 2011-01-18 02:00:16 +00:00
CGExprAgg.cpp Ensure an insertion point at the end of a statement-expression. 2011-01-13 02:03:06 +00:00
CGExprCXX.cpp Simplify mem{cpy, move, set} creation with IRBuilder. 2010-12-30 00:13:21 +00:00
CGExprComplex.cpp Fix warnings found by gcc-4.6, from -Wunused-but-set-variable and 2011-01-18 02:00:16 +00:00
CGExprConstant.cpp PR5207: Change APInt methods trunc(), sext(), zext(), sextOrTrunc() and 2010-12-07 08:25:34 +00:00
CGExprScalar.cpp Ensure an insertion point at the end of a statement-expression. 2011-01-13 02:03:06 +00:00
CGObjC.cpp Fix warnings found by gcc-4.6, from -Wunused-but-set-variable and 2011-01-18 02:00:16 +00:00
CGObjCGNU.cpp Add support for GNU runtime property set / get structure functions. Minor refactoring of Mac runtime (returns the same function for both, as the Mac runtimes currently only provide a single entry point for setting and getting struct properties, although this will presumably be fixed at some point). 2010-12-26 22:13:16 +00:00
CGObjCMac.cpp Consider zero-length array of structs when 2011-01-03 19:23:18 +00:00
CGObjCRuntime.h Add support for GNU runtime property set / get structure functions. Minor refactoring of Mac runtime (returns the same function for both, as the Mac runtimes currently only provide a single entry point for setting and getting struct properties, although this will presumably be fixed at some point). 2010-12-26 22:13:16 +00:00
CGRTTI.cpp Set unnamed_addr in every type info. 2011-01-11 23:55:05 +00:00
CGRecordLayout.h A CGRecordLayout object persists. Since its contained types may 2010-11-30 23:21:46 +00:00
CGRecordLayoutBuilder.cpp Fix another obscure corner layout case. 2010-12-10 00:11:00 +00:00
CGStmt.cpp Fix a latent bug where, after emitting an expression statement, we would 2011-01-12 03:41:02 +00:00
CGTemporaries.cpp Rename CXXExprWithTemporaries -> ExprWithCleanups; there's no theoretical 2010-12-06 08:20:24 +00:00
CGVTT.cpp Also set unnamed_addr on declarations. 2011-01-15 08:23:14 +00:00
CGVTables.cpp Also set unnamed_addr on declarations. 2011-01-15 08:23:14 +00:00
CGVTables.h Move name mangling support from CodeGen to AST. In the 2011-01-13 18:57:25 +00:00
CGValue.h Kill the KVC l-value kind and calculate the base expression when emitting 2010-12-04 02:32:38 +00:00
CMakeLists.txt Move name mangling support from CodeGen to AST. In the 2011-01-13 18:57:25 +00:00
CodeGenAction.cpp Refactoring of Diagnostic class. 2010-11-18 20:06:41 +00:00
CodeGenFunction.cpp Support the zero-initialization of VLAs when that really means a zero 2011-01-14 10:37:58 +00:00
CodeGenFunction.h Move name mangling support from CodeGen to AST. In the 2011-01-13 18:57:25 +00:00
CodeGenModule.cpp More unnamed_addr. 2011-01-17 22:22:52 +00:00
CodeGenModule.h Move name mangling support from CodeGen to AST. In the 2011-01-13 18:57:25 +00:00
CodeGenTBAA.cpp Move name mangling support from CodeGen to AST. In the 2011-01-13 18:57:25 +00:00
CodeGenTBAA.h Move name mangling support from CodeGen to AST. In the 2011-01-13 18:57:25 +00:00
CodeGenTypes.cpp The -fshort-wchar option causes wchar_t to become unsigned, in addition to being 2010-12-25 23:25:43 +00:00
CodeGenTypes.h Make CodeGenTypes::getCGRecordLayout compute the layout lazily if it doesn't exist. This matches ASTContext::getASTRecordLayout and is less confusing. 2010-11-24 19:51:04 +00:00
GlobalDecl.h Move name mangling support from CodeGen to AST. In the 2011-01-13 18:57:25 +00:00
ItaniumCXXABI.cpp Fix warnings found by gcc-4.6, from -Wunused-but-set-variable and 2011-01-18 02:00:16 +00:00
Makefile BUILD_ARCHIVE is the default for libraries, no need to set it. 2010-07-18 00:14:47 +00:00
MicrosoftCXXABI.cpp Move name mangling support from CodeGen to AST. In the 2011-01-13 18:57:25 +00:00
ModuleBuilder.cpp Move CodeGenOptions.h *back* into Frontend. This should have been done when the 2010-06-15 23:19:56 +00:00
README.txt These IRgen improvements have been done. 2009-07-23 03:03:07 +00:00
TargetInfo.cpp lib/CodeGen/TargetInfo.cpp: Add Win64 calling conversion. 2011-01-17 22:56:31 +00:00
TargetInfo.h Fix the IR generation for catching pointers by references. 2010-07-20 22:17:55 +00:00

README.txt

IRgen optimization opportunities.

//===---------------------------------------------------------------------===//

The common pattern of
--
short x; // or char, etc
(x == 10)
--
generates an zext/sext of x which can easily be avoided.

//===---------------------------------------------------------------------===//

Bitfields accesses can be shifted to simplify masking and sign
extension. For example, if the bitfield width is 8 and it is
appropriately aligned then is is a lot shorter to just load the char
directly.

//===---------------------------------------------------------------------===//

It may be worth avoiding creation of alloca's for formal arguments
for the common situation where the argument is never written to or has
its address taken. The idea would be to begin generating code by using
the argument directly and if its address is taken or it is stored to
then generate the alloca and patch up the existing code.

In theory, the same optimization could be a win for block local
variables as long as the declaration dominates all statements in the
block.

NOTE: The main case we care about this for is for -O0 -g compile time
performance, and in that scenario we will need to emit the alloca
anyway currently to emit proper debug info. So this is blocked by
being able to emit debug information which refers to an LLVM
temporary, not an alloca.

//===---------------------------------------------------------------------===//

We should try and avoid generating basic blocks which only contain
jumps. At -O0, this penalizes us all the way from IRgen (malloc &
instruction overhead), all the way down through code generation and
assembly time.

On 176.gcc:expr.ll, it looks like over 12% of basic blocks are just
direct branches!

//===---------------------------------------------------------------------===//