summaryrefslogtreecommitdiff
path: root/docs/LangRef.rst
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-02-06 06:52:58 +0000
committerBill Wendling <isanbard@gmail.com>2013-02-06 06:52:58 +0000
commit95ce4c2ffb0ff31a79b060fb112659322a5be3bf (patch)
treea0c49a46b4877c7b3ac712892d8c6601dc4fed35 /docs/LangRef.rst
parent97fe3d95110db54908527e547187b3007185e46c (diff)
downloadllvm-95ce4c2ffb0ff31a79b060fb112659322a5be3bf.tar.gz
llvm-95ce4c2ffb0ff31a79b060fb112659322a5be3bf.tar.bz2
llvm-95ce4c2ffb0ff31a79b060fb112659322a5be3bf.tar.xz
Initial submission for the attribute group feature.
Attribute groups are of the form: #0 = attributes { noinline "no-sse" "cpu"="cortex-a8" alignstack=4 } Target-dependent attributes are represented as strings. Attributes can have optional values associated with them. E.g., the "cpu" attribute has the value "cortex-a8". Target-independent attributes are listed as enums inside the attribute classes. Multiple attribute groups can be referenced by the same object. In that case, the attributes are merged together. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174493 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs/LangRef.rst')
-rw-r--r--docs/LangRef.rst30
1 files changed, 30 insertions, 0 deletions
diff --git a/docs/LangRef.rst b/docs/LangRef.rst
index 8fd92f97f4..d702cfb02c 100644
--- a/docs/LangRef.rst
+++ b/docs/LangRef.rst
@@ -737,6 +737,36 @@ The compiler declares the supported values of *name*. Specifying a
collector which will cause the compiler to alter its output in order to
support the named garbage collection algorithm.
+.. _attrgrp:
+
+Attribute Groups
+----------------
+
+Attribute groups are groups of attributes that are referenced by objects within
+the IR. They are important for keeping ``.ll`` files readable, because a lot of
+functions will use the same set of attributes. In the degenerative case of a
+``.ll`` file that corresponds to a single ``.c`` file, the single attribute
+group will capture the important command line flags used to build that file.
+
+An attribute group is a module-level object. To use an attribute group, an
+object references the attribute group's ID (e.g. ``#37``). An object may refer
+to more than one attribute group. In that situation, the attributes from the
+different groups are merged.
+
+Here is an example of attribute groups for a function that should always be
+inlined, has a stack alignment of 4, and which shouldn't use SSE instructions:
+
+.. code-block:: llvm
+
+ ; Target-independent attributes:
+ #0 = attributes { alwaysinline alignstack=4 }
+
+ ; Target-dependent attributes:
+ #1 = attributes { "no-sse" }
+
+ ; Function @f has attributes: alwaysinline, alignstack=4, and "no-sse".
+ define void @f() #0 #1 { ... }
+
.. _fnattrs:
Function Attributes