llvm-project/clang/lib/CodeGen
Anders Carlsson c1370cb49b Change manglePrefix to return early if the DC is the translation unit.
llvm-svn: 82246
2009-09-18 18:39:58 +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 Add support for __block variables with alignment greater than __alignof(void *). 2009-09-12 02:44:18 +00:00
CGBlocks.h Remove tabs, and whitespace cleanups. 2009-09-09 15:08:12 +00:00
CGBuilder.h Disable generation of basic block names in NDEBUG mode. 2008-11-12 00:01:12 +00:00
CGBuiltin.cpp Fix subtle bug in generating LLVM function declarations for builtin functions. 2009-09-14 04:33:21 +00:00
CGCXX.cpp Remove an unnecessary FunctionDecl parameter to the synthesizing functions. 2009-09-14 05:32:02 +00:00
CGCXX.h Remove tabs, and whitespace cleanups. 2009-09-09 15:08:12 +00:00
CGCXXClass.cpp When necessary, null check the base value in GetAddressCXXOfBaseClass. 2009-09-12 06:04:24 +00:00
CGCXXTemp.cpp If a function call returns a reference, don't bind it to a temporary. 2009-09-14 01:30:44 +00:00
CGCall.cpp 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
CGCall.h Change CodeGenModule::ConstructTypeAttributes to return the calling convention 2009-09-12 00:59:20 +00:00
CGDebugInfo.cpp Be sure to use the correct version instead of inventing the wrong one. 2009-09-15 21:48:34 +00:00
CGDebugInfo.h Remove tabs, and whitespace cleanups. 2009-09-09 15:08:12 +00:00
CGDecl.cpp Fix another byref bug. This should hopefully get QuickLookPlugins building successfully. 2009-09-13 17:55:13 +00:00
CGExpr.cpp Fixed a bug in generation of the new write-barriers when 2009-09-18 00:04:00 +00:00
CGExprAgg.cpp If a cast expression needs either a conversion function or a constructor to be called, generate implicit child expressions that call them. 2009-09-09 21:33:21 +00:00
CGExprComplex.cpp Reflow comments and some minor whitespace fixups. 2009-09-09 13:00:44 +00:00
CGExprConstant.cpp GlobalDecl doesn't have an explicit constructor anymore. 2009-09-10 23:43:36 +00:00
CGExprScalar.cpp Handle reinterpret_cast between integral types and pointer types. 2009-09-15 04:48:33 +00:00
CGObjC.cpp IRgen/ObjC: Make the target method decl available to GenerateMessageSendSuper. 2009-09-17 04:01:22 +00:00
CGObjCGNU.cpp IRgen/ObjC: Correctly construct the function info for variadic message sends. 2009-09-17 04:01:40 +00:00
CGObjCMac.cpp IRgen/ObjC: Correctly construct the function info for variadic message sends. 2009-09-17 04:01:40 +00:00
CGObjCRuntime.h IRgen/ObjC: Make the target method decl available to GenerateMessageSendSuper. 2009-09-17 04:01:22 +00:00
CGRecordLayoutBuilder.cpp Remove tabs, and whitespace cleanups. 2009-09-09 15:08:12 +00:00
CGRecordLayoutBuilder.h Remove tabs, and whitespace cleanups. 2009-09-09 15:08:12 +00:00
CGStmt.cpp Remove tabs, and whitespace cleanups. 2009-09-09 15:08:12 +00:00
CGValue.h Fixed a bug in generation of the new write-barriers when 2009-09-18 00:04:00 +00:00
CMakeLists.txt Update CMake files. 2009-09-12 21:18:26 +00:00
CodeGenFunction.cpp Remove an unnecessary FunctionDecl parameter to the synthesizing functions. 2009-09-14 05:32:02 +00:00
CodeGenFunction.h Code generation of Conditional operators that are lvalues (but that aren't bitfields). 2009-09-15 16:35:24 +00:00
CodeGenModule.cpp Fix subtle bug in generating LLVM function declarations for builtin functions. 2009-09-14 04:33:21 +00:00
CodeGenModule.h Fix subtle bug in generating LLVM function declarations for builtin functions. 2009-09-14 04:33:21 +00:00
CodeGenTypes.cpp Codegen support for nullptr from C++0x. 2009-09-15 04:39:46 +00:00
CodeGenTypes.h Add CallingConvention argument to CGFunctionInfo. 2009-09-11 22:24:53 +00:00
Makefile Don't install Clang libraries. 2009-08-23 05:02:18 +00:00
Mangle.cpp Change manglePrefix to return early if the DC is the translation unit. 2009-09-18 18:39:58 +00:00
Mangle.h Add basic covariant thunk generation support. WIP. 2009-09-11 23:25:56 +00:00
ModuleBuilder.cpp Remove tabs, and whitespace cleanups. 2009-09-09 15:08:12 +00:00
README.txt These IRgen improvements have been done. 2009-07-23 03:03:07 +00:00
TargetABIInfo.cpp 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

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!

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