summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2011-04-12 23:05:59 +0000
committerDan Gohman <gohman@apple.com>2011-04-12 23:05:59 +0000
commitca4cac4c74e849a4ebd276dce9bbf56ef368d232 (patch)
tree741a53f4edeb7025cfd2f8a68e5ac49705546947 /docs
parentf9b2dc66c87256b55f9bdfe037d1fa6f705200e8 (diff)
downloadllvm-ca4cac4c74e849a4ebd276dce9bbf56ef368d232.tar.gz
llvm-ca4cac4c74e849a4ebd276dce9bbf56ef368d232.tar.bz2
llvm-ca4cac4c74e849a4ebd276dce9bbf56ef368d232.tar.xz
Fix a hole in the definition of "dependence" used by trap values. Trap
values are also transmitted through branches which cause side effects to be skipped altogether. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129404 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs')
-rw-r--r--docs/LangRef.html24
1 files changed, 22 insertions, 2 deletions
diff --git a/docs/LangRef.html b/docs/LangRef.html
index 90b200809c..dfb0bd1d7e 100644
--- a/docs/LangRef.html
+++ b/docs/LangRef.html
@@ -2371,6 +2371,11 @@ b: unreachable
is always executed when control transfers to one of the successors, and
may not be executed when control is transfered to another.</li>
+<li>Additionally, an instruction also <i>control-depends</i> on a terminator
+ instruction if the set of instructions it otherwise depends on would be
+ different if the terminator had transfered control to a different
+ successor.</li>
+
<li>Dependence is transitive.</li>
</ul>
@@ -2413,8 +2418,23 @@ end:
; control-dependent on %cmp, so this
; always results in a trap value.
- volatile store i32 0, i32* @g ; %end is control-equivalent to %entry
- ; so this is defined (ignoring earlier
+ volatile store i32 0, i32* @g ; This would depend on the store in %true
+ ; if %cmp is true, or the store in %entry
+ ; otherwise, so this is undefined behavior.
+
+ %br i1 %cmp, %second_true, %second_end
+ ; The same branch again, but this time the
+ ; true block doesn't have side effects.
+
+second_true:
+ ; No side effects!
+ br label %end
+
+second_end:
+ volatile store i32 0, i32* @g ; This time, the instruction always depends
+ ; on the store in %end. Also, it is
+ ; control-equivalent to %end, so this is
+ ; well- defined (again, ignoring earlier
; undefined behavior in this example).
</pre>