clang-1/lib/CodeGen
Fariborz Jahanian d9a1db3a4d Non fragile ABI for GNU runtime. Patch bu David Chisnall.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81462 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 21:48:21 +00:00
..
ABIInfo.h LLVMContext is a class now. 2009-08-11 17:46:57 +00:00
CGBlocks.cpp Remove tabs, and whitespace cleanups. 2009-09-09 15:08:12 +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 Remove tabs, and whitespace cleanups. 2009-09-09 15:08:12 +00:00
CGCXX.cpp Use the right GlobalDecl type for destructors. 2009-09-09 23:17:18 +00:00
CGCXX.h Remove tabs, and whitespace cleanups. 2009-09-09 15:08:12 +00:00
CGCXXTemp.cpp Remove tabs, and whitespace cleanups. 2009-09-09 15:08:12 +00:00
CGCall.cpp Remove tabs, and whitespace cleanups. 2009-09-09 15:08:12 +00:00
CGCall.h Remove tabs, and whitespace cleanups. 2009-09-09 15:08:12 +00:00
CGDebugInfo.cpp Remove tabs, and whitespace cleanups. 2009-09-09 15:08:12 +00:00
CGDebugInfo.h Remove tabs, and whitespace cleanups. 2009-09-09 15:08:12 +00:00
CGDecl.cpp Make the forwarding member of block byref structs be a pointer to the block byref struct itself. 2009-09-10 01:32:12 +00:00
CGExpr.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
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 Remove tabs, and whitespace cleanups. 2009-09-09 15:08:12 +00:00
CGExprScalar.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
CGObjC.cpp Remove tabs, and whitespace cleanups. 2009-09-09 15:08:12 +00:00
CGObjCGNU.cpp Non fragile ABI for GNU runtime. Patch bu David Chisnall. 2009-09-10 21:48:21 +00:00
CGObjCMac.cpp Get the size of object to pass to objc_memmove_collectable() 2009-09-10 16:20:31 +00:00
CGObjCRuntime.h Remove tabs, and whitespace cleanups. 2009-09-09 15:08:12 +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 Remove tabs, and whitespace cleanups. 2009-09-09 15:08:12 +00:00
CMakeLists.txt Unbreak the CMake build 2009-07-23 15:15:06 +00:00
CodeGenFunction.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
CodeGenFunction.h 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
CodeGenModule.cpp Remove tabs, and whitespace cleanups. 2009-09-09 15:08:12 +00:00
CodeGenModule.h Remove tabs, and whitespace cleanups. 2009-09-09 15:08:12 +00:00
CodeGenTypes.cpp Remove tabs, and whitespace cleanups. 2009-09-09 15:08:12 +00:00
CodeGenTypes.h Remove tabs, and whitespace cleanups. 2009-09-09 15:08:12 +00:00
Makefile Don't install Clang libraries. 2009-08-23 05:02:18 +00:00
Mangle.cpp Remove tabs, and whitespace cleanups. 2009-09-09 15:08:12 +00:00
Mangle.h Remove tabs, and whitespace cleanups. 2009-09-09 15:08:12 +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 Remove tabs, and whitespace cleanups. 2009-09-09 15:08:12 +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!

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