llvm-project/clang/lib/CodeGen
Melanie Blower f5360d4bb3 Reapply "Add support for #pragma float_control" with buildbot fixes
Add support for #pragma float_control

Reviewers: rjmccall, erichkeane, sepavloff

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

This reverts commit fce82c0ed3.
2020-05-04 05:51:25 -07: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 Revert "[TLI] Per-function fveclib for math library used for vectorization" 2020-04-11 01:05:01 +00:00
CGAtomic.cpp Clean up usages of asserting vector getters in Type 2020-04-13 13:01:40 -07:00
CGBlocks.cpp [CodeGen] Emit destructor calls to destruct compound literals 2020-03-10 14:08:28 -07: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 Reapply "[IRBuilder] Virtualize IRBuilder" 2020-02-17 19:04:11 +01:00
CGBuiltin.cpp [WebAssembly] Renumber SIMD opcodes 2020-05-01 17:20:49 -07:00
CGCUDANV.cpp [cuda][hip] Fix `RegisterVar` function prototype. 2020-04-03 12:57:09 -04: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 Fix GCC warning on enum class bitfield. NFC. 2020-03-28 10:20:34 -04:00
CGCXX.cpp [Alignment][NFC] Use Align with CreateAlignedLoad 2020-01-27 10:58:36 +01: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 Fix Wparentheses gcc warning. NFC. 2020-04-29 12:21:05 +01:00
CGCall.h [CodeGen] Emit destructor calls to destruct non-trivial C struct objects 2020-03-20 18:34:22 -07:00
CGClass.cpp Make target features check work with ctor and dtor- 2020-04-08 13:19:55 -07:00
CGCleanup.cpp [Windows SEH] Fix abnormal-exits in _try 2020-04-30 09:38:19 -07: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 [Coroutines] Do not evaluate InitListExpr of a co_return 2020-03-16 12:42:44 +08:00
CGDebugInfo.cpp Reland Implement _ExtInt as an extended int type specifier. 2020-04-17 10:45:48 -07:00
CGDebugInfo.h Reland Implement _ExtInt as an extended int type specifier. 2020-04-17 10:45:48 -07:00
CGDecl.cpp Rework how UuidAttr, CXXUuidofExpr, and GUID template arguments and constants are represented. 2020-04-15 12:20:42 -07:00
CGDeclCXX.cpp [clang] Move branch-protection from CodeGenOptions to LangOptions 2020-04-02 10:31:52 +02:00
CGException.cpp [Windows SEH] Fix abnormal-exits in _try 2020-04-30 09:38:19 -07:00
CGExpr.cpp [AVR] Use the correct address space for non-prototyped function calls 2020-04-15 23:44:51 +02:00
CGExprAgg.cpp [CGExprAgg] Fix infinite loop in `findPeephole` 2020-04-16 13:26:23 +03:00
CGExprCXX.cpp Make target features check work with ctor and dtor- 2020-04-08 13:19:55 -07:00
CGExprComplex.cpp Fix a crash when casting _Complex and ignoring the results. 2020-01-28 13:05:56 -05:00
CGExprConstant.cpp Rework how UuidAttr, CXXUuidofExpr, and GUID template arguments and constants are represented. 2020-04-15 12:20:42 -07:00
CGExprScalar.cpp Reapply "Add support for #pragma float_control" with buildbot fixes 2020-05-04 05:51:25 -07:00
CGGPUBuiltin.cpp [Alignment][NFC] Use Align with CreateAlignedStore 2020-01-23 17:34:32 +01:00
CGLoopInfo.cpp [Clang] Add llvm.loop.unroll.disable to loops with -fno-unroll-loops. 2020-04-07 14:01:55 +01:00
CGLoopInfo.h [Clang] Add llvm.loop.unroll.disable to loops with -fno-unroll-loops. 2020-04-07 14:01:55 +01:00
CGNonTrivialStruct.cpp [CodeGenObjC] Fix a crash when attempting to copy a zero-sized bit-field in a non-trivial C struct 2020-04-06 16:04:13 -04:00
CGObjC.cpp Reapply "Add support for #pragma float_control" with buildbot fixes 2020-05-04 05:51:25 -07:00
CGObjCGNU.cpp [NFC] Refactoring PropertyAttributeKind for ObjCPropertyDecl and ObjCDeclSpec. 2020-04-23 17:21:25 -04:00
CGObjCMac.cpp [ADT/STLExtras.h] - Add llvm::is_sorted wrapper and update callers. 2020-04-14 14:11:02 +03:00
CGObjCRuntime.cpp [clang] CodeGen: Make getOrEmitProtocol public for Swift 2020-04-01 08:55:56 -07:00
CGObjCRuntime.h [clang] CodeGen: Make getOrEmitProtocol public for Swift 2020-04-01 08:55:56 -07:00
CGOpenCLRuntime.cpp Fix "pointer is null" static analyzer warning. NFCI. 2020-01-08 17:19:08 +00:00
CGOpenCLRuntime.h [OpenCL] Simplify LLVM IR generated for OpenCL blocks 2019-02-21 11:02:10 +00:00
CGOpenMPRuntime.cpp [clang][OpenMP] Fix mangling of linear parameters. 2020-05-01 21:19:00 +00:00
CGOpenMPRuntime.h [OPENMP50]Codegen for reduction clauses with 'task' modifier. 2020-05-01 11:40:27 -04:00
CGOpenMPRuntimeNVPTX.cpp [CUDA] Add partial support for recent CUDA versions. 2020-04-08 11:19:44 -07:00
CGOpenMPRuntimeNVPTX.h [OpenMP] `omp begin/end declare variant` - part 2, sema ("+CG") 2020-03-27 02:30:58 -05: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 CodeGenTypes::CGRecordLayouts: Use unique_ptr to simplify memory management 2020-04-28 22:31:16 -07:00
CGStmt.cpp [Clang] Add llvm.loop.unroll.disable to loops with -fno-unroll-loops. 2020-04-07 14:01:55 +01:00
CGStmtOpenMP.cpp Reapply "Add support for #pragma float_control" with buildbot fixes 2020-05-04 05:51:25 -07: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 [CodeGen] Emit destructor calls to destruct non-trivial C struct objects 2020-03-20 18:34:22 -07: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 Move verification of Sema::MaximumAlignment to a .cpp file 2020-01-30 13:37:52 -08:00
CMakeLists.txt Update compiler extension integration into the build system 2020-04-24 09:40:14 +02:00
CodeGenABITypes.cpp Fix parameter name comments using clang-tidy. NFC. 2019-07-16 04:46:31 +00:00
CodeGenAction.cpp clang: Allow backend unsupported warnings 2020-04-27 12:14:51 -04:00
CodeGenFunction.cpp Reapply "Add support for #pragma float_control" with buildbot fixes 2020-05-04 05:51:25 -07:00
CodeGenFunction.h Reapply "Add support for #pragma float_control" with buildbot fixes 2020-05-04 05:51:25 -07:00
CodeGenModule.cpp [CodeGen] fix inline builtin-related breakage from D78162 2020-04-16 11:54:10 -07:00
CodeGenModule.h Rework how UuidAttr, CXXUuidofExpr, and GUID template arguments and constants are represented. 2020-04-15 12:20:42 -07:00
CodeGenPGO.cpp [NFC] Fixes -Wrange-loop-analysis warnings 2020-01-01 20:01:37 +01:00
CodeGenPGO.h [CodeGenPGO] Fix shadow variable warning. NFC. 2020-03-02 15:06:34 +00:00
CodeGenTBAA.cpp Reland Implement _ExtInt as an extended int type specifier. 2020-04-17 10:45:48 -07: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 CodeGenTypes::CGRecordLayouts: Use unique_ptr to simplify memory management 2020-04-28 22:31:16 -07:00
CodeGenTypes.h CodeGenTypes::CGRecordLayouts: Use unique_ptr to simplify memory management 2020-04-28 22:31:16 -07: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 Avoid including FileManager.h from SourceManager.h 2020-03-11 13:53:12 -07:00
CoverageMappingGen.h Reland: [Coverage] Revise format to reduce binary size 2020-02-28 18:12:04 -08:00
EHScopeStack.h [Windows SEH] Fix abnormal-exits in _try 2020-04-30 09:38:19 -07:00
ItaniumCXXABI.cpp Reland Implement _ExtInt as an extended int type specifier. 2020-04-17 10:45:48 -07: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 [NFC] Let mangler accept GlobalDecl 2020-03-07 23:51:41 -05:00
ModuleBuilder.cpp reland "[DebugInfo] Support to emit debugInfo for extern variables" 2019-12-22 18:28:50 -08:00
ObjectFilePCHContainerOperations.cpp [Alignment][Clang][NFC] Add CharUnits::getAsAlign 2019-10-03 13:00:29 +00:00
PatternInit.cpp Clean up usages of asserting vector getters in Type 2020-04-13 13:01:40 -07:00
PatternInit.h Variable auto-init: also auto-init alloca 2019-04-12 00:11:27 +00:00
README.txt
SanitizerMetadata.cpp Avoid SourceManager.h include in RawCommentList.h, add missing incs 2020-02-27 13:49:40 -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 [NFC][clang] Replace raw new/delete with unique_ptr to store ABIInfo in TargetCodeGenInfo 2020-04-30 12:31:50 +00:00
TargetInfo.h [NFC][clang] Replace raw new/delete with unique_ptr to store ABIInfo in TargetCodeGenInfo 2020-04-30 12:31:50 +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!

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