llvm-project/clang/lib/CodeGen
Ken Dyck 01e620efaa Change the return type of ASTContext::getTypeSizeInChars() from uint64_t to the
new opaque value type, CharUnits. This will help us avoid accidentally mixing 
quantities that are in bit and character units.

llvm-svn: 91689
2009-12-18 15:55:54 +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 DeclRefExpr stores a ValueDecl internally. 2009-12-08 09:08:17 +00:00
CGBlocks.h Added block type introspection support. 2009-11-17 19:33:30 +00:00
CGBuilder.h Disable generation of basic block names in NDEBUG mode. 2008-11-12 00:01:12 +00:00
CGBuiltin.cpp Fix for PR5801: codegen memcpy, memmove, memset directly to LLVM intrinsics. 2009-12-17 00:14:28 +00:00
CGCXX.cpp Address some of Anders comments 2009-12-18 05:19:44 +00:00
CGCXX.h Remove tabs, and whitespace cleanups. 2009-09-09 15:08:12 +00:00
CGCall.cpp implement PR5274: mark 'restrict' parameters as noalias 2009-12-07 18:30:06 +00:00
CGCall.h Change CodeGenModule::ConstructTypeAttributes to return the calling convention 2009-09-12 00:59:20 +00:00
CGClass.cpp Add CodeGenModule::ComputeThunkAdjustment, which Eli wrote. 2009-12-03 03:06:55 +00:00
CGDebugInfo.cpp Add -dwarf-debug-flags, which provides a way to embed the cc1 level options used 2009-12-18 02:43:17 +00:00
CGDebugInfo.h Use StringRef in CGDebugInfo::EmitFunctionStart. 2009-12-08 14:04:35 +00:00
CGDecl.cpp Change the return type of ASTContext::getTypeSizeInChars() from uint64_t to the 2009-12-18 15:55:54 +00:00
CGDeclCXX.cpp Actually store the pointer into the global variable, spotted by Eli. 2009-12-10 01:58:33 +00:00
CGException.cpp Rename GetAddrOfRTTI to GetAddrOfRTTIDescriptor. Remove the overload that takes a CXXRecordDecl since we were just creating a QualType from it anyway. 2009-12-17 07:09:17 +00:00
CGExpr.cpp Implement additional undefined checks for additional loads and stores. WIP. 2009-12-16 02:57:00 +00:00
CGExprAgg.cpp Handle case when DestPtr is 0. 2009-12-18 02:14:27 +00:00
CGExprCXX.cpp Fix regression I introduced when dynamic_cast-ing to a reference type. 2009-12-18 14:55:04 +00:00
CGExprComplex.cpp Simplify code. No functionality change. 2009-11-29 19:51:45 +00:00
CGExprConstant.cpp Update CGExprConstant for change to emit padding values as undef. 2009-12-08 21:12:32 +00:00
CGExprScalar.cpp It's perfectly fine to see UserDefinedConversion casts when emitting scalar expressions. 2009-12-18 14:42:03 +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 Change LangOptions::ObjCConstantStringClass to an std::string to avoid worrying about the lifetime. 2009-11-29 02:38:47 +00:00
CGObjCMac.cpp Patch to fix 32-bit @try failure with internal assertion when compiling 2009-12-14 21:35:01 +00:00
CGObjCRuntime.h Patch fixes a code gen. bug in generation of objc_assign_ivar 2009-09-24 22:25:38 +00:00
CGRTTI.cpp Rename GetAddrOfRTTI to GetAddrOfRTTIDescriptor. Remove the overload that takes a CXXRecordDecl since we were just creating a QualType from it anyway. 2009-12-17 07:09:17 +00:00
CGRecordLayoutBuilder.cpp Baby steps towards fixing PR5589. If a class needs a vtable pointer, add one. 2009-12-16 17:27:20 +00:00
CGRecordLayoutBuilder.h Baby steps towards fixing PR5589. If a class needs a vtable pointer, add one. 2009-12-16 17:27:20 +00:00
CGStmt.cpp Implement proper cleanup semantics for condition variables in for 2009-11-25 01:51:31 +00:00
CGTemporaries.cpp Ensure we run cleanups for CXXTemporaries on the exceptional edge. WIP. 2009-12-17 06:08:47 +00:00
CGValue.h Fix documentation. 2009-11-03 16:11:57 +00:00
CGVtable.cpp Rename GetAddrOfRTTI to GetAddrOfRTTIDescriptor. Remove the overload that takes a CXXRecordDecl since we were just creating a QualType from it anyway. 2009-12-17 07:09:17 +00:00
CGVtable.h A bunch more thunk fixes from misc testing. 2009-12-07 23:56:34 +00:00
CMakeLists.txt Add CGDeclCXX.cpp and move EmitCXXGlobalVarDeclInit there. 2009-12-10 00:16:00 +00:00
CodeGenFunction.cpp Switch codegen for -fcatch-undefined-bahavior over to __builtin_trap 2009-12-15 00:35:12 +00:00
CodeGenFunction.h Implement additional undefined checks for additional loads and stores. WIP. 2009-12-16 02:57:00 +00:00
CodeGenModule.cpp Un-namespace-qualify llvm_unreachable. It's a macro, so the qualification gave 2009-12-12 05:05:38 +00:00
CodeGenModule.h Rename GetAddrOfRTTI to GetAddrOfRTTIDescriptor. Remove the overload that takes a CXXRecordDecl since we were just creating a QualType from it anyway. 2009-12-17 07:09:17 +00:00
CodeGenTypes.cpp Fix for PR5659: correct a rather nasty oversight in the type conversion for 2009-12-03 12:44:31 +00:00
CodeGenTypes.h Have ASTRecordLayout keep track of the key function, in preparation of fixing a synthetic ctor/dtor bug. 2009-11-30 23:41:22 +00:00
GlobalDecl.h update to match LLVM API change: 2009-12-15 07:26:51 +00:00
Makefile Allow customization for the producer information in the debug output. 2009-10-09 18:38:12 +00:00
Mangle.cpp Mangle CXXOperatorCallExprs, fixes PR5796. 2009-12-16 05:48:46 +00:00
Mangle.h Work-in-progress: teach mangler how to mangle thunks for destructors. 2009-12-03 00:03:05 +00:00
ModuleBuilder.cpp Remove remaining VISIBILITY_HIDDEN from anonymous namespaces. 2009-11-28 19:45:26 +00:00
README.txt These IRgen improvements have been done. 2009-07-23 03:03:07 +00:00
TargetABIInfo.cpp Convert ABIArgInfo::dump to raw_ostream. 2009-12-03 09:13:49 +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!

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