diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst --- a/llvm/docs/LangRef.rst +++ b/llvm/docs/LangRef.rst @@ -1958,6 +1958,18 @@ the function. The instrumentation checks that the return address for the function has not changed between the function prolog and epilog. It is currently x86_64-specific. +``mustprogress`` + This attribute indicates that the function is required to return, unwind, + or interact with the environment in an observable way e.g. via a volatile + memory access, I/O, or other synchronization. The ``mustprogress`` + attribute is intended to model the requirements of the first section of + [intro.progress] of the C++ Standard. As a consequence, a loop in a + function with the `mustprogress` attribute can be assumed to terminate if + it does not interact with the environment in an observable way, and + terminating loops without side-effects can be removed. If a `mustprogress` + function does not satisfy this contract, the behavior is undefined. This + attribute does not apply transitively to callees, but does apply to call + sites within the function. Note that `willreturn` implies `mustprogress`. Call Site Attributes ---------------------- diff --git a/llvm/utils/emacs/llvm-mode.el b/llvm/utils/emacs/llvm-mode.el --- a/llvm/utils/emacs/llvm-mode.el +++ b/llvm/utils/emacs/llvm-mode.el @@ -23,7 +23,7 @@ ;; Attributes `(,(regexp-opt '("alwaysinline" "argmemonly" "builtin" "cold" "convergent" "inaccessiblememonly" - "inaccessiblemem_or_argmemonly" "inlinehint" "jumptable" "minsize" "naked" "nobuiltin" + "inaccessiblemem_or_argmemonly" "inlinehint" "jumptable" "minsize" "mustprogress" "naked" "nobuiltin" "noduplicate" "nofree" "noimplicitfloat" "noinline" "nonlazybind" "noredzone" "noreturn" "norecurse" "noundef" "nounwind" "optnone" "optsize" "readnone" "readonly" "returns_twice" "speculatable" "ssp" "sspreq" "sspstrong" "safestack" "sanitize_address" "sanitize_hwaddress" "sanitize_memtag" diff --git a/llvm/utils/kate/llvm.xml b/llvm/utils/kate/llvm.xml --- a/llvm/utils/kate/llvm.xml +++ b/llvm/utils/kate/llvm.xml @@ -81,6 +81,7 @@ argmemonly convergent inlinehint + mustprogress naked nobuiltin noimplicitfloat diff --git a/llvm/utils/llvm.grm b/llvm/utils/llvm.grm --- a/llvm/utils/llvm.grm +++ b/llvm/utils/llvm.grm @@ -175,6 +175,7 @@ | sanitize_address | sanitize_thread | sanitize_memory + | mustprogress ; OptFuncAttrs ::= + _ | OptFuncAttrs FuncAttr ; diff --git a/llvm/utils/vim/syntax/llvm.vim b/llvm/utils/vim/syntax/llvm.vim --- a/llvm/utils/vim/syntax/llvm.vim +++ b/llvm/utils/vim/syntax/llvm.vim @@ -107,6 +107,7 @@ \ module \ monotonic \ msp430_intrcc + \ mustprogress \ musttail \ naked \ nest diff --git a/llvm/utils/vscode/llvm/syntaxes/ll.tmLanguage.yaml b/llvm/utils/vscode/llvm/syntaxes/ll.tmLanguage.yaml --- a/llvm/utils/vscode/llvm/syntaxes/ll.tmLanguage.yaml +++ b/llvm/utils/vscode/llvm/syntaxes/ll.tmLanguage.yaml @@ -204,6 +204,7 @@ \\bmodule\\b|\ \\bmonotonic\\b|\ \\bmsp430_intrcc\\b|\ + \\bmustprogress\\b|\ \\bmusttail\\b|\ \\bnaked\\b|\ \\bnest\\b|\