This is an archive of the discontinued LLVM Phabricator instance.

[TwoAddressInstruction][PowerPC] Call `regOverlapsSet` to find out real clobbers and uses
ClosedPublic

Authored by lkail on Oct 1 2020, 8:58 PM.

Details

Summary

In rescheduleKillAboveMI, current implementation uses SmallSet to track reg's defs and uses. When comparing, use SmallSet.count to find out if it's clobbered or used. It's not correct if involving subregisters. This patch uses regOverlapsSet already used by rescheduleMIBelowKill to fix the issue.

Fixed https://bugs.llvm.org/show_bug.cgi?id=47707.

Diff Detail

Event Timeline

lkail created this revision.Oct 1 2020, 8:58 PM
lkail requested review of this revision.Oct 1 2020, 8:58 PM
lkail edited reviewers, added: efriedma; removed: eli.friedman.
lkail updated this revision to Diff 295727.Oct 1 2020, 9:00 PM
lkail edited the summary of this revision. (Show Details)
nemanjai accepted this revision.Oct 7 2020, 5:24 AM

LGTM. Checking for overlap rather than simply the same register should be the right thing to do. However, I wonder if we might have other places where a similar assumption is made that could become a problem since we presumably only mark the subregister as an implicit def.

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