llvm-project/clang/lib/CodeGen
Anders Carlsson 7bb7076b51 Change getIndex to return false if the index wasn't found. Avoids an extra hash lookup.
llvm-svn: 90568
2009-12-04 15:49:02 +00:00
..
ABIInfo.h x86-64 ABI: If a type is a C++ record with either a non-trivial destructor or a non-trivial copy constructor, it should be passed in a pointer. Daniel, plz review. 2009-09-16 15:53:40 +00:00
CGBlocks.cpp Don't pass false (default) for isVolatile parameter to CreateLoad. 2009-11-29 21:23:36 +00:00
CGBlocks.h Added block type introspection support. 2009-11-17 19:33:30 +00:00
CGBuilder.h Disable generation of basic block names in NDEBUG mode. 2008-11-12 00:01:12 +00:00
CGBuiltin.cpp Update for llvm intrinsics change. 2009-12-01 05:00:51 +00:00
CGCXX.cpp Fix thunk generation for thunks with a parameter with reference type. 2009-12-03 04:49:52 +00:00
CGCXX.h Remove tabs, and whitespace cleanups. 2009-09-09 15:08:12 +00:00
CGCall.cpp Make functions returning a struct indirectly evaluate the returned struct 2009-12-04 02:43:40 +00:00
CGCall.h Change CodeGenModule::ConstructTypeAttributes to return the calling convention 2009-09-12 00:59:20 +00:00
CGClass.cpp Add CodeGenModule::ComputeThunkAdjustment, which Eli wrote. 2009-12-03 03:06:55 +00:00
CGDebugInfo.cpp Move MainFileName option variable into CodeGenOptions instead of LangOptions. 2009-11-29 02:38:34 +00:00
CGDebugInfo.h Do not store DIDescriptor directly into a container. Store MDNode directly, through TrackingVH. 2009-11-13 19:10:24 +00:00
CGDecl.cpp Handle static_assert inside functions. 2009-12-03 17:26:31 +00:00
CGException.cpp Try/catch statements seem to be working well enough to turn on. 2009-12-04 03:57:07 +00:00
CGExpr.cpp Make EmitStoreOfScalar generate a more sane representation of boolean stores. 2009-12-01 22:31:51 +00:00
CGExprAgg.cpp Update chunk of #if 0'ed code to remove fixed FIXME and make it compile. We 2009-12-04 01:30:56 +00:00
CGExprCXX.cpp Change rtti/Rtti to RTTI, as it is an acronym. 2009-12-02 18:57:08 +00:00
CGExprComplex.cpp Simplify code. No functionality change. 2009-11-29 19:51:45 +00:00
CGExprConstant.cpp Remove remaining VISIBILITY_HIDDEN from anonymous namespaces. 2009-11-28 19:45:26 +00:00
CGExprScalar.cpp Don't pass false (default) for isVolatile parameter to CreateLoad. 2009-11-29 21:23:36 +00:00
CGObjC.cpp Fix crash when synthesizing property setters when the property type and ivar 2009-10-27 19:21:30 +00:00
CGObjCGNU.cpp Change LangOptions::ObjCConstantStringClass to an std::string to avoid worrying about the lifetime. 2009-11-29 02:38:47 +00:00
CGObjCMac.cpp (objc2 nonfragile-abi specific). If the translation unit includes an implementation 2009-12-01 18:25:24 +00:00
CGObjCRuntime.h Patch fixes a code gen. bug in generation of objc_assign_ivar 2009-09-24 22:25:38 +00:00
CGRTTI.cpp Put the Builder classes into the anonymous namespace. 2009-12-02 19:07:44 +00:00
CGRecordLayoutBuilder.cpp Have ASTRecordLayout keep track of the key function, in preparation of fixing a synthetic ctor/dtor bug. 2009-11-30 23:41:22 +00:00
CGRecordLayoutBuilder.h Update location of DataTypes.h to reflect move in LLVM with r85086. 2009-10-26 01:37:10 +00:00
CGStmt.cpp Implement proper cleanup semantics for condition variables in for 2009-11-25 01:51:31 +00:00
CGTemporaries.cpp Get rid of the ugly CGCXX names and replace them with CGClass, CGExprCXX and CGTemporaries. 2009-11-24 05:51:11 +00:00
CGValue.h Fix documentation. 2009-11-03 16:11:57 +00:00
CGVtable.cpp Change getIndex to return false if the index wasn't found. Avoids an extra hash lookup. 2009-12-04 15:49:02 +00:00
CGVtable.h Have ASTRecordLayout keep track of the key function, in preparation of fixing a synthetic ctor/dtor bug. 2009-11-30 23:41:22 +00:00
CMakeLists.txt Rename CGRtti.cpp to CGRTTI.cpp. 2009-12-02 18:32:08 +00:00
CodeGenFunction.cpp Make functions returning a struct indirectly evaluate the returned struct 2009-12-04 02:43:40 +00:00
CodeGenFunction.h Make functions returning a struct indirectly evaluate the returned struct 2009-12-04 02:43:40 +00:00
CodeGenModule.cpp Have ASTRecordLayout keep track of the key function, in preparation of fixing a synthetic ctor/dtor bug. 2009-11-30 23:41:22 +00:00
CodeGenModule.h Minor cleanup. 2009-12-03 04:27:05 +00:00
CodeGenTypes.cpp Fix for PR5659: correct a rather nasty oversight in the type conversion for 2009-12-03 12:44:31 +00:00
CodeGenTypes.h Have ASTRecordLayout keep track of the key function, in preparation of fixing a synthetic ctor/dtor bug. 2009-11-30 23:41:22 +00:00
GlobalDecl.h Move GlobalDecl to its own file. Also add DenseMapInfo traits. 2009-11-13 04:25:07 +00:00
Makefile Allow customization for the producer information in the debug output. 2009-10-09 18:38:12 +00:00
Mangle.cpp Correctly mangle the 'std' namespace inside extern "C++" blocks. 2009-12-04 06:23:23 +00:00
Mangle.h Work-in-progress: teach mangler how to mangle thunks for destructors. 2009-12-03 00:03:05 +00:00
ModuleBuilder.cpp Remove remaining VISIBILITY_HIDDEN from anonymous namespaces. 2009-11-28 19:45:26 +00:00
README.txt These IRgen improvements have been done. 2009-07-23 03:03:07 +00:00
TargetABIInfo.cpp Convert ABIArgInfo::dump to raw_ostream. 2009-12-03 09:13:49 +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!

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