llvm-project/clang/lib/CodeGen
Anders Carlsson 649a17e861 Handle namespace aliases.
llvm-svn: 82644
2009-09-23 19:19:16 +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 Improve debug info generation for __block variables. 2009-09-22 02:12:52 +00:00
CGBlocks.h Improve debug info generation for __block variables. 2009-09-22 02:12:52 +00:00
CGBuilder.h Disable generation of basic block names in NDEBUG mode. 2008-11-12 00:01:12 +00:00
CGBuiltin.cpp Implement __builtin_unreachable(), a GCC 4.5 extension. 2009-09-21 03:09:59 +00:00
CGCXX.cpp Add a new variant of EmitCXXAggrConstructorCall that takes a Value that holds the number of elements to construct, to be used when implementing new[]. 2009-09-23 02:45:36 +00:00
CGCXX.h Remove tabs, and whitespace cleanups. 2009-09-09 15:08:12 +00:00
CGCXXClass.cpp When doing a derived-to-base class and the class offset is 0 we can just do a simple bitcast. 2009-09-22 21:58:22 +00:00
CGCXXExpr.cpp Emit new[] cookie when needed. 2009-09-23 18:59:48 +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 Change all the Type::getAsFoo() methods to specializations of Type::getAs(). 2009-09-21 23:43:11 +00:00
CGCall.h Change CodeGenModule::ConstructTypeAttributes to return the calling convention 2009-09-12 00:59:20 +00:00
CGDebugInfo.cpp Fix some typos. WIP. Large alignments don't work yet. 2009-09-22 02:44:17 +00:00
CGDebugInfo.h Ok, an AssertingVH definitely doesn't work for now because we free our cache after the optimizer may have hacked on the module. Use a WeakVH instead. 2009-09-19 20:17:48 +00:00
CGDecl.cpp Improve debug info generation for __block variables. 2009-09-22 02:12:52 +00:00
CGExpr.cpp Change all the Type::getAsFoo() methods to specializations of Type::getAs(). 2009-09-21 23:43:11 +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 Change all the Type::getAsFoo() methods to specializations of Type::getAs(). 2009-09-21 23:43:11 +00:00
CGExprConstant.cpp Make clang stop relying on ConstantStruct::get's default value for isPacked 2009-09-19 20:00:52 +00:00
CGExprScalar.cpp Remove now fixed FIXME. 2009-09-22 22:31:44 +00:00
CGObjC.cpp IRgen/ObjC: Make the target method decl available to GenerateMessageSendSuper. 2009-09-17 04:01:22 +00:00
CGObjCGNU.cpp Change all the Type::getAsFoo() methods to specializations of Type::getAs(). 2009-09-21 23:43:11 +00:00
CGObjCMac.cpp Change all the Type::getAsFoo() methods to specializations of Type::getAs(). 2009-09-21 23:43:11 +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 Miscellanous fixes in generatation of objc gc's write-barriers. 2009-09-21 18:54:29 +00:00
CMakeLists.txt Move codegen of new and delete to CGCXXExpr.cpp 2009-09-22 22:53:17 +00:00
CodeGenFunction.cpp Change all the Type::getAsFoo() methods to specializations of Type::getAs(). 2009-09-21 23:43:11 +00:00
CodeGenFunction.h Add a new variant of EmitCXXAggrConstructorCall that takes a Value that holds the number of elements to construct, to be used when implementing new[]. 2009-09-23 02:45:36 +00:00
CodeGenModule.cpp Handle namespace aliases. 2009-09-23 19:19:16 +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 CXXMethodDecls should always be mangled, even if they are inside an extern "C" block. Fixes PR5017. 2009-09-22 20:33:31 +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 Change all the Type::getAsFoo() methods to specializations of Type::getAs(). 2009-09-21 23:43:11 +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!

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