[PATCH] MIR Serialization: Serialize the machine basic block successor weights.

Duncan P. N. Exon Smith dexonsmith at apple.com
Tue Jul 28 15:53:32 PDT 2015


> On 2015-Jul-28, at 15:21, Alex L <arphaman at gmail.com> wrote:
> 
> Hi,
> 
> This patch serializes the machine basic block successor's weights.
> This patch adds a new attribute 'successors-and-weights' to the
> machine basic block YAML mapping. The new attribute is used
> to store an array of successors and their corresponding weights.
> Example:
> 
>     successors-and-weights: [ { block: '%bb.1.less', weight: 16 }, { block: '%bb.2.exit', weight: 16 } ]

This seems really heavyweight.  I wonder if we can do better.

A few ideas off the top of my head:

    successors: [ '%bb.1.less 16', '%bb.2.exit 16' ]
    successors: [ '%bb.1.less (16)', '%bb.2.exit (16)' ]
    successors: [ '%bb.1.less weight: 16', '%bb.2.exit weight: 16' ]

Thoughts?  Any other ideas?

> 
> The old attribute 'successors' still can be used to specify the
> machine basic block's successors when those successors don't
> have any weights.
> 
> Thanks,
> Alex
> <0001-MIR-Serialization-serialize-the-MBB-successor-weight.patch>





More information about the llvm-commits mailing list