llvm-project/clang/lib/CodeGen
Douglas Gregor 4ef1d400d9 Make sure that Type::getAs<ArrayType>() (or Type::getAs<subclass of
ArrayType>()) does not instantiate. Update all callers that used this
unsafe feature to use the appropriate ASTContext::getAs*ArrayType method.

llvm-svn: 86596
2009-11-09 22:08:55 +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 Remove some misguided code. 2009-10-22 01:31:24 +00:00
CGBlocks.h Refactor. 2009-10-21 18:23:01 +00:00
CGBuilder.h Disable generation of basic block names in NDEBUG mode. 2008-11-12 00:01:12 +00:00
CGBuiltin.cpp __builtin_object_size refinements. Ensure we handle expressions with 2009-10-27 22:09:17 +00:00
CGCXX.cpp Unify the codepaths used to verify base and member initializers for explicitly 2009-11-09 01:05:47 +00:00
CGCXX.h Remove tabs, and whitespace cleanups. 2009-09-09 15:08:12 +00:00
CGCXXClass.cpp Simplify pointer creation with the new Type::getInt*Ptr methods. 2009-10-13 10:07:13 +00:00
CGCXXExpr.cpp Fix a lame regression in IR gen for C++ delete expressions. PR5102 2009-10-01 05:49:51 +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 Set OptimizeForSize LLVM function attribute with -Os. 2009-10-27 19:48:08 +00:00
CGCall.h Change CodeGenModule::ConstructTypeAttributes to return the calling convention 2009-09-12 00:59:20 +00:00
CGDebugInfo.cpp Revert r86315 and add Type::FixedWidthInt to the FIXME cases. 2009-11-07 01:19:37 +00:00
CGDebugInfo.h Simplify the debug info code, handle lvalue references and template specializations. 2009-11-06 19:19:55 +00:00
CGDecl.cpp Make sure that Type::getAs<ArrayType>() (or Type::getAs<subclass of 2009-11-09 22:08:55 +00:00
CGException.cpp Get throws limping along, still a bunch of FIXMEs. Too bad we don't support catching anything yet :) 2009-10-30 02:27:02 +00:00
CGExpr.cpp Explicitly note that pre-inc/dec lvalues are not supported yet, so that it 2009-11-09 04:20:47 +00:00
CGExprAgg.cpp Add Code gen support for '->*' operator which fell 2009-10-26 21:58:25 +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 indirectbr seems to work! Rip out the old code. 2009-11-06 17:38:18 +00:00
CGExprScalar.cpp indirectbr seems to work! Rip out the old code. 2009-11-06 17:38:18 +00:00
CGObjC.cpp Fix crash when synthesizing property setters when the property type and ivar 2009-10-27 19:21:30 +00:00
CGObjCGNU.cpp There is now only one version of eh.selector and eh.typeid.for. 2009-10-14 16:13:30 +00:00
CGObjCMac.cpp Avoid std::string concatenation. 2009-10-19 01:21:19 +00:00
CGObjCRuntime.h Patch fixes a code gen. bug in generation of objc_assign_ivar 2009-09-24 22:25:38 +00:00
CGRecordLayoutBuilder.cpp Prevent a code gen. crash on empty unions - pr5408. 2009-11-06 20:47:40 +00:00
CGRecordLayoutBuilder.h Update location of DataTypes.h to reflect move in LLVM with r85086. 2009-10-26 01:37:10 +00:00
CGRtti.cpp Fix thinko, mangleCXXRtti should obviously take a QualType! 2009-10-30 01:52:02 +00:00
CGStmt.cpp update comment, pointed out by Gabor 2009-11-06 18:10:47 +00:00
CGValue.h Fix documentation. 2009-11-03 16:11:57 +00:00
CGVtable.cpp Refine the non-virtual this adjustment. Optimize out virtual this 2009-11-06 23:27:42 +00:00
CGVtable.h Refine handling for non-virtual bases in return value adjustments for 2009-10-13 22:54:56 +00:00
CMakeLists.txt Add CGException.cpp, to be used for exception related code generation. 2009-10-30 01:42:31 +00:00
CodeGenFunction.cpp indirectbr seems to work! Rip out the old code. 2009-11-06 17:38:18 +00:00
CodeGenFunction.h Change EmitPointerToDataMemberLValue to take a FieldDecl. No intended functionality change. 2009-11-07 22:00:15 +00:00
CodeGenModule.cpp Rearrange function to avoid recursive use-after-free. 2009-11-09 05:07:37 +00:00
CodeGenModule.h Added support for static variables which require 2009-11-05 18:03:03 +00:00
CodeGenTypes.cpp Store the builtin types as CanQualTypes. Expand a bit on the CanQual API, 2009-10-23 23:03:21 +00:00
CodeGenTypes.h Store the key function of a record decl inside CGRecordLayout. 2009-10-12 21:16:22 +00:00
Makefile Allow customization for the producer information in the debug output. 2009-10-09 18:38:12 +00:00
Mangle.cpp Always mangle functions with special names. Fixes PR5420. 2009-11-07 07:15:03 +00:00
Mangle.h Fix thinko, mangleCXXRtti should obviously take a QualType! 2009-10-30 01:52:02 +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 Rename areAllFields32Or64BitBasicType to canExpandIndirectArgument to closer match what it is semantically used for. 2009-11-09 01:33:53 +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!

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