llvm-project/clang/lib/CodeGen
Douglas Gregor 747eb7840a Reinstate the fix for PR7556. A silly use of isTrivial() was
suppressing copies of objects with trivial copy constructors.

llvm-svn: 107857
2010-07-08 06:14:04 +00:00
..
ABIInfo.h change ABIArgInfo to hold its llvm type with PATypeHolder so that 2010-06-29 19:21:36 +00:00
BackendUtil.cpp Driver/IRgen: Add support for -momit-leaf-frame-pointer. 2010-07-01 01:31:45 +00:00
CGBlocks.cpp Validated by nightly-test runs on x86 and x86-64 darwin, including after 2010-07-06 01:34:17 +00:00
CGBlocks.h Validated by nightly-test runs on x86 and x86-64 darwin, including after 2010-07-06 01:34:17 +00:00
CGBuilder.h Make CGBuilderTy a typedef again; its functionality has been rolled back 2010-07-06 18:43:48 +00:00
CGBuiltin.cpp finally get around to doing a significant cleanup to irgen: 2010-06-27 07:15:29 +00:00
CGCXX.cpp Introduce Decl::hasBody() and FunctionDecl::hasBody() and use them instead of getBody() when we are just checking the existence of a body, to avoid de-serialization of the body from PCH. 2010-07-07 11:31:19 +00:00
CGCXX.h Remove tabs, and whitespace cleanups. 2009-09-09 15:08:12 +00:00
CGCXXABI.h Add a stub Microsoft Visual C++ ABI class (with stub mangler). 2010-06-09 23:25:41 +00:00
CGCall.cpp Validated by nightly-test runs on x86 and x86-64 darwin, including after 2010-07-06 01:34:17 +00:00
CGCall.h relax the CGFunctionInfo::CGFunctionInfo ctor to allow any sequence 2010-06-29 18:13:52 +00:00
CGClass.cpp Teach function-try-blocks on constructors and destructors to implicitly 2010-07-07 06:56:46 +00:00
CGDebugInfo.cpp Switch over to the new caching version of getMangledName. 2010-06-22 16:16:50 +00:00
CGDebugInfo.h Substantially alter the design of the Objective C type AST by introducing 2010-05-15 11:32:37 +00:00
CGDecl.cpp Validated by nightly-test runs on x86 and x86-64 darwin, including after 2010-07-06 01:34:17 +00:00
CGDeclCXX.cpp When creating functions to run global initializers and destructors, mark them 2010-07-06 04:38:10 +00:00
CGException.cpp Teach function-try-blocks on constructors and destructors to implicitly 2010-07-07 06:56:46 +00:00
CGException.h Validated by nightly-test runs on x86 and x86-64 darwin, including after 2010-07-06 01:34:17 +00:00
CGExpr.cpp Reinstate the fix for PR7556. A silly use of isTrivial() was 2010-07-08 06:14:04 +00:00
CGExprAgg.cpp Reinstate the fix for PR7556. A silly use of isTrivial() was 2010-07-08 06:14:04 +00:00
CGExprCXX.cpp Reinstate the fix for PR7556. A silly use of isTrivial() was 2010-07-08 06:14:04 +00:00
CGExprComplex.cpp Reinstate the fix for PR7556. A silly use of isTrivial() was 2010-07-08 06:14:04 +00:00
CGExprConstant.cpp fix PR7564 a cast where the bitfield struct init code 2010-07-05 18:03:30 +00:00
CGExprScalar.cpp Reinstate the fix for PR7556. A silly use of isTrivial() was 2010-07-08 06:14:04 +00:00
CGObjC.cpp Validated by nightly-test runs on x86 and x86-64 darwin, including after 2010-07-06 01:34:17 +00:00
CGObjCGNU.cpp Validated by nightly-test runs on x86 and x86-64 darwin, including after 2010-07-06 01:34:17 +00:00
CGObjCMac.cpp Validated by nightly-test runs on x86 and x86-64 darwin, including after 2010-07-06 01:34:17 +00:00
CGObjCRuntime.h Validated by nightly-test runs on x86 and x86-64 darwin, including after 2010-07-06 01:34:17 +00:00
CGRTTI.cpp getBody() -> hasBody() 2010-07-07 12:24:18 +00:00
CGRecordLayout.h Keep track of the LLVM field numbers for non-virtual bases. 2010-05-18 05:22:06 +00:00
CGRecordLayoutBuilder.cpp AST: Rename PragmaPackAttr to MaxFieldAlignmentAttr, which is more accurate. 2010-05-27 01:12:46 +00:00
CGStmt.cpp Validated by nightly-test runs on x86 and x86-64 darwin, including after 2010-07-06 01:34:17 +00:00
CGTemporaries.cpp Validated by nightly-test runs on x86 and x86-64 darwin, including after 2010-07-06 01:34:17 +00:00
CGVTT.cpp The global variable for the VTT might not have external linkage; allow 2010-05-06 22:18:21 +00:00
CGVTables.cpp Make sure to set the visible on a vtable; VTTs and typeinfo already 2010-06-14 23:41:45 +00:00
CGVTables.h Introduce Decl::hasBody() and FunctionDecl::hasBody() and use them instead of getBody() when we are just checking the existence of a body, to avoid de-serialization of the body from PCH. 2010-07-07 11:31:19 +00:00
CGValue.h CodeGen: Shrink RValue. 4 words -> 2 words. 2010-05-02 14:59:10 +00:00
CMakeLists.txt Update CMake build for new attribute changes. 2010-06-17 00:37:02 +00:00
CodeGenAction.cpp Break Frontend's dependency on Rewrite, Checker and CodeGen in shared library configuration 2010-06-15 17:48:49 +00:00
CodeGenFunction.cpp Provide a hook for the benefit of clients using clang IR gen as a subroutine: 2010-07-06 23:57:41 +00:00
CodeGenFunction.h Reinstate the fix for PR7556. A silly use of isTrivial() was 2010-07-08 06:14:04 +00:00
CodeGenModule.cpp Introduce Decl::hasBody() and FunctionDecl::hasBody() and use them instead of getBody() when we are just checking the existence of a body, to avoid de-serialization of the body from PCH. 2010-07-07 11:31:19 +00:00
CodeGenModule.h Provide a hook for the benefit of clients using clang IR gen as a subroutine: 2010-07-06 23:57:41 +00:00
CodeGenTypes.cpp fix rdar://8147692 - yet another crash due to my abi work. 2010-07-01 06:20:47 +00:00
CodeGenTypes.h fix rdar://8147692 - yet another crash due to my abi work. 2010-07-01 06:20:47 +00:00
GlobalDecl.h Add GlobalDecl::getCanonicalDecl. 2010-06-22 16:00:14 +00:00
ItaniumCXXABI.cpp IRgen: Add a stub class for generating ABI-specific C++ code. 2010-05-25 19:52:27 +00:00
Makefile Makefiles: Set Clang CPP compiler flags in a single location, instead of scattered throughout the project Makefiles. 2010-06-08 20:44:43 +00:00
Mangle.cpp Use isFunctionOrMethod for vars declared locallly 2010-06-30 18:57:21 +00:00
Mangle.h Add function for mangling reference temporaries. 2010-06-26 16:09:40 +00:00
MicrosoftCXXABI.cpp Mangle Objective-C pointers and block pointers in the Microsoft C++ Mangler. 2010-07-03 16:56:59 +00:00
ModuleBuilder.cpp Move CodeGenOptions.h *back* into Frontend. This should have been done when the 2010-06-15 23:19:56 +00:00
README.txt These IRgen improvements have been done. 2009-07-23 03:03:07 +00:00
TargetInfo.cpp add driver support for minix, patch by Kees van Reeuwijk 2010-07-07 16:01:42 +00:00
TargetInfo.h Implement __builtin_dwarf_sp_column for i386 (Darwin and not), x86-64 (all), 2010-03-06 00:35:14 +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!

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