llvm-project/clang/lib/CodeGen
Tim Northover 85cb560b8a ConstrainedFP: use API compatible with opaque pointers.
This just updates an IRBuilder interface to take Functions instead of
Values so the type can be derived, and fixes some callsites in Clang to
call the updated API.
2019-12-19 21:50:47 +00:00
..
ABIInfo.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Address.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
BackendUtil.cpp [TLI] Support for per-Function TLI that overrides available libfuncs 2019-12-16 09:19:30 -08:00
CGAtomic.cpp [Alignment][NFC] CreateMemSet use MaybeAlign 2019-12-10 15:17:44 +01:00
CGBlocks.cpp Avoid Attr.h includes, CodeGen edition 2019-12-09 16:17:18 -08:00
CGBlocks.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CGBuilder.h [Alignment][NFC] Adding Align compatible methods to IntrinsicInst/IRBuilder 2019-12-12 16:22:15 +01:00
CGBuiltin.cpp ConstrainedFP: use API compatible with opaque pointers. 2019-12-19 21:50:47 +00:00
CGCUDANV.cpp [Alignment][Clang][NFC] Add CharUnits::getAsAlign 2019-10-03 13:00:29 +00:00
CGCUDARuntime.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CGCUDARuntime.h [HIP] Add the interface deriving the stub name of device kernels. 2019-06-17 12:51:36 +00:00
CGCXX.cpp Avoid Attr.h includes, CodeGen edition 2019-12-09 16:17:18 -08:00
CGCXXABI.cpp Avoid Attr.h includes, CodeGen edition 2019-12-09 16:17:18 -08:00
CGCXXABI.h Improve code generation for thread_local variables: 2019-09-12 20:00:24 +00:00
CGCall.cpp [clang] Turn -fno-builtin flag into an IR Attribute 2019-12-12 17:21:12 +01:00
CGCall.h Run clang-format on lib/CodeGen/CGCall.h and fix indentation 2019-10-30 18:06:12 -07:00
CGClass.cpp Avoid Attr.h includes, CodeGen edition 2019-12-09 16:17:18 -08:00
CGCleanup.cpp [Alignment][Clang][NFC] Add CharUnits::getAsAlign 2019-10-03 13:00:29 +00:00
CGCleanup.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CGCoroutine.cpp Fix parameter name comments using clang-tidy. NFC. 2019-07-16 04:46:31 +00:00
CGDebugInfo.cpp [ObjC][DWARF] Emit DW_AT_APPLE_objc_direct for methods marked as __attribute__((objc_direct)) 2019-12-17 09:40:36 +01:00
CGDebugInfo.h [DebugInfo] Support to emit debugInfo for extern variables 2019-12-10 08:09:51 -08:00
CGDecl.cpp Avoid Attr.h includes, CodeGen edition 2019-12-09 16:17:18 -08:00
CGDeclCXX.cpp Avoid Attr.h includes, CodeGen edition 2019-12-09 16:17:18 -08:00
CGException.cpp [IR] Split out target specific intrinsic enums into separate headers 2019-12-11 18:02:14 -08:00
CGExpr.cpp [CodeGen][ObjC] Emit a primitive store to store a __strong field in 2019-12-03 23:44:30 -08:00
CGExprAgg.cpp [c++20] P1959R0: Remove support for std::*_equality. 2019-12-16 17:49:45 -08:00
CGExprCXX.cpp Refactor CompareReferenceRelationship and its callers in preparation for 2019-12-18 14:05:57 -08:00
CGExprComplex.cpp [NFC] Pass a reference to CodeGenFunction to methods of LValue and 2019-12-03 15:22:13 -08:00
CGExprConstant.cpp Use hasOffsetApplied to initialize member HasOffsetApplied 2019-12-18 13:56:59 -08:00
CGExprScalar.cpp Reland [DataLayout] Fix occurrences that size and range of pointers are assumed to be the same. 2019-12-13 14:30:21 +00:00
CGGPUBuiltin.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CGLoopInfo.cpp [Clang] Pragma vectorize_width() implies vectorize(enable) 2019-12-11 10:37:40 +00:00
CGLoopInfo.h Don't keep stale pointers to LoopInfos. 2019-08-19 13:37:41 +00:00
CGNonTrivialStruct.cpp [NFC] Pass a reference to CodeGenFunction to methods of LValue and 2019-12-03 15:22:13 -08:00
CGObjC.cpp Avoid Attr.h includes, CodeGen edition 2019-12-09 16:17:18 -08:00
CGObjCGNU.cpp Avoid Attr.h includes, CodeGen edition 2019-12-09 16:17:18 -08:00
CGObjCMac.cpp NFC: Get rid of an unused parameter to CGObjCMac::EmitSelectorAddr. 2019-12-10 16:54:48 -08:00
CGObjCRuntime.cpp [opaque pointer types] Pass function types for runtime function calls. 2019-02-05 16:42:33 +00:00
CGObjCRuntime.h Implement __attribute__((objc_direct)), __attribute__((objc_direct_members)) 2019-11-18 11:48:40 -08:00
CGOpenCLRuntime.cpp [OpenCL] Simplify LLVM IR generated for OpenCL blocks 2019-02-21 11:02:10 +00:00
CGOpenCLRuntime.h [OpenCL] Simplify LLVM IR generated for OpenCL blocks 2019-02-21 11:02:10 +00:00
CGOpenMPRuntime.cpp [OPENMP50]Fix possible conflict when emitting an alias for the functions 2019-12-12 15:48:33 -05:00
CGOpenMPRuntime.h [OPENMP50]Add if clause in simd directive. 2019-11-19 15:58:19 -05:00
CGOpenMPRuntimeNVPTX.cpp [IR] Split out target specific intrinsic enums into separate headers 2019-12-11 18:02:14 -08:00
CGOpenMPRuntimeNVPTX.h [OPENMP50]Support for declare variant directive for NVPTX target. 2019-10-10 17:28:10 +00:00
CGRecordLayout.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CGRecordLayoutBuilder.cpp P0840R2: support for [[no_unique_address]] attribute 2019-06-20 20:44:45 +00:00
CGStmt.cpp Avoid Attr.h includes, CodeGen edition 2019-12-09 16:17:18 -08:00
CGStmtOpenMP.cpp [OPENMP50]Add parsing/sema analysis for nontemporal clause. 2019-12-17 14:46:32 -05:00
CGVTT.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CGVTables.cpp Avoid Attr.h includes, CodeGen edition 2019-12-09 16:17:18 -08:00
CGVTables.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CGValue.h [NFC] Pass a reference to CodeGenFunction to methods of LValue and 2019-12-03 15:22:13 -08:00
CMakeLists.txt [OpenMP] Use the OpenMP-IR-Builder 2019-12-11 16:51:13 -06:00
CodeGenABITypes.cpp Fix parameter name comments using clang-tidy. NFC. 2019-07-16 04:46:31 +00:00
CodeGenAction.cpp [Support] Add TimeTraceScope constructor without detail arg 2019-12-11 14:32:21 +00:00
CodeGenFunction.cpp [Clang FE, SystemZ] Recognize -mrecord-mcount CL option. 2019-12-19 08:51:55 -08:00
CodeGenFunction.h [OpenMP][NFCI] Introduce llvm/IR/OpenMPConstants.h 2019-12-10 00:10:09 -06:00
CodeGenModule.cpp [OpenMP] Use the OpenMP-IR-Builder 2019-12-11 16:51:13 -06:00
CodeGenModule.h [OpenMP] Use the OpenMP-IR-Builder 2019-12-11 16:51:13 -06:00
CodeGenPGO.cpp Add missing includes needed to prune LLVMContext.h include, NFC 2019-11-14 15:23:15 -08:00
CodeGenPGO.h Fix uninitialized variable warning in CodeGenPGO constructor. NFCI. 2019-10-02 21:05:21 +00:00
CodeGenTBAA.cpp Fix detection of __attribute__((may_alias)) to properly look through 2019-12-11 14:04:37 -08:00
CodeGenTBAA.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CodeGenTypeCache.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CodeGenTypes.cpp Silence static analyzer getAs<RecordType> null dereference warnings. NFCI. 2019-10-03 11:22:48 +00:00
CodeGenTypes.h IRGen: Remove StructorType; thread GlobalDecl through more code. NFCI. 2019-03-22 23:05:10 +00:00
ConstantEmitter.h [CodeGen] Fix clang crash on aggregate initialization of array of labels 2019-11-28 00:59:25 +01:00
ConstantInitBuilder.cpp [Alignment][Clang][NFC] Add CharUnits::getAsAlign 2019-10-03 13:00:29 +00:00
CoverageMappingGen.cpp Revert "[Coverage] Revise format to reduce binary size" 2019-12-04 10:35:14 -08:00
CoverageMappingGen.h Revert "[Coverage] Revise format to reduce binary size" 2019-12-04 10:35:14 -08:00
EHScopeStack.h Replace llvm::integer_sequence and friends with the C++14 standard version 2019-08-15 10:56:05 +00:00
ItaniumCXXABI.cpp Avoid Attr.h includes, CodeGen edition 2019-12-09 16:17:18 -08:00
MacroPPCallbacks.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
MacroPPCallbacks.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
MicrosoftCXXABI.cpp Avoid Attr.h includes, CodeGen edition 2019-12-09 16:17:18 -08:00
ModuleBuilder.cpp [DebugInfo] Support to emit debugInfo for extern variables 2019-12-10 08:09:51 -08:00
ObjectFilePCHContainerOperations.cpp [Alignment][Clang][NFC] Add CharUnits::getAsAlign 2019-10-03 13:00:29 +00:00
PatternInit.cpp CodeGet: Init 32bit pointers with 0xFFFFFFFF 2019-07-12 17:21:55 +00:00
PatternInit.h Variable auto-init: also auto-init alloca 2019-04-12 00:11:27 +00:00
README.txt
SanitizerMetadata.cpp Avoid Attr.h includes, CodeGen edition 2019-12-09 16:17:18 -08:00
SanitizerMetadata.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SwiftCallingConv.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
TargetInfo.cpp [WebAssembly] Add new `export_name` clang attribute for controlling wasm export names 2019-12-11 11:54:57 -08:00
TargetInfo.h [OpenCL][PR41727] Prevent ICE on global dtors 2019-07-15 11:58:10 +00:00
VarBypassDetector.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
VarBypassDetector.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +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!

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