freebsd-skq/lib/CodeGen
2017-12-18 20:11:37 +00:00
..
ABIInfo.h Vendor import of clang release_50 branch r312293: 2017-09-01 16:29:06 +00:00
Address.h Vendor import of clang release_38 branch r260756: 2016-02-13 14:58:13 +00:00
BackendUtil.cpp Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CGAtomic.cpp Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CGBlocks.cpp Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CGBlocks.h Vendor import of clang trunk r290819: 2017-01-02 19:18:08 +00:00
CGBuilder.h Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CGBuiltin.cpp Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CGCall.cpp Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CGCall.h Vendor import of clang trunk r300890: 2017-04-20 21:20:51 +00:00
CGClass.cpp Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CGCleanup.cpp Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CGCleanup.h Vendor import of clang trunk r291476: 2017-01-09 21:23:21 +00:00
CGCoroutine.cpp Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CGCUDANV.cpp Vendor import of clang trunk r303197: 2017-05-16 19:47:09 +00:00
CGCUDARuntime.cpp Vendor import of clang trunk r290819: 2017-01-02 19:18:08 +00:00
CGCUDARuntime.h Vendor import of clang release_39 branch r276489: 2016-07-23 20:44:14 +00:00
CGCXX.cpp Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CGCXXABI.cpp Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CGCXXABI.h Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CGDebugInfo.cpp Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CGDebugInfo.h Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CGDecl.cpp Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CGDeclCXX.cpp Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CGException.cpp Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CGExpr.cpp Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CGExprAgg.cpp Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CGExprComplex.cpp Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CGExprConstant.cpp Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CGExprCXX.cpp Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CGExprScalar.cpp Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CGGPUBuiltin.cpp Vendor import of clang trunk r300422: 2017-04-16 16:02:28 +00:00
CGLoopInfo.cpp Vendor import of clang trunk r290819: 2017-01-02 19:18:08 +00:00
CGLoopInfo.h Vendor import of clang trunk r290819: 2017-01-02 19:18:08 +00:00
CGObjC.cpp Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CGObjCGNU.cpp Vendor import of clang trunk r303197: 2017-05-16 19:47:09 +00:00
CGObjCMac.cpp Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CGObjCRuntime.cpp Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CGObjCRuntime.h Vendor import of clang trunk r290819: 2017-01-02 19:18:08 +00:00
CGOpenCLRuntime.cpp Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CGOpenCLRuntime.h Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CGOpenMPRuntime.cpp Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CGOpenMPRuntime.h Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CGOpenMPRuntimeNVPTX.cpp Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CGOpenMPRuntimeNVPTX.h Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CGRecordLayout.h Vendor import of clang release_39 branch r276489: 2016-07-23 20:44:14 +00:00
CGRecordLayoutBuilder.cpp Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CGStmt.cpp Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CGStmtOpenMP.cpp Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CGValue.h Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CGVTables.cpp Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CGVTables.h Vendor import of clang trunk r290819: 2017-01-02 19:18:08 +00:00
CGVTT.cpp Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CMakeLists.txt Vendor import of clang trunk r300422: 2017-04-16 16:02:28 +00:00
CodeGenABITypes.cpp Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CodeGenAction.cpp Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CodeGenFunction.cpp Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CodeGenFunction.h Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CodeGenModule.cpp Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CodeGenModule.h Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CodeGenPGO.cpp Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CodeGenPGO.h Vendor import of clang trunk r301441: 2017-04-26 19:24:09 +00:00
CodeGenTBAA.cpp Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CodeGenTBAA.h Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CodeGenTypeCache.h Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CodeGenTypes.cpp Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CodeGenTypes.h Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
ConstantEmitter.h Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
ConstantInitBuilder.cpp Vendor import of clang trunk r300422: 2017-04-16 16:02:28 +00:00
CoverageMappingGen.cpp Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
CoverageMappingGen.h Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
EHScopeStack.h Vendor import of clang trunk r300422: 2017-04-16 16:02:28 +00:00
ItaniumCXXABI.cpp Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
MacroPPCallbacks.cpp Vendor import of clang trunk r308421: 2017-07-19 07:02:30 +00:00
MacroPPCallbacks.h Vendor import of clang trunk r301939: 2017-05-02 18:30:45 +00:00
MicrosoftCXXABI.cpp Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
ModuleBuilder.cpp Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
ObjectFilePCHContainerOperations.cpp Vendor import of clang trunk r308421: 2017-07-19 07:02:30 +00:00
README.txt Update clang to r84119. 2009-10-14 18:03:49 +00:00
SanitizerMetadata.cpp Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
SanitizerMetadata.h Vendor import of clang trunk r238337: 2015-05-27 18:47:56 +00:00
SwiftCallingConv.cpp Vendor import of clang trunk r306325: 2017-06-26 20:33:12 +00:00
TargetInfo.cpp Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
TargetInfo.h Vendor import of clang trunk r321017: 2017-12-18 20:11:37 +00:00
VarBypassDetector.cpp Vendor import of clang trunk r290819: 2017-01-02 19:18:08 +00:00
VarBypassDetector.h Vendor import of clang trunk r290819: 2017-01-02 19:18:08 +00: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!

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