summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2012-03-24 00:14:51 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2012-03-24 00:14:51 +0000
commit39dd328ed0892e063d02768336c4b792c925cdc3 (patch)
treeaa22c2c837d8e0dd7d4cc7747d37d37f2235bd73 /docs
parent1db394921b9635980555cc8d7e0d05b5e885784f (diff)
downloadllvm-39dd328ed0892e063d02768336c4b792c925cdc3.tar.gz
llvm-39dd328ed0892e063d02768336c4b792c925cdc3.tar.bz2
llvm-39dd328ed0892e063d02768336c4b792c925cdc3.tar.xz
First part of PR12251. Add documentation and verifier support for the range
metadata. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153359 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs')
-rw-r--r--docs/LangRef.html34
1 files changed, 34 insertions, 0 deletions
diff --git a/docs/LangRef.html b/docs/LangRef.html
index 81dabc91af..cfe489031e 100644
--- a/docs/LangRef.html
+++ b/docs/LangRef.html
@@ -104,6 +104,7 @@
<ol>
<li><a href="#tbaa">'<tt>tbaa</tt>' Metadata</a></li>
<li><a href="#fpaccuracy">'<tt>fpaccuracy</tt>' Metadata</a></li>
+ <li><a href="#range">'<tt>range</tt>' Metadata</a></li>
</ol>
</li>
</ol>
@@ -3028,6 +3029,39 @@ call void @llvm.dbg.value(metadata !24, i64 0, metadata !25)
</pre>
</div>
+<!-- _______________________________________________________________________ -->
+<h4>
+ <a name="range">'<tt>range</tt>' Metadata</a>
+</h4>
+
+<div>
+<p><tt>range</tt> metadata may be attached only to loads of integer types. It
+ expresses the possible ranges the loaded value is in. The ranges are
+ represented with a flattened list of integers. The loaded value is known to
+ be in the union of the ranges defined by each consecutive pair. Each pair
+ has the following properties:</p>
+<ul>
+ <li>The type must match the type loaded by the instruction.</li>
+ <li>The pair <tt>a,b</tt> represents the range <tt>[a,b)</tt>.</li>
+ <li>Both <tt>a</tt> and <tt>b</tt> are constants.</li>
+ <li>The range is allowed to wrap.</li>
+ <li>The range should not represent the full or empty set. That is,
+ <tt>a!=b</tt>. </li>
+</ul>
+
+<p>Examples:</p>
+<div class="doc_code">
+<pre>
+ %a = load i8* %x, align 1, !range !0 ; Can only be 0 or 1
+ %b = load i8* %y, align 1, !range !1 ; Can only be 255 (-1), 0 or 1
+ %c = load i8* %z, align 1, !range !2 ; Can only be 0, 1, 3, 4 or 5
+...
+!0 = metadata !{ i8 0, i8 2 }
+!1 = metadata !{ i8 255, i8 2 }
+!2 = metadata !{ i8 0, i8 2, i8 3, i8 6 }
+</pre>
+</div>
+</div>
</div>
</div>