This is an archive of the discontinued LLVM Phabricator instance.

[globalisel] Update the legalizer documentation
ClosedPublic

Authored by dsanders on Apr 29 2019, 12:01 PM.

Details

Summary
  • The getActionDefinitionsBuilder() is now documented.
    • Includes descriptions of the various actions (legal*, widenScalar*, lower*, etc).
    • Includes descriptions of the various predicates (*If, *For, *ForCartesianProduct, etc.)
    • Includes the rule-order details
  • Removed the out-of-date prohibition on non-power-of-2 types.
  • Removed the Vector types section since it was incorrect and vectors follow the same ruleset as scalars. They're only special in the sense that more of the actions and predicates are meaningful for them (e.g. moreElements).
  • Clarified the position on context sensitive legality (which is not permitted) and contrasted this with context sensitive legalization (which is permitted).

Diff Detail

Event Timeline

dsanders created this revision.Apr 29 2019, 12:01 PM
paquette accepted this revision.Apr 29 2019, 1:23 PM

I think this looks good. I have a few stylistic suggestions, but I don't think they're worth holding up review over.

  • Added some inline comments on document structure. I think that adding some more sections would make it easier to quickly search. I'm not sure if we can have that deep of nested sections though.
  • I took this and copied it into Hemingwayapp (http://www.hemingwayapp.com) and found a few sentences were hard to read. I think it would be good to resolve some of those if possible? Of course, this is entirely stylistic preference. :)
docs/GlobalISel.rst
343–345

I think it would be better to mention the SelectionDAG/TargetLowering API after detailing the recommended method. Probably don't want people to think about the unrecommended API before thinking about the recommended API. ;)

358

If getActionDefinitionsBuilder can have its own subsection, then I think this should too for symmetry's sake.

371

I think this is long enough that it deserves its own section? (Is it possible to have another subsection here? If not, meh, whatever.)

378–379

It seems like this could have a subsection as well. Something like "Declaring Rules"?

381

Should legalIf(), legalFor() etc have code quotes?

425

This could have a section just called "Predicates" or something?

450–451

This could have a section called "Composite Rules"

468

I think that if you add a "Predicates" section, this could be pulled into there

This revision is now accepted and ready to land.Apr 29 2019, 1:23 PM
dsanders marked 10 inline comments as done.Apr 30 2019, 6:31 PM
dsanders added inline comments.
docs/GlobalISel.rst
343–345

I've moved this to a footnote. I don't like the way footnotes render (they look like citations) but at least it's out of the way.

358

I haven't put this one into a subsection as it would leave the initial section rather short and it felt like it was part of the same high-level overview. Let me know if the latest version still looks like it needs a section here

371

There's exactly one left :-)

Having added the various sections the others felt more like a reference and this one felt more like an explanation so I've expanded on this section with examples and advice. Could you take a look at the new text in the 'Rule Processing and Declaring Rules' section?

dsanders updated this revision to Diff 197495.Apr 30 2019, 6:32 PM
dsanders marked 2 inline comments as done.

Added example and further explanation of the rule processing.
Subdivided into sections and other minor changes.

The extra sections really make a difference! Looks great now.

This revision was automatically updated to reflect the committed changes.