1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00
llvm-mirror/utils
Atmn Patel cbe95c4921 [LangRef] Define mustprogress attribute
LLVM IR currently assumes some form of forward progress. This form is
not explicitly defined anywhere, and is the cause of miscompilations
in most languages that are not C++11 or later. This implicit forward progress
guarantee can not be opted out of on a function level nor on a loop
level. Languages such as C (C11 and later), C++ (pre-C++11), and Rust
have different forward progress requirements and this needs to be
evident in the IR.

Specifically, C11 and onwards (6.8.5, Paragraph 6) states that "An
iteration statement whose controlling expression is not a constant
expression, that performs no input/output operations, does not access
volatile objects, and performs no synchronization or atomic operations
in its body, controlling expression, or (in the case of for statement)
its expression-3, may be assumed by the implementation to terminate."
C++11 and onwards does not have this assumption, and instead assumes
that every thread must make progress as defined in [intro.progress] when
it comes to scheduling.

This was initially brought up in [0] as a bug, a solution was presented
in [1] which is the current workaround, and the predecessor to this
change was [2].

After defining a notion of forward progress for IR, there are two
options to address this:
1) Set the default to assuming Forward Progress and provide an opt-out for functions and an opt-in for loops.
2) Set the default to not assuming Forward Progress and provide an opt-in for functions, and an opt-in for loops.

Option 2) has been selected because only C++11 and onwards have a
forward progress requirement and it makes sense for them to opt-into it
via the defined `mustprogress` function attribute.  The `mustprogress`
function attribute indicates that the function is required to make
forward progress as defined. This is sharply in contrast to the status
quo where this is implicitly assumed. In addition, `willreturn` implies `mustprogress`.

The background for why this definition was chosen is in [3] and for why
the option was chosen is in [4] and the corresponding thread(s). The implementation is in D85393, the
clang patch is in D86841, the LoopDeletion patch is in D86844, the
Inliner patches are in D87180 and D87262, and there will be more
incoming.

[0] https://bugs.llvm.org/show_bug.cgi?id=965#c25
[1] https://lists.llvm.org/pipermail/llvm-dev/2017-October/118558.html
[2] https://reviews.llvm.org/D65718
[3] https://lists.llvm.org/pipermail/llvm-dev/2020-September/144919.html
[4] https://lists.llvm.org/pipermail/llvm-dev/2020-September/145023.html

Reviewed By: jdoerfert, efriedma, nikic

Differential Revision: https://reviews.llvm.org/D86233
2020-10-19 13:34:27 -04:00
..
benchmark [M680x0] Add google/benchmark's CycleTimer support for M68K 2020-10-07 14:58:36 -07:00
bugpoint [NFC] Fix trivial typos in comments 2020-01-06 10:50:26 +00:00
count
crosstool
docker Harmonize Python shebang 2020-07-16 21:53:45 +02:00
emacs [LangRef] Define mustprogress attribute 2020-10-19 13:34:27 -04:00
FileCheck Internalize functions from various tools. NFC 2020-09-26 15:57:13 -07:00
fpcmp
gdb-scripts Change to individual pretty printer classes, remove generic make_printer. 2020-03-11 15:04:03 +01:00
git Add a git hook script that can be manually setup to run some checks on every push 2020-06-24 21:13:43 +00:00
gn [gn build] Port 6154c4115cd 2020-10-19 04:23:08 +00:00
jedit
kate [LangRef] Define mustprogress attribute 2020-10-19 13:34:27 -04:00
KillTheDoctor [KillTheDoctor/CMake] Add missing keyword PRIVATE in target_link_libraries 2020-09-07 16:08:55 +03:00
lint Harmonize Python shebang 2020-07-16 21:53:45 +02:00
lit [lit] Avoid calling realpath() for every printed message 2020-10-19 16:21:34 +01:00
llvm-build Use configure depends to trigger reconfiguration when LLVMBuild files change 2020-05-26 16:30:20 +01:00
llvm-lit Execute llvm-lit with the python found by CMake by default 2020-08-03 10:51:35 +01:00
llvm-locstats [llvm-dwarfdump][Stats] Clean up 2020-05-04 09:35:40 +02:00
LLVMVisualizers Add MSVC natvis visualisation of llvm::Type 2020-05-15 09:38:37 -04:00
Misc
not PrintStackTrace: don't symbolize if LLVM_DISABLE_SYMBOLIZATION is set 2020-08-21 11:27:13 -07:00
PerfectShuffle revert parts of d7888149aa813f that several bots do not like 2020-03-25 14:05:07 -04:00
release Add flang to export.sh to it gets source tarballs in releases 2020-07-31 17:22:57 +02:00
Reviewing [find_interesting_reviews.py] Add git blame output cache 2019-12-23 12:08:16 +00:00
sanitizers Add a ubsan blacklist entry for libstdc++ 8.0.1. 2018-11-21 23:04:39 +00:00
TableGen [ARM][SchedModels] Convert IsPredicatedPred to MCSchedPredicate 2020-10-19 11:37:54 +03:00
Target/ARM
testgen Harmonize Python shebang 2020-07-16 21:53:45 +02:00
textmate
unittest [cmake] Make gtest include directories a part of the library interface 2020-08-27 15:35:57 +02:00
UpdateTestChecks clang: Make changes in 7c8bb409f31e py2.7-compatible 2020-09-18 16:15:37 -04:00
valgrind
vim [LangRef] Define mustprogress attribute 2020-10-19 13:34:27 -04:00
vscode [LangRef] Define mustprogress attribute 2020-10-19 13:34:27 -04:00
yaml-bench Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
abtest.py utils/abtest: Refactor and add bisection method 2018-09-07 17:08:44 +00:00
add_argument_names.py IR: print value numbers for unnamed function arguments 2019-08-03 14:28:34 +00:00
bisect [utils] Fix incompatibility of bisect[-skip-count] with Python 3 2019-10-04 16:44:18 +00:00
bisect-skip-count [utils] Fix incompatibility of bisect[-skip-count] with Python 3 2019-10-04 16:44:18 +00:00
bugpoint_gisel_reducer.py Add a utility to reduce GlobalISel tests 2018-01-23 19:47:10 +00:00
check_ninja_deps.py [utils] New script check_ninja_deps.py 2020-07-14 14:54:08 +01:00
check-each-file Added support for C++ compilation. 2004-02-26 23:02:25 +00:00
chunk-print-before-all.py [Tools] Fixed bug with llvm/utils/chunk-print-before-all.py script. 2020-04-09 22:24:55 +00:00
clang-parse-diagnostics-file utils: Tweak clang-parse-diagnostics-file for modules includes 2020-04-02 14:16:26 -07:00
codegen-diff Add debug variable. 2003-10-16 23:46:01 +00:00
collect_and_build_with_pgo.py [utils] collect_and_build_with_pgo.py: revert part already fixed in rL345461 2018-10-27 23:10:09 +00:00
convert-constraint-log-to-z3.py Recommit "[ConstraintSystem] Add helpers to deal with linear constraints." 2020-09-15 12:07:26 +01:00
countloc.sh Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
create_ladder_graph.py [Utils] Make some scripts directly executable 2020-02-28 13:39:54 +00:00
demangle_tree.py Python compat - print statement 2019-01-03 14:11:33 +00:00
DSAclean.py Harmonize Python shebang 2020-07-16 21:53:45 +02:00
DSAextract.py Harmonize Python shebang 2020-07-16 21:53:45 +02:00
extract_symbols.py [AIX] Make sure we use export lists for plugins 2020-05-08 14:00:25 -04:00
extract_vplan.py [utils] Fix regexp in llvm/utils/extract_vplan.py to extract VPlans. 2020-08-19 08:57:12 +01:00
findmisopt Delete -std-compile-opts. 2014-10-16 20:00:02 +00:00
findoptdiff Recommit "[IPConstProp] Remove and move tests to SCCP." 2020-08-02 22:23:54 +01:00
findsym.pl Fix a comment. 2006-08-09 19:40:13 +00:00
GenLibDeps.pl [Bitcode] Move Bitstream to a separate library 2019-07-03 22:40:07 +00:00
GetSourceVersion [utils] Fix Get{RepositoryPath,SourceVersion} to have a more robust is-git-svn 2012-05-15 18:44:09 +00:00
getsrcs.sh Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
indirect_calls.py Python compat - print statement 2019-01-03 14:11:33 +00:00
lldbDataFormatters.py Bring llvm::Optional data formatter back in sync with the implementation. 2020-08-26 15:10:39 -07:00
llvm-compilers-check Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
llvm-gisel-cov.py [NFC] Fix minor python issues. 2020-02-28 14:17:43 -08:00
llvm-native-gxx Convert a bunch of uses of 'bytecode' into 'bitcode'. This 2010-09-29 20:09:55 +00:00
llvm.grm [LangRef] Define mustprogress attribute 2020-10-19 13:34:27 -04:00
LLVMBuild.txt Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
llvmdo Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
llvmgrep Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
merge-stats.py [NFC] Add utility to sum/merge stats files 2020-08-07 19:02:42 +02:00
prepare-code-coverage-artifact.py svn propset svn:executable on utils/prepare-code-coverage-artifact.py 2019-06-04 23:35:07 +00:00
schedcover.py Harmonize Python shebang 2020-07-16 21:53:45 +02:00
shuffle_fuzz.py Pythran compat - range vs. xrange 2019-01-03 14:11:58 +00:00
shuffle_select_fuzz_tester.py [Utils] Make some scripts directly executable 2020-02-28 13:39:54 +00:00
sort_includes.py Add polly support to sort_includes.py 2015-05-09 09:08:56 +00:00
unicode-case-fold.py Python compat - urllib 2019-01-03 14:12:44 +00:00
update_analyze_test_checks.py Update update_analyze_test_checks.py to support API changes from D83004 2020-09-21 16:09:05 +01:00
update_cc_test_checks.py [UpdateCCTestChecks] Include generated functions if asked 2020-09-18 06:34:59 -05:00
update_llc_test_checks.py [UpdateCCTestChecks] Include generated functions if asked 2020-09-18 06:34:59 -05:00
update_mca_test_checks.py [UpdateTestChecks] Change shebang from python to python3 2019-12-03 13:50:07 -08:00
update_mir_test_checks.py [UpdateTestChecks] Change shebang from python to python3 2019-12-03 13:50:07 -08:00
update_test_checks.py [UpdateCCTestChecks] Include generated functions if asked 2020-09-18 06:34:59 -05:00
UpdateCMakeLists.pl Generalize matching of add_executable to add_XXX_executable. 2012-11-22 07:48:52 +00:00
wciia.py Python compat - print statement 2019-01-03 14:11:33 +00:00