That is possible to bundle instructions but have no leading
BUNDLE. In such a case post-RA scheduler miscalculates a number
of instructions and asserts. The bundle in the test was created
by the Greedy.
Details
Diff Detail
Event Timeline
That's a good question. Technically that is possible to create such IR. It might be OK post-RA?
For the context, it was created by the SplitEditor::buildSingleSubRegCopy() in the D30438.
I think this is an invalid bundle.
I'm inclined to think it's invalid. It looks like using bundles at all was a hack. I think VirtRegRewriter::expandCopyBundle just missed the case where a copy becomes a kill.
Can you add a second test where this weird kill bundle thing is produced?
Added splitkit-copy-bundle.mir. It produces a bundle with KILLs.
What's interesting I have created a patch to properly bundle copies in the SplitKit, which has resulted in KILLs surviving until inst printer and crash.
Seems wrong to have a bundle without BUNDLE opcode but the change seems fine obviously. Since it's allowed we should probably just account for the possibility.
It probably isn't. But there seems to be quite a few places which do not work with properly formed bundles. One of them is ExpandPostRA.
As weird as it sounds VirtRegRewriter::expandCopyBundle() does not work with properly formed bundles as well...