diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2017-04-28 20:25:27 +0000 |
---|---|---|
committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2017-04-28 20:25:27 +0000 |
commit | ea376dae2597d580e335df43370833003818c129 (patch) | |
tree | 6781af880b949fae23a04529962f13e1afdc095d /docs | |
parent | 81de60661c39cbee91a9a1fdeed991bb3e13cd8b (diff) |
Add speculatable function attribute
This attribute tells the optimizer that the function may be speculated.
Patch by Tom Stellard
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301680 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs')
-rw-r--r-- | docs/LangRef.rst | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/docs/LangRef.rst b/docs/LangRef.rst index b0a31589cc4f..bf4973ca9aed 100644 --- a/docs/LangRef.rst +++ b/docs/LangRef.rst @@ -1535,6 +1535,17 @@ example: ``sanitize_thread`` This attribute indicates that ThreadSanitizer checks (dynamic thread safety analysis) are enabled for this function. +``speculatable`` + This function attribute indicates that the function does not have any + effects besides calculating its result and does not have undefined behavior. + Note that ``speculatable`` is not enough to conclude that along any + particular exection path the number of calls to this function will not be + externally observable. This attribute is only valid on functions + and declarations, not on individual call sites. If a function is + incorrectly marked as speculatable and really does exhibit + undefined behavior, the undefined behavior may be observed even + if the call site is dead code. + ``ssp`` This attribute indicates that the function should emit a stack smashing protector. It is in the form of a "canary" --- a random value |