minix/external/bsd/llvm/dist/clang/lib/CodeGen
Lionel Sambuc f4a2713ac8 Importing netbsd clang -- pristine
Change-Id: Ia40e9ffdf29b5dab2f122f673ff6802a58bc690f
2014-07-28 17:05:57 +02:00
..
ABIInfo.h Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
BackendUtil.cpp Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CGAtomic.cpp Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CGBlocks.cpp Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CGBlocks.h Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CGBuilder.h Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CGBuiltin.cpp Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CGCall.cpp Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CGCall.h Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CGClass.cpp Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CGCleanup.cpp Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CGCleanup.h Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CGCUDANV.cpp Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CGCUDARuntime.cpp Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CGCUDARuntime.h Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CGCXX.cpp Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CGCXXABI.cpp Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CGCXXABI.h Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CGDebugInfo.cpp Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CGDebugInfo.h Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CGDecl.cpp Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CGDeclCXX.cpp Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CGException.cpp Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CGExpr.cpp Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CGExprAgg.cpp Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CGExprComplex.cpp Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CGExprConstant.cpp Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CGExprCXX.cpp Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CGExprScalar.cpp Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CGObjC.cpp Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CGObjCGNU.cpp Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CGObjCMac.cpp Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CGObjCRuntime.cpp Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CGObjCRuntime.h Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CGOpenCLRuntime.cpp Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CGOpenCLRuntime.h Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CGRecordLayout.h Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CGRecordLayoutBuilder.cpp Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CGRTTI.cpp Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CGStmt.cpp Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CGValue.h Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CGVTables.cpp Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CGVTables.h Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CGVTT.cpp Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CMakeLists.txt Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CodeGenABITypes.cpp Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CodeGenAction.cpp Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CodeGenFunction.cpp Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CodeGenFunction.h Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CodeGenModule.cpp Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CodeGenModule.h Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CodeGenTBAA.cpp Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CodeGenTBAA.h Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CodeGenTypes.cpp Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
CodeGenTypes.h Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
EHScopeStack.h Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
ItaniumCXXABI.cpp Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
Makefile Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
MicrosoftCXXABI.cpp Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
MicrosoftVBTables.cpp Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
MicrosoftVBTables.h Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
ModuleBuilder.cpp Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
README.txt Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
TargetInfo.cpp Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00
TargetInfo.h Importing netbsd clang -- pristine 2014-07-28 17:05:57 +02:00

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!

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