[PATCH] D41872: [MIR] Update MIRLangRef with bundled instructions
Matthias Braun via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 9 11:22:25 PST 2018
MatzeB added inline comments.
================
Comment at: docs/MIRLangRef.rst:393-395
+where the first instruction ``%r0 = IMPLICIT_DEF`` is **starting** the bundle,
+but it is **outside** the bundle. The two other instructions are **inside** the
+bundle. The ``}`` ends the bundle.
----------------
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
}
```
================
Comment at: docs/MIRLangRef.rst:397-404
+The following syntax where the first instruction **inside** the bundle is on
+the same line is also accepted:
+
+.. code-block:: text
+
+ %r0 = IMPLICIT_DEF { %r1 = IMPLICIT_DEF
+ %r2 = IMPLICIT_DEF
----------------
Did this syntax emerge by accident (I don't see what it is good for)? Should we maybe not document it?
https://reviews.llvm.org/D41872
More information about the llvm-commits
mailing list