<li><a href="#int_it">'<tt>llvm.init.trampoline</tt>' Intrinsic</a></li>
</ol>
</li>
- <li><a href="#int_atomics">Atomic intrinsics</a>
- <ol>
- <li><a href="#int_memory_barrier"><tt>llvm.memory_barrier</tt></a></li>
- <li><a href="#int_atomic_cmp_swap"><tt>llvm.atomic.cmp.swap</tt></a></li>
- <li><a href="#int_atomic_swap"><tt>llvm.atomic.swap</tt></a></li>
- <li><a href="#int_atomic_load_add"><tt>llvm.atomic.load.add</tt></a></li>
- <li><a href="#int_atomic_load_sub"><tt>llvm.atomic.load.sub</tt></a></li>
- <li><a href="#int_atomic_load_and"><tt>llvm.atomic.load.and</tt></a></li>
- <li><a href="#int_atomic_load_nand"><tt>llvm.atomic.load.nand</tt></a></li>
- <li><a href="#int_atomic_load_or"><tt>llvm.atomic.load.or</tt></a></li>
- <li><a href="#int_atomic_load_xor"><tt>llvm.atomic.load.xor</tt></a></li>
- <li><a href="#int_atomic_load_max"><tt>llvm.atomic.load.max</tt></a></li>
- <li><a href="#int_atomic_load_min"><tt>llvm.atomic.load.min</tt></a></li>
- <li><a href="#int_atomic_load_umax"><tt>llvm.atomic.load.umax</tt></a></li>
- <li><a href="#int_atomic_load_umin"><tt>llvm.atomic.load.umin</tt></a></li>
- </ol>
- </li>
+ <li><a href="#int_atomics">Atomic intrinsics</a>
+ <ol>
+ <li><a href="#int_memory_barrier"><tt>llvm.memory_barrier</tt></a></li>
+ <li><a href="#int_atomic_cmp_swap"><tt>llvm.atomic.cmp.swap</tt></a></li>
+ <li><a href="#int_atomic_swap"><tt>llvm.atomic.swap</tt></a></li>
+ <li><a href="#int_atomic_load_add"><tt>llvm.atomic.load.add</tt></a></li>
+ <li><a href="#int_atomic_load_sub"><tt>llvm.atomic.load.sub</tt></a></li>
+ <li><a href="#int_atomic_load_and"><tt>llvm.atomic.load.and</tt></a></li>
+ <li><a href="#int_atomic_load_nand"><tt>llvm.atomic.load.nand</tt></a></li>
+ <li><a href="#int_atomic_load_or"><tt>llvm.atomic.load.or</tt></a></li>
+ <li><a href="#int_atomic_load_xor"><tt>llvm.atomic.load.xor</tt></a></li>
+ <li><a href="#int_atomic_load_max"><tt>llvm.atomic.load.max</tt></a></li>
+ <li><a href="#int_atomic_load_min"><tt>llvm.atomic.load.min</tt></a></li>
+ <li><a href="#int_atomic_load_umax"><tt>llvm.atomic.load.umax</tt></a></li>
+ <li><a href="#int_atomic_load_umin"><tt>llvm.atomic.load.umin</tt></a></li>
+ </ol>
+ </li>
<li><a href="#int_general">General intrinsics</a>
<ol>
<li><a href="#int_var_annotation">
- <tt>llvm.var.annotation</tt>' Intrinsic</a></li>
+ '<tt>llvm.var.annotation</tt>' Intrinsic</a></li>
<li><a href="#int_annotation">
- <tt>llvm.annotation.*</tt>' Intrinsic</a></li>
+ '<tt>llvm.annotation.*</tt>' Intrinsic</a></li>
<li><a href="#int_trap">
- <tt>llvm.trap</tt>' Intrinsic</a></li>
+ '<tt>llvm.trap</tt>' Intrinsic</a></li>
+ <li><a href="#int_stackprotector">
+ '<tt>llvm.stackprotector</tt>' Intrinsic</a></li>
</ol>
</li>
</ol>
</dl>
-<p><a name="linkage_external"></a>For example, since the "<tt>.LC0</tt>"
+<p>For example, since the "<tt>.LC0</tt>"
variable is defined to be internal, if another module defined a "<tt>.LC0</tt>"
variable and was linked with this one, one of the two would be renamed,
preventing a collision. Since "<tt>main</tt>" and "<tt>puts</tt>" are
return values. </dd>
<dt><tt>noalias</tt></dt>
- <dd>This indicates that the parameter does not alias any global or any other
- parameter. The caller is responsible for ensuring that this is the case,
- usually by placing the value in a stack allocation. This is not a valid
- attribute for return values.</dd>
+ <dd>This indicates that the pointer does not alias any global or any other
+ parameter. The caller is responsible for ensuring that this is the
+ case. On a function return value, <tt>noalias</tt> additionally indicates
+ that the pointer does not alias any other pointers visible to the
+ caller. Note that this applies only to pointers that can be used to actually
+ load/store a value: NULL, unique pointers from malloc(0), and freed pointers
+ are considered to not alias anything.</dd>
<dt><tt>nest</tt></dt>
<dd>This indicates that the pointer parameter can be excised using the
be set in the caller. A readonly function always returns the same value (or
throws the same exception) when called with the same set of arguments and global
state.</dd>
+
+<dt><tt><a name="ssp">ssp</a></tt></dt>
+<dd>This attribute indicates that the function should emit a stack smashing
+protector. It is in the form of a "canary"—a random value placed on the
+stack before the local variables that's checked upon return from the function to
+see if it has been overwritten. A heuristic is used to determine if a function
+needs stack protectors or not.
+
+<p>If a function that has an <tt>ssp</tt> attribute is inlined into a function
+that doesn't have an <tt>ssp</tt> attribute, then the resulting function will
+have an <tt>ssp</tt> attribute.</p></dd>
+
+<dt><tt>sspreq</tt></dt>
+<dd>This attribute indicates that the function should <em>always</em> emit a
+stack smashing protector. This overrides the <tt><a href="#ssp">ssp</a></tt>
+function attribute.
+
+<p>If a function that has an <tt>sspreq</tt> attribute is inlined into a
+function that doesn't have an <tt>sspreq</tt> attribute or which has
+an <tt>ssp</tt> attribute, then the resulting function will have
+an <tt>sspreq</tt> attribute.</p></dd>
</dl>
</div>
</td>
</tr><tr class="layout">
<td class="left"><tt>{i32, i32} (i32)</tt></td>
- <td class="left">A function taking an <tt>i32></tt>, returning two
- <tt> i32 </tt> values as an aggregate of type <tt>{ i32, i32 }</tt>
+ <td class="left">A function taking an <tt>i32</tt>, returning two
+ <tt>i32</tt> values as an aggregate of type <tt>{ i32, i32 }</tt>
</td>
</tr>
</table>
<h5>Syntax:</h5>
<pre>
- <result> = shufflevector <n x <ty>> <v1>, <n x <ty>> <v2>, <n x i32> <mask> <i>; yields <n x <ty>></i>
+ <result> = shufflevector <n x <ty>> <v1>, <n x <ty>> <v2>, <m x i32> <mask> <i>; yields <m x <ty>></i>
</pre>
<h5>Overview:</h5>
<p>
The '<tt>shufflevector</tt>' instruction constructs a permutation of elements
-from two input vectors, returning a vector of the same type.
+from two input vectors, returning a vector with the same element type as
+the input and length that is the same as the shuffle mask.
</p>
<h5>Arguments:</h5>
<p>
-The first two operands of a '<tt>shufflevector</tt>' instruction are vectors
-with types that match each other and types that match the result of the
-instruction. The third argument is a shuffle mask, which has the same number
-of elements as the other vector type, but whose element type is always 'i32'.
+The first two operands of a '<tt>shufflevector</tt>' instruction are vectors
+with types that match each other. The third argument is a shuffle mask whose
+element type is always 'i32'. The result of the instruction is a vector whose
+length is the same as the shuffle mask and whose element type is the same as
+the element type of the first two operands.
</p>
<p>
<p>
The elements of the two input vectors are numbered from left to right across
both of the vectors. The shuffle mask operand specifies, for each element of
-the result vector, which element of the two input registers the result element
+the result vector, which element of the two input vectors the result element
gets. The element selector may be undef (meaning "don't care") and the second
operand may be undef if performing a shuffle from only one vector.
</p>
<4 x i32> <i32 0, i32 4, i32 1, i32 5> <i>; yields <4 x i32></i>
%result = shufflevector <4 x i32> %v1, <4 x i32> undef,
<4 x i32> <i32 0, i32 1, i32 2, i32 3> <i>; yields <4 x i32></i> - Identity shuffle.
+ %result = shufflevector <8 x i32> %v1, <8 x i32> undef,
+ <4 x i32> <i32 0, i32 1, i32 2, i32 3> <i>; yields <4 x i32></i>
+ %result = shufflevector <4 x i32> %v1, <4 x i32> %v2,
+ <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7 > <i>; yields <8 x i32></i>
</pre>
</div>
<h5>Semantics:</h5>
<p>Memory is allocated using the system "<tt>malloc</tt>" function, and
-a pointer is returned. The result of a zero byte allocattion is undefined. The
+a pointer is returned. The result of a zero byte allocation is undefined. The
result is null if there is insufficient memory available.</p>
<h5>Example:</h5>
<div class="doc_text">
<h5>Syntax:</h5>
+<p>This is an overloaded intrinsic. You can use llvm.memcpy on any integer bit
+width. Not all targets support all bit widths however.</p>
<pre>
+ declare void @llvm.memcpy.i8(i8 * <dest>, i8 * <src>,
+ i8 <len>, i32 <align>)
+ declare void @llvm.memcpy.i16(i8 * <dest>, i8 * <src>,
+ i16 <len>, i32 <align>)
declare void @llvm.memcpy.i32(i8 * <dest>, i8 * <src>,
i32 <len>, i32 <align>)
declare void @llvm.memcpy.i64(i8 * <dest>, i8 * <src>,
<div class="doc_text">
<h5>Syntax:</h5>
+<p>This is an overloaded intrinsic. You can use llvm.memmove on any integer bit
+width. Not all targets support all bit widths however.</p>
<pre>
+ declare void @llvm.memmove.i8(i8 * <dest>, i8 * <src>,
+ i8 <len>, i32 <align>)
+ declare void @llvm.memmove.i16(i8 * <dest>, i8 * <src>,
+ i16 <len>, i32 <align>)
declare void @llvm.memmove.i32(i8 * <dest>, i8 * <src>,
i32 <len>, i32 <align>)
declare void @llvm.memmove.i64(i8 * <dest>, i8 * <src>,
<div class="doc_text">
<h5>Syntax:</h5>
+<p>This is an overloaded intrinsic. You can use llvm.memset on any integer bit
+width. Not all targets support all bit widths however.</p>
<pre>
+ declare void @llvm.memset.i8(i8 * <dest>, i8 <val>,
+ i8 <len>, i32 <align>)
+ declare void @llvm.memset.i16(i8 * <dest>, i8 <val>,
+ i16 <len>, i32 <align>)
declare void @llvm.memset.i32(i8 * <dest>, i8 <val>,
i32 <len>, i32 <align>)
declare void @llvm.memset.i64(i8 * <dest>, i8 <val>,
</p>
</div>
+<!-- _______________________________________________________________________ -->
+<div class="doc_subsubsection">
+ <a name="int_stackprotector">'<tt>llvm.stackprotector</tt>' Intrinsic</a>
+</div>
+<div class="doc_text">
+<h5>Syntax:</h5>
+<pre>
+declare void @llvm.stackprotector( i8* <guard>, i8** <slot> )
+
+</pre>
+<h5>Overview:</h5>
+<p>
+ The <tt>llvm.stackprotector</tt> intrinsic takes the <tt>guard</tt> and stores
+ it onto the stack at <tt>slot</tt>. The stack slot is adjusted to ensure that
+ it is placed on the stack before local variables.
+</p>
+<h5>Arguments:</h5>
+<p>
+ The <tt>llvm.stackprotector</tt> intrinsic requires two pointer arguments. The
+ first argument is the value loaded from the stack guard
+ <tt>@__stack_chk_guard</tt>. The second variable is an <tt>alloca</tt> that
+ has enough space to hold the value of the guard.
+</p>
+<h5>Semantics:</h5>
+<p>
+ This intrinsic causes the prologue/epilogue inserter to force the position of
+ the <tt>AllocaInst</tt> stack slot to be before local variables on the
+ stack. This is to ensure that if a local variable on the stack is overwritten,
+ it will destroy the value of the guard. When the function exits, the guard on
+ the stack is checked against the original guard. If they're different, then
+ the program aborts by calling the <tt>__stack_chk_fail()</tt> function.
+</p>
+</div>
+
<!-- *********************************************************************** -->
<hr>
<address>