llvm-project/clang/lib/CodeGen
John McCall 1c456c89dc Abstract out member-pointer creation. I'm really unhappy about the current
duplication between the constant and non-constant paths in all of this.

Implement ARM ABI semantics for member pointer constants and conversion.

llvm-svn: 111772
2010-08-22 06:43:33 +00:00
..
ABIInfo.h fix PR5179 and correctly fix PR5831 to not miscompile. 2010-07-30 04:02:24 +00:00
BackendUtil.cpp Driver/IRgen: Add support for -momit-leaf-frame-pointer. 2010-07-01 01:31:45 +00:00
CGBlocks.cpp Make use of __func__ in a block actually refer to 2010-08-13 00:19:55 +00:00
CGBlocks.h IRgen: Move blocks runtime interfaces to CodeGenModule. 2010-07-16 00:00:15 +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 Translate NEON vmovl intrinsics to zero/sign-extend operations. 2010-08-20 03:36:08 +00:00
CGCXX.cpp Abstract out member-pointer creation. I'm really unhappy about the current 2010-08-22 06:43:33 +00:00
CGCXX.h Remove tabs, and whitespace cleanups. 2009-09-09 15:08:12 +00:00
CGCXXABI.h Abstract out member-pointer creation. I'm really unhappy about the current 2010-08-22 06:43:33 +00:00
CGCall.cpp IRgen: Switch more MakeAddr() users to MakeAddrLValue; this time for calls which were previously not computing the qualifier list. In most cases, I don't think it matters, but I believe this is conservatively more correct / consistent. 2010-08-21 03:15:20 +00:00
CGCall.h relax the CGFunctionInfo::CGFunctionInfo ctor to allow any sequence 2010-06-29 18:13:52 +00:00
CGClass.cpp IRgen: Switch a bunch of trivial MakeAddr calls to use MakeAddrLValue. 2010-08-21 03:08:16 +00:00
CGDebugInfo.cpp Detabify. 2010-08-22 01:00:03 +00:00
CGDebugInfo.h Introduce a new temporary MDNode concept. Temporary MDNodes are 2010-08-20 22:02:57 +00:00
CGDecl.cpp IRgen: Change Emit{Load,Store}OfScalar to take a required Alignment argument and 2010-08-21 02:24:36 +00:00
CGDeclCXX.cpp IRgen: Change Emit{Load,Store}OfScalar to take a required Alignment argument and 2010-08-21 02:24:36 +00:00
CGException.cpp IRgen: Change Emit{Load,Store}OfScalar to take a required Alignment argument and 2010-08-21 02:24:36 +00:00
CGException.h More cleanup enabling. 2010-08-14 07:46:19 +00:00
CGExpr.cpp IRgen: Set the alignment correctly when creating LValue for a decls. 2010-08-21 04:20:22 +00:00
CGExprAgg.cpp Abstract out member-pointer creation. I'm really unhappy about the current 2010-08-22 06:43:33 +00:00
CGExprCXX.cpp Abstract more member-pointerness out. 2010-08-22 04:16:24 +00:00
CGExprComplex.cpp Add lvalue-bitcast support for complex numbers. 2010-07-14 21:35:45 +00:00
CGExprConstant.cpp Abstract out member-pointer creation. I'm really unhappy about the current 2010-08-22 06:43:33 +00:00
CGExprScalar.cpp IRgen: Switch a bunch of trivial MakeAddr calls to use MakeAddrLValue. 2010-08-21 03:08:16 +00:00
CGObjC.cpp Store inheritance paths after CastExprs instead of inside them. 2010-08-07 06:22:56 +00:00
CGObjCGNU.cpp Convert all uses of StringLiteral::getStrData() to StringLiteral::getString() 2010-08-17 12:54:38 +00:00
CGObjCMac.cpp Simplify. 2010-08-21 04:05:54 +00:00
CGObjCRuntime.h Some early work for providing block layout info. 2010-08-04 16:57:49 +00:00
CGRTTI.cpp Detabify. 2010-08-22 01:00:03 +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 Detabify. 2010-08-22 01:00:03 +00:00
CGTemporaries.cpp Rename LazyCleanup -> Cleanup. No functionality change for these last three 2010-07-21 07:22:38 +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 Just disable the hidden-visibility optimization for now by hiding it behind 2010-08-12 23:36:15 +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 IRgen/CGValue: Give MakeAddrLValue() an alignment argument, and eliminate old form of MakeAddr(). 2010-08-21 03:58:45 +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 Abstract more member-pointerness out. 2010-08-22 04:16:24 +00:00
CodeGenFunction.h IRgen: Set the alignment correctly when creating LValue for a decls. 2010-08-21 04:20:22 +00:00
CodeGenModule.cpp The ARM C++ ABI is sufficiently different from the Itanium C++ ABI that 2010-08-21 22:46:04 +00:00
CodeGenModule.h Abstract out member-pointer creation. I'm really unhappy about the current 2010-08-22 06:43:33 +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 Kill off the 'coerce' ABI passing form. Now 'direct' and 'extend' always 2010-07-29 06:26:06 +00:00
GlobalDecl.h Add GlobalDecl::getCanonicalDecl. 2010-06-22 16:00:14 +00:00
ItaniumCXXABI.cpp Abstract out member-pointer creation. I'm really unhappy about the current 2010-08-22 06:43:33 +00:00
Makefile BUILD_ARCHIVE is the default for libraries, no need to set it. 2010-07-18 00:14:47 +00:00
Mangle.cpp Detabify. 2010-08-22 01:00:03 +00:00
Mangle.h Add function for mangling reference temporaries. 2010-06-26 16:09:40 +00:00
MicrosoftCXXABI.cpp zap dead code. 2010-08-18 16:09:06 +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 fix PR5179 and correctly fix PR5831 to not miscompile. 2010-07-30 04:02:24 +00:00
TargetInfo.h Fix the IR generation for catching pointers by references. 2010-07-20 22:17:55 +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!

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