diff options
author | Francis Visoiu Mistrih <francisvm@yahoo.com> | 2017-12-13 10:30:45 +0000 |
---|---|---|
committer | Francis Visoiu Mistrih <francisvm@yahoo.com> | 2017-12-13 10:30:45 +0000 |
commit | c84690975acd7c5f43e4c44d4653a9f7e384ba8f (patch) | |
tree | f0535db11a70ddf14bd51ac62383f4a4557e578e /docs | |
parent | 061f5ff24a3062e2793bcb38adec31d4326aa689 (diff) |
[CodeGen] Print constant pool index operands as %const.0 + 8 in both MIR and debug output
Work towards the unification of MIR and debug output by printing
`%const.0 + 8` instead of `<cp#0+8>` and `%const.0 - 8` instead of
`<cp#0-8>`.
Only debug syntax is affected.
Differential Revision: https://reviews.llvm.org/D41116
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320564 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs')
-rw-r--r-- | docs/MIRLangRef.rst | 49 |
1 files changed, 47 insertions, 2 deletions
diff --git a/docs/MIRLangRef.rst b/docs/MIRLangRef.rst index 7615a28112d..82a61bcde86 100644 --- a/docs/MIRLangRef.rst +++ b/docs/MIRLangRef.rst @@ -549,6 +549,53 @@ lower bits from the 32-bit virtual register 0 to the 8-bit virtual register 1: The names of the subregister indices are target specific, and are typically defined in the target's ``*RegisterInfo.td`` file. +Constant Pool Indices +^^^^^^^^^^^^^^^^^^^^^ + +A constant pool index (CPI) operand is printed using its index in the +function's ``MachineConstantPool`` and an offset. + +For example, a CPI with the index 1 and offset 8: + +.. code-block:: text + + %1:gr64 = MOV64ri %const.1 + 8 + +For a CPI with the index 0 and offset -12: + +.. code-block:: text + + %1:gr64 = MOV64ri %const.0 - 12 + +A constant pool entry is bound to a LLVM IR ``Constant`` or a target-specific +``MachineConstantPoolValue``. When serializing all the function's constants the +following format is used: + +.. code-block:: text + + constants: + - id: <index> + value: <value> + alignment: <alignment> + isTargetSpecific: <target-specific> + +where ``<index>`` is a 32-bit unsigned integer, ``<value>`` is a `LLVM IR Constant +<https://www.llvm.org/docs/LangRef.html#constants>`_, alignment is a 32-bit +unsigned integer, and ``<target-specific>`` is either true or false. + +Example: + +.. code-block:: text + + constants: + - id: 0 + value: 'double 3.250000e+00' + alignment: 8 + - id: 1 + value: 'g-(LPC0+8)' + alignment: 4 + isTargetSpecific: true + Global Value Operands ^^^^^^^^^^^^^^^^^^^^^ @@ -578,8 +625,6 @@ the '@' prefix, like in the following examples: ``@0``, ``@989``. .. 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 constant pool 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. |