llvm-project/clang/lib/CodeGen
Erich Keane 0213adde21 [NFC] Fix 'target' condition in checkTargetFeatures
checkTargetFeatures was incorrectly checking for cpu_specific instead of
just 'target'. While this function was never called in that situation,
it seemed correct to fix the condition.  Additionally, multiversion
functions can never be always_inline, but if any function accidentially
ended up here we shouldn't diagnose.

Note that the adding of target-features to the list is unnecessary since
the getFunctionFeatureMap actually considers attribute target,
however adding it results in significantly better error messages by
putting the 'target' features first (and thus first to fail).
Otherwise, the error message would be the first feature 'implied' by the
target attribute, and not necessarily the feature listed in the
attribute itself.
2019-11-18 13:43:52 -08: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 Move CodeGenFileType enum to Support/CodeGen.h 2019-11-13 16:39:34 -08:00
CGAtomic.cpp Codegen - silence static analyzer getAs<> null dereference warnings. NFCI. 2019-10-07 16:42:25 +00:00
CGBlocks.cpp CGBlocks - silence static analyzer getAs<> null dereference warnings. NFCI. 2019-10-04 15:01:54 +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 [opaque pointer types] Add element type argument to IRBuilder CreatePreserveStructAccessIndex and CreatePreserveArrayAccessIndex 2019-11-03 10:27:18 -08:00
CGBuiltin.cpp [ARM,MVE] Add intrinsics for vector comparisons. 2019-11-18 10:39:30 +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 Codegen - silence static analyzer getAs<> null dereference warnings. NFCI. 2019-10-07 16:42:25 +00:00
CGCXXABI.cpp Silence static analyzer getAs<RecordType> null dereference warnings. NFCI. 2019-10-03 11:22:48 +00:00
CGCXXABI.h Improve code generation for thread_local variables: 2019-09-12 20:00:24 +00:00
CGCall.cpp [hip] Enable pointer argument lowering through coercing type. 2019-11-05 13:05:05 -05:00
CGCall.h Run clang-format on lib/CodeGen/CGCall.h and fix indentation 2019-10-30 18:06:12 -07:00
CGClass.cpp [OpenCL] Preserve addrspace in CGClass (PR43145) 2019-10-17 14:12:51 +00: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 Revert "[DWARF5]Addition of alignment atrribute in typedef DIE." 2019-11-18 15:53:22 +01:00
CGDebugInfo.h Revert "[clang] Remove the DIFlagArgumentNotModified debug info flag" 2019-11-15 12:16:44 +01:00
CGDecl.cpp Revert "[NFC] Refactor representation of materialized temporaries" 2019-11-17 02:09:25 -05:00
CGDeclCXX.cpp Revert "re-land [DebugInfo] Add debug location to stubs generated by CGDeclCXX and mark them as artificial" 2019-11-15 16:21:17 -05:00
CGException.cpp [WebAssembly] Add -fwasm-exceptions for wasm EH 2019-09-12 04:01:37 +00:00
CGExpr.cpp Revert "[NFC] Refactor representation of materialized temporaries" 2019-11-17 02:09:25 -05:00
CGExprAgg.cpp Revert "[NFC] Refactor representation of materialized temporaries" 2019-11-17 02:09:25 -05:00
CGExprCXX.cpp CFI: wrong type passed to llvm.type.test with multiple inheritance devirtualization. 2019-10-15 16:32:50 +00:00
CGExprComplex.cpp [c++20] Add CXXRewrittenBinaryOperator to represent a comparison 2019-10-19 00:04:38 +00:00
CGExprConstant.cpp Revert "[NFC] Refactor representation of materialized temporaries" 2019-11-17 02:09:25 -05:00
CGExprScalar.cpp CodeGen: set correct result for atomic compound expressions 2019-11-07 13:36:44 +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 "Recommit "[Clang] Pragma vectorize_width() implies vectorize(enable)"" 2019-10-24 16:35:45 -07: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 Implement __attribute__((objc_direct)), __attribute__((objc_direct_members)) 2019-11-18 11:48:40 -08:00
CGObjCGNU.cpp Implement __attribute__((objc_direct)), __attribute__((objc_direct_members)) 2019-11-18 11:48:40 -08:00
CGObjCMac.cpp Implement __attribute__((objc_direct)), __attribute__((objc_direct_members)) 2019-11-18 11:48:40 -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 PR44024: runtime assert in distribute construct. 2019-11-18 11:14:27 -05:00
CGOpenMPRuntime.h [Clang][OpenMP Offload] Move offload registration code to the wrapper 2019-10-15 18:42:47 +00:00
CGOpenMPRuntimeNVPTX.cpp [OPENMP]Improve diagnostics for unsupported unified addressing. 2019-11-05 10:31:59 -05: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 [OPENMP50]Add support for parallel master taskloop simd directive. 2019-10-30 10:23:33 -04:00
CGStmtOpenMP.cpp [OPENMP50]Support for imperfectly nested loops. 2019-11-04 16:09:25 -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 Reland: Dead Virtual Function Elimination 2019-10-17 09:58:57 +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 [NFC] Fix 'target' condition in checkTargetFeatures 2019-11-18 13:43:52 -08:00
CodeGenFunction.h Temporarily Revert "Add support for options -frounding-math, ftrapping-math, -ffp-model=, and -ffp-exception-behavior=" 2019-11-18 10:46:48 -08:00
CodeGenModule.cpp Revert "[NFC] Refactor representation of materialized temporaries" 2019-11-17 02:09:25 -05:00
CodeGenModule.h [CodeGenModule] Group blocks runtime globals together, NFC 2019-11-07 12:46:26 -08: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 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 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 Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ConstantInitBuilder.cpp [Alignment][Clang][NFC] Add CharUnits::getAsAlign 2019-10-03 13:00:29 +00:00
CoverageMappingGen.cpp Revert "Use -fdebug-compilation-dir to form absolute paths in coverage mappings" 2019-10-28 14:40:17 -07:00
CoverageMappingGen.h Revert "Use -fdebug-compilation-dir to form absolute paths in coverage mappings" 2019-10-28 14:40:17 -07: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 Reland: Dead Virtual Function Elimination 2019-10-17 09:58:57 +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 [MS] Fix constexpr data member pointer conversions 2019-10-29 16:58:00 -07:00
ModuleBuilder.cpp [Clang] Use -main-file-name for source filename if not set 2019-09-30 15:05:35 +00: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 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 Implement target(branch-protection) attribute for AArch64 2019-11-15 15:40:46 +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!

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