This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] delete no more needed workaround for readsRegister() in PowerPC
ClosedPublic

Authored by shchenz on Jan 30 2019, 12:11 AM.

Details

Summary

There are two places we made a workaround in PPCInstrInfo.cpp to avoid readsRegister() bug.

// MachineInstr::readsRegister only returns true if the machine
// instruction reads the exact register or its super-register. It
// does not consider uses of sub-registers which seems like strange
// behaviour. Nonetheless, if we end up with a 64-bit register here,
// get the corresponding 32-bit register to check.
unsigned Reg = RegMO.getReg();
if (PPC::G8RCRegClass.contains(Reg))
  Reg = Reg - PPC::X0 + PPC::R0;

This is not needed anymore. readsRegister() is fixed in https://reviews.llvm.org/D54128

Diff Detail

Repository
rL LLVM

Event Timeline

shchenz created this revision.Jan 30 2019, 12:11 AM
This revision is now accepted and ready to land.Jan 30 2019, 10:19 AM
This revision was automatically updated to reflect the committed changes.