llvm-project/clang/test
Atmn Patel 6f1503d598 [LoopDeletion] Allows deletion of possibly infinite side-effect free loops
From C11 and C++11 onwards, a forward-progress requirement has been
introduced for both languages. In the case of C, loops with non-constant
conditionals that do not have any observable side-effects (as defined by
6.8.5p6) can be assumed by the implementation to terminate, and in the
case of C++, this assumption extends to all functions. The clang
frontend will emit the `mustprogress` function attribute for C++
functions (D86233, D85393, D86841) and emit the loop metadata
`llvm.loop.mustprogress` for every loop in C11 or later that has a
non-constant conditional.

This patch modifies LoopDeletion so that only loops with
the `llvm.loop.mustprogress` metadata or loops contained in functions
that are required to make progress (`mustprogress` or `willreturn`) are
checked for observable side-effects. If these loops do not have an
observable side-effect, then we delete them.

Loops without observable side-effects that do not satisfy the above
conditions will not be deleted.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D86844
2020-12-30 21:43:01 -05:00
..
APINotes [NFC][tests] Replace use of GNUisms in usage of diff 2020-11-08 12:07:51 -05:00
ARCMT [clang][cli] Turn arcmt-* options into a single option 2020-11-18 10:53:41 +01:00
AST [PowerPC] Enable paired vector type and intrinsics when MMA is disabled 2020-12-15 15:14:11 -06:00
ASTMerge [ASTImporter] Add support for importing GenericSelectionExpr AST nodes. 2020-12-16 15:39:50 -08:00
Analysis [analyzer] OSObjectCStyleCast: Improve warning message. 2020-12-10 19:46:33 -08:00
CXX Revert "PR24076, PR33655, C++ CWG 1558: Consider the instantiation-dependence of" 2020-12-23 12:31:52 +01:00
ClangScanDeps Revert "[clang-scan-deps] Support clang-cl" 2020-12-14 13:32:38 -05:00
CodeCompletion [clang] Enable code completion of designated initializers in Compound Literal Expressions 2020-12-01 12:06:48 +01:00
CodeGen clang-format, address warnings 2020-12-30 23:05:07 +09:00
CodeGenCUDA Fix assertion in tryEmitAsConstant 2020-12-02 19:10:01 -05:00
CodeGenCXX [IR] Let IRBuilder's CreateVectorSplat/CreateShuffleVector use poison as placeholder 2020-12-30 04:21:04 +09:00
CodeGenCoroutines [CodeGen] Apply 'nonnull' and 'dereferenceable(N)' to 'this' pointer 2020-11-16 17:39:17 -08:00
CodeGenHIP
CodeGenObjC [CodeGen][ObjC] Destroy callee-destroyed arguments in the caller 2020-12-28 11:52:27 -08:00
CodeGenObjCXX [CodeGen][ObjC] Destroy callee-destroyed arguments in the caller 2020-12-28 11:52:27 -08:00
CodeGenOpenCL Use unary CreateShuffleVector if possible 2020-12-30 22:36:08 +09:00
CodeGenOpenCLCXX Create SPIRABIInfo to enable SPIR_FUNC calling convention. 2020-12-12 05:48:20 -08:00
CodeGenSYCL Revert "[SYCL] Implement __builtin_unique_stable_name." 2020-10-12 01:10:09 -04:00
Coverage
CoverageMapping
Driver [ARM][AArch64] Add Cortex-A78C Support for Clang and LLVM 2020-12-29 10:18:59 +00:00
FixIt
Format [format] Add overload to parseConfiguration that accept llvm::MemoryBufferRef 2020-12-23 12:08:29 +00:00
Frontend [clang] Fix expected errors in plugin attribute example 2020-12-21 16:47:23 +00:00
Headers [OpenCL] Implement extended subgroups fully in headers. 2020-12-10 16:40:15 +00:00
Import clang-import-test: Clean up error output for files that cannot be found 2020-12-11 17:07:58 -08:00
Index mac/arm: XFAIL the last 3 failing tests 2020-12-12 15:09:17 -05:00
Integration
InterfaceStubs
Layout [AIX] Support two itanium alignment LIT testcases for AIX using regex 2020-10-13 16:47:01 -04:00
Lexer [c++2b] Add tests for feature test macros. 2020-12-18 13:42:23 -08:00
Misc [LoopDeletion] Allows deletion of possibly infinite side-effect free loops 2020-12-30 21:43:01 -05:00
Modules s/instantate/instantiate/ throughout. NFCI. 2020-12-01 22:13:40 -05:00
OpenMP Revert "Following up on PR48517, fix handling of template arguments that refer" 2020-12-22 10:18:08 -08:00
PCH Add another test for PR48434. 2020-12-09 12:22:35 -08:00
Parser Print source location in the error message when parens are missing around sizeof typename and the expression is inside macro expansion 2020-12-16 12:03:31 -08:00
Preprocessor [ARM] Adding v8.7-A command-line support for the ARM target 2020-12-17 13:48:54 +00:00
Profile Revert 741978d727 and things that landed on top of it. 2020-12-23 12:52:11 -05:00
Refactor
Rewriter
Sema Revert "DR2064: decltype(E) is only a dependent type if E is type-dependent, not" 2020-12-22 10:18:08 -08:00
SemaCUDA [CUDA] Do not diagnose host/device variable access in dependent types. 2020-12-14 11:53:18 -08:00
SemaCXX Revert "DR2064: decltype(E) is only a dependent type if E is type-dependent, not" 2020-12-22 10:18:08 -08:00
SemaObjC Detect section type conflicts between functions and variables 2020-12-17 11:43:47 -05:00
SemaObjCXX [clang] add a `swift_async_name` attribute 2020-12-04 15:55:29 -08:00
SemaOpenCL [OpenCL] Implement extended subgroups fully in headers. 2020-12-10 16:40:15 +00:00
SemaOpenCLCXX Fix a pair of tests that would fail on a win32 box 2020-11-17 14:28:52 -08:00
SemaSYCL Fix missing error for use of 128-bit integer inside SPIR64 device code. 2020-12-07 10:42:32 -08:00
SemaTemplate Revert "PR24076, PR33655, C++ CWG 1558: Consider the instantiation-dependence of" 2020-12-23 12:31:52 +01:00
TableGen Recommit "[CUDA][HIP] Defer overloading resolution diagnostics for host device functions" 2020-10-19 17:48:04 -04:00
Templight
Tooling
Unit
VFS
clang-rename [clang-rename] Fix rename on variable templates. 2020-10-19 09:44:59 +02:00
utils/update_cc_test_checks [utils] Fix UpdateTestChecks case where 2 runs differ for last label 2020-12-15 07:16:54 -08:00
.clang-format
CMakeLists.txt Reland [CMake][NewPM] Move ENABLE_EXPERIMENTAL_NEW_PASS_MANAGER into llvm/ 2020-12-01 14:00:32 -08:00
TestRunner.sh
cxx-sections.data
lit.cfg.py [mac/arm] fix clang/test/Driver/darwin-ld-dedup.c 2020-11-23 13:32:29 -05:00
lit.site.cfg.py.in Reland [CMake][NewPM] Move ENABLE_EXPERIMENTAL_NEW_PASS_MANAGER into llvm/ 2020-12-01 14:00:32 -08:00
make_test_dirs.pl