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.
qcolombet Carrot efriedma nemanjai
- Group Reviewers
- rG8a5858c8fd50: [TwoAddressInstruction][PowerPC] Call `regOverlapsSet` to find out real…
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.