hanchenye-llvm-project/clang/lib/CodeGen
Rafael Espindola 2e42fec3a0 Fix PR6473.
Clang's support for weakref is now better than llvm-gcc's :-)

We don't introduce a new symbol and we correctly mark undefined references weak only if there is no
definition or regular undefined references in the same file.

llvm-svn: 97733
2010-03-04 18:17:24 +00:00
..
ABIInfo.h
CGBlocks.cpp Unconditionally support block introspection data in a new field at the end 2010-02-23 21:51:17 +00:00
CGBlocks.h Unconditionally support block introspection data in a new field at the end 2010-02-23 21:51:17 +00:00
CGBuilder.h
CGBuiltin.cpp Revert changes r97693, r97700, and r97718. 2010-03-04 04:29:44 +00:00
CGCXX.cpp Don't emit derived-to-base destructor aliases if we don't have a definition 2010-03-03 03:40:11 +00:00
CGCXX.h
CGCall.cpp Use the power of types to track down another canonicalization bug in 2010-02-26 00:48:12 +00:00
CGCall.h Use the power of types to track down another canonicalization bug in 2010-02-26 00:48:12 +00:00
CGClass.cpp Perform two more constructor/destructor code-size optimizations: 2010-02-23 00:48:20 +00:00
CGDebugInfo.cpp Targets (like pic16) may have mangled the name of global variables, 2010-02-25 05:20:44 +00:00
CGDebugInfo.h Emit debug info for VectorType. 2010-02-23 22:59:39 +00:00
CGDecl.cpp IRgen: Add CreateMemTemp, for creating an temporary memory object for a particular type, and flood fill. - CreateMemTemp sets the alignment on the alloca correctly, which fixes a great many places in IRgen where we were doing the wrong thing. 2010-02-09 02:48:28 +00:00
CGDeclCXX.cpp
CGException.cpp More refactoring around constructor/destructor code generation. 2010-02-19 09:25:03 +00:00
CGExpr.cpp Fix PR6473. 2010-03-04 18:17:24 +00:00
CGExprAgg.cpp PR6386: Fix a recent regression in IRGen of cast-to-union constructs. 2010-02-23 17:58:35 +00:00
CGExprCXX.cpp IRgen: Add CreateMemTemp, for creating an temporary memory object for a particular type, and flood fill. - CreateMemTemp sets the alignment on the alloca correctly, which fixes a great many places in IRgen where we were doing the wrong thing. 2010-02-09 02:48:28 +00:00
CGExprComplex.cpp Uniformize the names of type predicates: rather than having isFloatTy and 2010-02-15 16:14:01 +00:00
CGExprConstant.cpp hopefully silence a warning on the clang-i386-darwin9 tester. 2010-02-10 21:41:43 +00:00
CGExprScalar.cpp Fix code gen bug generating code for 2010-03-03 22:09:47 +00:00
CGObjC.cpp Use getLocStart(), instead of getLocEnd(), to record starting location of objc method. :) 2010-02-15 18:08:38 +00:00
CGObjCGNU.cpp Don't generate method metadata for @dynamic properties. Fixes PR6354. 2010-02-26 01:11:38 +00:00
CGObjCMac.cpp Use the power of types to track down another canonicalization bug in 2010-02-26 00:48:12 +00:00
CGObjCRuntime.h
CGRTTI.cpp
CGRecordLayoutBuilder.cpp
CGRecordLayoutBuilder.h
CGStmt.cpp fix PR6475, we were doing side-effecting stuff in an assert. 2010-03-03 21:52:23 +00:00
CGTemporaries.cpp
CGVTT.cpp Pass information about whether a base is virtual or not down to getCtorVtable, we need this information in the vtable builder. 2010-02-28 00:36:23 +00:00
CGValue.h
CGVtable.cpp Fix a bug with base offset merging that Devang noticed. 2010-03-03 04:58:02 +00:00
CGVtable.h Pass information about whether a base is virtual or not down to getCtorVtable, we need this information in the vtable builder. 2010-02-28 00:36:23 +00:00
CMakeLists.txt
CodeGenFunction.cpp Eliminate the default arguments to ASTContext::getFunctionType(), 2010-02-21 22:15:06 +00:00
CodeGenFunction.h add framework for ARM builtins, Patch by Edmund Grimley Evans! 2010-03-03 19:03:45 +00:00
CodeGenModule.cpp Fix PR6473. 2010-03-04 18:17:24 +00:00
CodeGenModule.h Fix PR6473. 2010-03-04 18:17:24 +00:00
CodeGenTypes.cpp Split out types that are non-canonical unless dependent as their own 2010-03-01 23:49:17 +00:00
CodeGenTypes.h Use the power of types to track down another canonicalization bug in 2010-02-26 00:48:12 +00:00
GlobalDecl.h
Makefile
Mangle.cpp Refactor local class name mangling and make it 2010-03-04 01:02:03 +00:00
Mangle.h Refactor local class name mangling and make it 2010-03-04 01:02:03 +00:00
ModuleBuilder.cpp Revert changes r97693, r97700, and r97718. 2010-03-04 04:29:44 +00:00
README.txt
TargetInfo.cpp Canonicalize parameter and return types before computing ABI info. Eliminates 2010-02-24 07:14:12 +00:00
TargetInfo.h Add proper target hooks for __builtin_extract_return_address and 2010-03-03 04:15: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!

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