llvm-project/clang/lib/CodeGen
Daniel Dunbar ff0553ec61 Fix subtle bug in generating LLVM function declarations for builtin functions.
The decl wasn't being passed down, which meant that function attributes were not
being set correctly. This is particularly important for ARM, since it wants to
override the calling convention. Instead we would emit the builtin with the
wrong calling convention, and instcombine would come along and merrily shred all
the calls to it. :)

llvm-svn: 81756
2009-09-14 04:33:21 +00:00
..
ABIInfo.h LLVMContext is a class now. 2009-08-11 17:46:57 +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 Handle delete where the class has a virtual destructor. 2009-09-14 00:16:25 +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 Change CodeGenModule::ConstructTypeAttributes to return the calling convention 2009-09-12 00:59:20 +00:00
CGCall.h Change CodeGenModule::ConstructTypeAttributes to return the calling convention 2009-09-12 00:59:20 +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 Fix another byref bug. This should hopefully get QuickLookPlugins building successfully. 2009-09-13 17:55:13 +00:00
CGExpr.cpp Implement CodeGenFunction::EmitCXXExprWithTemporariesLValue. 2009-09-14 01:10:45 +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 When necessary, null check the base value in GetAddressCXXOfBaseClass. 2009-09-12 06:04:24 +00:00
CGObjC.cpp Remove tabs, and whitespace cleanups. 2009-09-09 15:08:12 +00:00
CGObjCGNU.cpp Fix use of uninitialized, David please check. 2009-09-11 20:56:53 +00:00
CGObjCMac.cpp Fixes a regression in objc GC layout bitmap involving 2009-09-11 17:39:05 +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 Update CMake files. 2009-09-12 21:18:26 +00:00
CodeGenFunction.cpp Pass the GlobalDecl to getMangledName, fixes PR4890. 2009-09-11 00:11:35 +00:00
CodeGenFunction.h Implement CodeGenFunction::EmitCXXExprWithTemporariesLValue. 2009-09-14 01:10:45 +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 Remove tabs, and whitespace cleanups. 2009-09-09 15:08:12 +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 We can't have ctors in the vtable (right Doug?) :-) 2009-09-12 18:57: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 ARM/APCS: Don't treat structs w/ floating point types as "integer like". 2009-09-14 02:20:34 +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!

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