This is an archive of the discontinued LLVM Phabricator instance.

Fix reordering of instructions during VirtRegRewriter unbundling
ClosedPublic

Authored by critson on Oct 5 2020, 4:17 AM.

Details

Summary

When unbundling COPY bundles in VirtRegRewriter the start of the
bundle is not correctly referenced in the unbundling loop.

The effect of this is that unbundled instructions are sometimes
inserted out-of-order, particular in cases where multiple
reordering have been applied to avoid clobbering dependencies.
The resulting instruction sequence clobbers dependencies.

Diff Detail

Event Timeline

critson created this revision.Oct 5 2020, 4:17 AM
critson requested review of this revision.Oct 5 2020, 4:17 AM
critson updated this revision to Diff 296153.Oct 5 2020, 4:36 AM

Pre-commit test.

foad added inline comments.Oct 5 2020, 5:24 AM
llvm/test/CodeGen/AMDGPU/splitkit-copy-bundle.mir
301

So the bug here is that this overwrites sgpr16 before the copy from sgpr16_sgpr17?

critson added inline comments.Oct 5 2020, 5:26 AM
llvm/test/CodeGen/AMDGPU/splitkit-copy-bundle.mir
301

Yes

foad accepted this revision.Oct 5 2020, 5:34 AM

LGTM, though I can't help feeling the whole function could be simpler.

This revision is now accepted and ready to land.Oct 5 2020, 5:34 AM
This revision was landed with ongoing or failed builds.Oct 5 2020, 5:43 PM
This revision was automatically updated to reflect the committed changes.