diff options
| author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2019-09-09 22:24:57 +0000 |
|---|---|---|
| committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2019-09-09 22:24:57 +0000 |
| commit | f0e2755b45a42a3c3284c7a3cec82147065c36a2 (patch) | |
| tree | 9368d6fa1aeec2de94a7e8dc4ca1f84be56f90c4 /llvm/docs/LangRef.rst | |
| parent | e0bce4e1c2abf39b27f0f0d1e771f09fd5cfa8b8 (diff) | |
| download | bcm5719-llvm-f0e2755b45a42a3c3284c7a3cec82147065c36a2.tar.gz bcm5719-llvm-f0e2755b45a42a3c3284c7a3cec82147065c36a2.zip | |
LangRef: mention MSan's problem with speculative conditional branches.
Summary:
This short blurb aims to disallow optimizations like we had to revert
(under MSan) in
https://reviews.llvm.org/D21165
https://bugs.llvm.org/show_bug.cgi?id=28054
https://reviews.llvm.org/D67205
Reviewers: vitalybuka, efriedma
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67244
llvm-svn: 371461
Diffstat (limited to 'llvm/docs/LangRef.rst')
| -rw-r--r-- | llvm/docs/LangRef.rst | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst index b953dbd0f17..e0610974f30 100644 --- a/llvm/docs/LangRef.rst +++ b/llvm/docs/LangRef.rst @@ -3245,6 +3245,17 @@ match what was already there. However, a store *to* an undefined location could clobber arbitrary memory, therefore, it has undefined behavior. +**MemorySanitizer**, a detector of uses of uninitialized memory, +defines a branch with condition that depends on an undef value (or +certain other values, like e.g. a result of a load from heap-allocated +memory that has never been stored to) to have an externally visible +side effect. For this reason functions with *sanitize_memory* +attribute are not allowed to produce such branches "out of thin +air". More strictly, an optimization that inserts a conditional branch +is only valid if in all executions where the branch condition has at +least one undefined bit, the same branch condition is evaluated in the +input IR as well. + .. _poisonvalues: Poison Values |

