This is an archive of the discontinued LLVM Phabricator instance.

[MIR] Update MIRLangRef with bundled instructions
ClosedPublic

Authored by thegameg on Jan 9 2018, 10:42 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

thegameg created this revision.Jan 9 2018, 10:42 AM
MatzeB added inline comments.Jan 9 2018, 11:22 AM
docs/MIRLangRef.rst
393–395 ↗(On Diff #129124)

Ugh, I never noticed the MI syntax makes a distinction between "inside" and "outside" of a bundle (I assume that notion comes from MachineInstr::isInsideBundle()). Unfortunately that notion doesn't always make sense as we can have bundles without a header. In which case the current syntax can be somewhat confusing :-(

Because of this I would recommend to not talk about "instructions starting a bundle" or "being outside/inside of a bundle" to not confuse the matter even more. Maybe something like this instead:

The first instruction is often a bundle header. The instructions between ``{`` and ``}`` are bundled with the first instruction.

I would tweak the example a bit to be something that would actually be valid MI:

BUNDLE implicit-def %r0, implicit-def %r1, implicit %r2 {
  %r0 = SOME_OP %r2
  %r1 = ANOTHER_OP internal %0
}
397–404 ↗(On Diff #129124)

Did this syntax emerge by accident (I don't see what it is good for)? Should we maybe not document it?

thegameg updated this revision to Diff 129240.Jan 10 2018, 4:16 AM
thegameg marked an inline comment as done.

Go with Matthias' explanation.

docs/MIRLangRef.rst
393–395 ↗(On Diff #129124)

Thanks, makes more sense.

397–404 ↗(On Diff #129124)

We explicitly handle this case in the MIR parser, but I can't see why. Should we get rid of it?

MatzeB accepted this revision.Jan 10 2018, 9:25 AM

LGTM

This revision is now accepted and ready to land.Jan 10 2018, 9:25 AM
This revision was automatically updated to reflect the committed changes.