summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorFrancis Visoiu Mistrih <francisvm@yahoo.com>2017-12-13 10:30:59 +0000
committerFrancis Visoiu Mistrih <francisvm@yahoo.com>2017-12-13 10:30:59 +0000
commitd347e9783d50a8cf05802144830a5f3da7aedc32 (patch)
treec180ae5286e5711953d637bf54a9fc306cab82c7 /docs
parent2b16863067fa1f188f616f80ab6ea23e7d1cb7c1 (diff)
[CodeGen] Print jump-table index operands as %jump-table.0 in both MIR and debug output
Work towards the unification of MIR and debug output by printing `%jump-table.0` instead of `<jt#0>`. Only debug syntax is affected. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320566 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs')
-rw-r--r--docs/MIRLangRef.rst37
1 files changed, 35 insertions, 2 deletions
diff --git a/docs/MIRLangRef.rst b/docs/MIRLangRef.rst
index b0e3984c338..ebc9d456703 100644
--- a/docs/MIRLangRef.rst
+++ b/docs/MIRLangRef.rst
@@ -238,6 +238,8 @@ in the block's definition:
The block's name should be identical to the name of the IR block that this
machine block is based on.
+.. _block-references:
+
Block References
^^^^^^^^^^^^^^^^
@@ -630,6 +632,39 @@ and the offset 8:
%sgpr2 = S_ADD_U32 _, target-index(amdgpu-constdata-start) + 8, implicit-def _, implicit-def _
+Jump-table Index Operands
+^^^^^^^^^^^^^^^^^^^^^^^^^
+
+A jump-table index operand with the index 0 is printed as following:
+
+.. code-block:: text
+
+ tBR_JTr killed %r0, %jump-table.0
+
+A machine jump-table entry contains a list of ``MachineBasicBlocks``. When serializing all the function's jump-table entries, the following format is used:
+
+.. code-block:: text
+
+ jumpTable:
+ kind: <kind>
+ entries:
+ - id: <index>
+ blocks: [ <bbreference>, <bbreference>, ... ]
+
+where ``<kind>`` is describing how the jump table is represented and emitted (plain address, relocations, PIC, etc.), and each ``<index>`` is a 32-bit unsigned integer and ``blocks`` contains a list of :ref:`machine basic block references <block-references>`.
+
+Example:
+
+.. code-block:: text
+
+ jumpTable:
+ kind: inline
+ entries:
+ - id: 0
+ blocks: [ '%bb.3', '%bb.9', '%bb.4.d3' ]
+ - id: 1
+ blocks: [ '%bb.7', '%bb.7', '%bb.4.d3', '%bb.5' ]
+
.. TODO: Describe the parsers default behaviour when optional YAML attributes
are missing.
.. TODO: Describe the syntax for the bundled instructions.
@@ -640,8 +675,6 @@ and the offset 8:
.. TODO: Describe the frame information YAML mapping.
.. TODO: Describe the syntax of the stack object machine operands and their
YAML definitions.
-.. TODO: Describe the syntax of the jump table machine operands and their
- YAML definitions.
.. TODO: Describe the syntax of the block address machine operands.
.. TODO: Describe the syntax of the CFI index machine operands.
.. TODO: Describe the syntax of the metadata machine operands, and the