Page MenuHomePhabricator

MIR Serialization: Serialize MBB operands.
ClosedPublic

Authored by arphaman on Jun 22 2015, 11:38 AM.

Details

Summary

This patch is based on a previous serialization patch that serializes null register operands (http://reviews.llvm.org/D10580).

This patch serializes machine basic block operands.
The following syntax is used for basic block operands:

%bb.<name>
%bb.<index>

The name is printed when the machine basic block has a name, i.e. when its basic block has a name. Otherwise, a number is printed, which is just an index into a list of machine basic blocks for that function.
Example:

JG_1 %bb.if.cond
JG_1 %bb.2

Diff Detail

Repository
rL LLVM

Event Timeline

arphaman updated this revision to Diff 28137.Jun 22 2015, 11:38 AM
arphaman retitled this revision from to MIR Serialization: Serialize MBB operands..
arphaman updated this object.
arphaman edited the test plan for this revision. (Show Details)
arphaman added reviewers: dexonsmith, bob.wilson, bogner.
arphaman set the repository for this revision to rL LLVM.
arphaman added a subscriber: Unknown Object (MLST).
arphaman updated this revision to Diff 28294.Jun 23 2015, 3:06 PM

Updated the MBB operand syntax based on Duncan's comments:

The YAML mapping for MBBs now includes a required number field. This number is used when referencing MBBs from machine instructions.

The syntax for basic block operands is now:

%bb.<number>[.<name>]

The name is purely optional, it's not used for MBB resolution. However, the parser still verifies that the name matches the name of the MBB with the given number.

Examples:

body:
   - number: 0
      name: entry
      instructions:
         ...
         - 'JG_1 %bb.2.exit'

 body:
    - number: 0
       instructions:
          ...
          - 'JG_1 %bb.3'
     - number: 1
       instructions:
          ...
     - number: 3
       instructions:
          ...
This revision was automatically updated to reflect the committed changes.