diff options
author | Dan Gohman <gohman@apple.com> | 2010-04-26 20:54:53 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-04-26 20:54:53 +0000 |
commit | 5488427de33c4e7ee53fd6fa13f76b4c57bb5de1 (patch) | |
tree | 43eda618006b57d434fa1893e2e43b9d9f244ea0 /docs | |
parent | 30af6cb62139f95ec241fcea89523fe504b0d312 (diff) | |
download | external_llvm-5488427de33c4e7ee53fd6fa13f76b4c57bb5de1.zip external_llvm-5488427de33c4e7ee53fd6fa13f76b4c57bb5de1.tar.gz external_llvm-5488427de33c4e7ee53fd6fa13f76b4c57bb5de1.tar.bz2 |
Branching or switching on trap transfers imminent undefined behavior
onto control-dependent instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102381 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs')
-rw-r--r-- | docs/LangRef.html | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/docs/LangRef.html b/docs/LangRef.html index ab69b05..c1788ad 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -2318,6 +2318,15 @@ has undefined behavior.</p> Any instruction with a trap operand which may have side effects emits those side effects as if it had an undef operand instead.</p> +<p>If a <a href="#i_br"><tt>br</tt></a> or + <a href="#i_switch"><tt>switch</tt></a> instruction has a trap value + operand, all non-phi non-void instructions which control-depend on it + have trap as their result value. If any instruction which + control-depends on the <tt>br</tt> or <tt>switch</tt> invokes externally + visible side effects, the behavior of the program is undefined.</p> + +<!-- FIXME: What about exceptions thrown from control-dependent instrs? --> + <p>For example, an <a href="#i_and"><tt>and</tt></a> of a trap value with zero still has a trap value result. Using that value as an index in a <a href="#i_getelementptr"><tt>getelementptr</tt></a> yields a trap |