summaryrefslogtreecommitdiffstats
path: root/llvm/docs
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2016-12-08 19:01:00 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2016-12-08 19:01:00 +0000
commit235c275b20d44e3aeb8bfe98dc34b2ead704bf32 (patch)
tree538eadab86e6bfd2ee1a401abcfe3c67355524ae /llvm/docs
parentaa4f4450af0b6e5406189679713b61f225d0ab1b (diff)
downloadbcm5719-llvm-235c275b20d44e3aeb8bfe98dc34b2ead704bf32.tar.gz
bcm5719-llvm-235c275b20d44e3aeb8bfe98dc34b2ead704bf32.zip
IR, X86: Understand !absolute_symbol metadata on global variables.
Summary: Attaching !absolute_symbol to a global variable does two things: 1) Marks it as an absolute symbol reference. 2) Specifies the value range of that symbol's address. Teach the X86 backend to allow absolute symbols to appear in place of immediates by extending the relocImm and mov64imm32 matchers. Start using relocImm in more places where it is legal. As previously proposed on llvm-dev: http://lists.llvm.org/pipermail/llvm-dev/2016-October/105800.html Differential Revision: https://reviews.llvm.org/D25878 llvm-svn: 289087
Diffstat (limited to 'llvm/docs')
-rw-r--r--llvm/docs/LangRef.rst19
1 files changed, 19 insertions, 0 deletions
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index 33cf6adc4ee..4dd7157d04e 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -4589,6 +4589,25 @@ Examples:
!2 = !{ i8 0, i8 2, i8 3, i8 6 }
!3 = !{ i8 -2, i8 0, i8 3, i8 6 }
+'``absolute_symbol``' Metadata
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+``absolute_symbol`` metadata may be attached to a global variable
+declaration. It marks the declaration as a reference to an absolute symbol,
+which causes the backend to use absolute relocations for the symbol even
+in position independent code, and expresses the possible ranges that the
+global variable's *address* (not its value) is in, in the same format as
+``range`` metadata.
+
+Example:
+
+.. code-block:: llvm
+
+ @a = external global i8, !absolute_symbol !0 ; Absolute symbol in range [0,256)
+
+ ...
+ !0 = !{ i64 0, i64 256 }
+
'``unpredictable``' Metadata
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OpenPOWER on IntegriCloud