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

Alex L arphaman at gmail.com
Wed Jul 29 10:49:17 PDT 2015


Thanks for the review,

I would actually prefer to keep the successors and weights separate - I've
attached a patch below that uses the following syntax:

   successors: [ '%bb.1.less', '%bb.2.exit' ]
   weights:       [ 16, 16 ]

I prefer this syntax more than the one you proposed, as with this syntax
all the MBB references have a consistent syntax that only has the
references,
without any additional attributes. Also, I think that for the majority of
the
test cases, the weights aren't really important, so the person who's writing
the test by basing it off the output of LLC can simply remove the line with
the
weights instead of removing every weight attribute in each successor.

Cheers,
Alex

2015-07-28 15:53 GMT-07:00 Duncan P. N. Exon Smith <dexonsmith at apple.com>:

>
> > 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>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150729/9b60587c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-MIR-Serialization-serialize-the-MBB-successor-weight.patch
Type: application/octet-stream
Size: 11457 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150729/9b60587c/attachment.obj>


More information about the llvm-commits mailing list