This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Fix read-undef flags when schedule is reverted
ClosedPublic

Authored by rampitec on Feb 27 2017, 1:24 PM.

Details

Summary

If two subregs of the same register are defined and we need to revert
schedule changing def order, we will end up with both instructions
having def,read-undef flags because adjustLaneLiveness() will only set
this flag but will not remove it.

Fix this by removing read-undef flags before calling adjustLaneLiveness.

Diff Detail

Repository
rL LLVM

Event Timeline

rampitec created this revision.Feb 27 2017, 1:24 PM
arsenm added inline comments.Feb 27 2017, 1:28 PM
lib/Target/AMDGPU/GCNSchedStrategy.cpp
354–355

This doesn't handle implicit defs

rampitec updated this revision to Diff 89936.Feb 27 2017, 2:11 PM
rampitec marked an inline comment as done.
rampitec added a reviewer: arsenm.

Also process implicit defs.

lib/Target/AMDGPU/GCNSchedStrategy.cpp
354–355

Yes, fixed.

rampitec updated this revision to Diff 89965.Feb 27 2017, 7:52 PM

Run all instructions through flags update loop, even if not moved. Flags can be affected by other instructions moved around this one.

rampitec updated this revision to Diff 89969.Feb 27 2017, 8:08 PM

Fixed typo in transferring patch.

vpykhtin accepted this revision.Feb 28 2017, 7:26 AM

LGTM.

This revision is now accepted and ready to land.Feb 28 2017, 7:26 AM
This revision was automatically updated to reflect the committed changes.