llvm-project/clang/lib/CodeGen
Sergey Dmitriev 4b343fd84c [Clang][OpenMP Offload] Create start/end symbols for the offloading entry table with a help of a linker
Linker automatically provides __start_<section name> and __stop_<section name> symbols to satisfy unresolved references if <section name> is representable as a C identifier (see https://sourceware.org/binutils/docs/ld/Input-Section-Example.html for details). These symbols indicate the start address and end address of the output section respectively. Therefore, renaming OpenMP offload entries section name from ".omp.offloading_entries" to "omp_offloading_entries" to use this feature.

This is the first part of the patch for eliminating OpenMP linker script (please see https://reviews.llvm.org/D64943).

Differential Revision: https://reviews.llvm.org/D68070

llvm-svn: 373118
2019-09-27 20:00:51 +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 [WebAssembly] Add -fwasm-exceptions for wasm EH 2019-09-12 04:01:37 +00:00
CGAtomic.cpp add periods 2019-04-03 22:19:07 +00:00
CGBlocks.cpp [CodeGen][ObjC] Annotate retain-agnostic ObjC globals with attribute 2019-06-14 22:06:28 +00: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 Fix parameter name comments using clang-tidy. NFC. 2019-07-16 04:46:31 +00:00
CGBuiltin.cpp [WebAssembly] Narrowing and widening SIMD ops 2019-09-13 22:54:41 +00:00
CGCUDANV.cpp [HIP] Support new kernel launching API 2019-09-24 19:16:40 +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 Fix parameter name comments using clang-tidy. NFC. 2019-07-16 04:46:31 +00:00
CGCXXABI.cpp Fix parameter name comments using clang-tidy. NFC. 2019-07-16 04:46:31 +00:00
CGCXXABI.h Improve code generation for thread_local variables: 2019-09-12 20:00:24 +00:00
CGCall.cpp [Alignment] fix build 2019-09-23 09:04:12 +00:00
CGCall.h [opaque pointer types] Make EmitCall pass Function Types to 2019-02-07 01:15:41 +00:00
CGClass.cpp [OpenCL] Improve destructor support in C++ for OpenCL 2019-07-22 09:39:13 +00:00
CGCleanup.cpp [NFC] avoid AlignedCharArray in clang 2019-07-29 23:12:48 +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 Support for DWARF-5 C++ language tags. 2019-09-24 00:38:49 +00:00
CGDebugInfo.h Revert "[CGDebugInfo] Simplify EmitFunctionDecl parameters, NFC" 2019-07-11 19:28:07 +00:00
CGDecl.cpp [OpenMP 5.0] Codegen support for user-defined mappers. 2019-08-05 18:43:21 +00:00
CGDeclCXX.cpp Revert: [DebugInfo] Add debug location to stubs generated by CGDeclCXX and mark them as artificial 2019-09-05 20:12:20 +00:00
CGException.cpp [WebAssembly] Add -fwasm-exceptions for wasm EH 2019-09-12 04:01:37 +00:00
CGExpr.cpp Improve code generation for thread_local variables: 2019-09-12 20:00:24 +00:00
CGExprAgg.cpp Revert "Revert "CodeGen: ensure placeholder instruction for cleanup is created"" 2019-07-25 20:59:48 +00:00
CGExprCXX.cpp Recommit Devirtualize destructor of final class. 2019-08-08 18:00:49 +00:00
CGExprComplex.cpp [C++2a] Add __builtin_bit_cast, used to implement std::bit_cast 2019-07-02 18:28:13 +00:00
CGExprConstant.cpp Fix parameter name comments using clang-tidy. NFC. 2019-07-16 04:46:31 +00:00
CGExprScalar.cpp [NFC][CodeGen][UBSan] EmitCheckedInBoundsGEP(): pass a vector to EmitCheck() 2019-09-06 14:19:04 +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 Revert r372082 "[Clang] Pragma vectorize_width() implies vectorize(enable)" 2019-09-18 13:41:51 +00:00
CGLoopInfo.h Don't keep stale pointers to LoopInfos. 2019-08-19 13:37:41 +00:00
CGNonTrivialStruct.cpp Do a sweep of symbol internalization. NFC. 2019-08-23 19:59:23 +00:00
CGObjC.cpp Fix parameter name comments using clang-tidy. NFC. 2019-07-16 04:46:31 +00:00
CGObjCGNU.cpp [gnustep-objc] Make the GNUstep v2 ABI work for Windows DLLs. 2019-03-31 11:22:33 +00:00
CGObjCMac.cpp Silence gcc warning "control reaches end of non-void function" [NFCI] 2019-07-05 06:12:24 +00:00
CGObjCRuntime.cpp [opaque pointer types] Pass function types for runtime function calls. 2019-02-05 16:42:33 +00:00
CGObjCRuntime.h [opaque pointer types] Pass function types for runtime function calls. 2019-02-05 16:42:33 +00: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 [Clang][OpenMP Offload] Create start/end symbols for the offloading entry table with a help of a linker 2019-09-27 20:00:51 +00:00
CGOpenMPRuntime.h [OPENMP]Call __kmpc_push_tripcount in task context. 2019-09-23 14:06:51 +00:00
CGOpenMPRuntimeNVPTX.cpp [OPENMP5.0]Add basic support for declare variant directive. 2019-09-13 20:18:17 +00:00
CGOpenMPRuntimeNVPTX.h [OpenMP] Add support for registering requires directives with the runtime 2019-05-21 19:42:01 +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 [CodeGen]: fix error message for "=r" asm constraint 2019-08-30 08:58:46 +00:00
CGStmtOpenMP.cpp [OPENMP]Use standard parsing for 'match' clause, NFC. 2019-09-23 18:13:31 +00: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 Use musttail for variadic method thunks when possible 2019-09-06 22:55:26 +00: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 Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CMakeLists.txt Make CodeGen depend on ASTMatchers 2019-06-26 14:13:43 +00:00
CodeGenABITypes.cpp Fix parameter name comments using clang-tidy. NFC. 2019-07-16 04:46:31 +00:00
CodeGenAction.cpp Reland "clang-misexpect: Profile Guided Validation of Performance Annotations in LLVM" 2019-09-11 16:19:50 +00:00
CodeGenFunction.cpp Fix always_inline 'target' compatibility check code for Lambdas 2019-08-28 20:59:25 +00:00
CodeGenFunction.h [OpenCL] Improve destructor support in C++ for OpenCL 2019-07-22 09:39:13 +00:00
CodeGenModule.cpp Support for DWARF-5 C++ language tags. 2019-09-24 00:38:49 +00:00
CodeGenModule.h C++ DR712 and others: handle non-odr-use resulting from an lvalue-to-rvalue conversion applied to a member access or similar not-quite-trivial lvalue expression. 2019-06-14 17:46:37 +00:00
CodeGenPGO.cpp [Clang] Migrate llvm::make_unique to std::make_unique 2019-08-14 23:04:18 +00:00
CodeGenPGO.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CodeGenTBAA.cpp Fix TBAA representation for zero-sized fields and unnamed bit-fields. 2019-06-22 21:30:43 +00: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 Add SVE opaque built-in types 2019-08-09 08:52:54 +00:00
CodeGenTypes.h IRGen: Remove StructorType; thread GlobalDecl through more code. NFCI. 2019-03-22 23:05:10 +00:00
ConstantEmitter.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ConstantInitBuilder.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CoverageMappingGen.cpp Fix parameter name comments using clang-tidy. NFC. 2019-07-16 04:46:31 +00:00
CoverageMappingGen.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00: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 Improve code generation for thread_local variables: 2019-09-12 20:00:24 +00: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 Improve code generation for thread_local variables: 2019-09-12 20:00:24 +00:00
ModuleBuilder.cpp [OpenMP 5.0] Codegen support for user-defined mappers. 2019-08-05 18:43:21 +00:00
ObjectFilePCHContainerOperations.cpp [Clang] Migrate llvm::make_unique to std::make_unique 2019-08-14 23:04:18 +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 ARM MTE stack sanitizer. 2019-07-15 20:02:23 +00: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 [X86] Prevent passing vectors of __int128 as <X x i128> in llvm IR 2019-09-06 06:02:13 +00: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!

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