llvm-project/clang/lib/CodeGen
Anders Carlsson 73f97534b0 Pass a 'ForVTable' flag to GetAddrOfThunk and pass it along to GetOrCreateLLVMFunction so that we
won't assert when building a thunk for an implicit virtual member function that is not marked used.

llvm-svn: 124967
2011-02-05 18:48:55 +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 Add CharUnits::RoundUpToAlignment() to simplify rounding in character units. 2011-01-20 01:59:55 +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 Null initialize a few variables flagged by 2011-01-23 17:04:59 +00:00
CGCXX.cpp Re-land r124768, with a fix for PR9130. 2011-02-05 04:35:53 +00:00
CGCXXABI.cpp More capturing of 'this': implicit member expressions. Getting that 2011-02-03 08:15:49 +00:00
CGCXXABI.h More capturing of 'this': implicit member expressions. Getting that 2011-02-03 08:15:49 +00:00
CGCall.cpp Replace calls to getTypeSize() and getTypeAlign() with their 'InChars' 2011-01-19 01:58:38 +00:00
CGCall.h relax the CGFunctionInfo::CGFunctionInfo ctor to allow any sequence 2010-06-29 18:13:52 +00:00
CGClass.cpp Clean up of -fapple-kext abi code. No change otherwise. 2011-02-03 19:27:17 +00:00
CGCleanup.cpp Move all the cleanups framework code into a single file. 2011-01-28 11:13:47 +00:00
CGCleanup.h Move all the cleanups framework code into a single file. 2011-01-28 11:13:47 +00:00
CGDebugInfo.cpp Emit debug info for template value parameters. 2011-02-02 22:36:18 +00:00
CGDebugInfo.h Debug info generation for rvalue references 2011-01-22 01:58:15 +00:00
CGDecl.cpp Convert the exception-freeing cleanup over to the conditional cleanups code, 2011-01-28 08:37:24 +00:00
CGDeclCXX.cpp Save getObjCGCAttrKind and use it in two places 2011-01-13 21:35:27 +00:00
CGException.cpp Move all the cleanups framework code into a single file. 2011-01-28 11:13:47 +00:00
CGException.h Move all the cleanups framework code into a single file. 2011-01-28 11:13:47 +00:00
CGExpr.cpp More capturing of 'this': implicit member expressions. Getting that 2011-02-03 08:15:49 +00:00
CGExprAgg.cpp Better framework for conditional cleanups; untested as yet. 2011-01-26 04:00:11 +00:00
CGExprCXX.cpp Clean up of -fapple-kext abi code. No change otherwise. 2011-02-03 19:27:17 +00:00
CGExprComplex.cpp Better framework for conditional cleanups; untested as yet. 2011-01-26 04:00:11 +00:00
CGExprConstant.cpp More capturing of 'this': implicit member expressions. Getting that 2011-02-03 08:15:49 +00:00
CGExprScalar.cpp More capturing of 'this': implicit member expressions. Getting that 2011-02-03 08:15:49 +00:00
CGObjC.cpp Replace calls to getTypeSize() and getTypeAlign() with their 'InChars' 2011-01-19 01:58:38 +00:00
CGObjCGNU.cpp Move all the cleanups framework code into a single file. 2011-01-28 11:13:47 +00:00
CGObjCMac.cpp Move all the cleanups framework code into a single file. 2011-01-28 11:13:47 +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 When building with optimizations, emit vtables where the key is not in the 2011-01-30 20:45:54 +00:00
CGRecordLayout.h A CGRecordLayout object persists. Since its contained types may 2010-11-30 23:21:46 +00:00
CGRecordLayoutBuilder.cpp Convert RecordLayout::NonVirtualSize from bit units to CharUnits. 2011-02-01 01:52:10 +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 Fix some obvious bugs in the conditional-cleanup code and then make the 2011-01-26 19:15:39 +00:00
CGVTT.cpp Change CodeGenModule::setTypeVisibility to take a TypeVisibilityKind enum instead of an "IsForRTTI" flag. 2011-01-29 20:24:48 +00:00
CGVTables.cpp Pass a 'ForVTable' flag to GetAddrOfThunk and pass it along to GetOrCreateLLVMFunction so that we 2011-02-05 18:48:55 +00:00
CGVTables.h Make emitting a VTT a two-step process, much like emitting a VTable. You first get the address of the VTT, and then pass it to EmitVTTDefinition. 2011-01-29 19:16:51 +00:00
CGValue.h More capturing of 'this': implicit member expressions. Getting that 2011-02-03 08:15:49 +00:00
CMakeLists.txt Add my new file to the CMake lists, sorry about that. 2011-01-28 20:10:46 +00:00
CodeGenAction.cpp Add -add-plugin flag, which runs plugins in addition to codegen. 2011-01-25 20:34:14 +00:00
CodeGenFunction.cpp Do the right thing for zero-initializing VLAs that don't have a zero 2011-02-01 21:35:06 +00:00
CodeGenFunction.h Clean up of -fapple-kext abi code. No change otherwise. 2011-02-03 19:27:17 +00:00
CodeGenModule.cpp Re-land r124768, with a fix for PR9130. 2011-02-05 04:35:53 +00:00
CodeGenModule.h Pass a 'ForVTable' flag to GetAddrOfThunk and pass it along to GetOrCreateLLVMFunction so that we 2011-02-05 18:48:55 +00:00
CodeGenTBAA.cpp Change QualType::getTypePtr() to return a const pointer, then change a 2011-01-19 06:33:43 +00:00
CodeGenTBAA.h Move name mangling support from CodeGen to AST. In the 2011-01-13 18:57:25 +00:00
CodeGenTypes.cpp Change QualType::getTypePtr() to return a const pointer, then change a 2011-01-19 06:33:43 +00:00
CodeGenTypes.h Change QualType::getTypePtr() to return a const pointer, then change a 2011-01-19 06:33:43 +00:00
GlobalDecl.h Move name mangling support from CodeGen to AST. In the 2011-01-13 18:57:25 +00:00
ItaniumCXXABI.cpp More capturing of 'this': implicit member expressions. Getting that 2011-02-03 08:15:49 +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 Notes on dynamic array cookies in MSVC. 2011-01-27 02:46:02 +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 Add NetBSD target support. Patch by Joerg Sonnenberger. 2011-02-02 18:59:27 +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!

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