This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC][NFC] Fix bugs in r+r to r+i conversion
ClosedPublic

Authored by nemanjai on Oct 16 2018, 6:40 AM.

Details

Summary

The D-Form VSX loads introduced in ISA 3.0 are not direct D-Form equivalent of the corresponding X-Forms since they only target the Altivec registers.
Namely LXSSPX can load into any of the 64 VSX registers whereas LXSSP can only load into the upper 32 VSX registers. Similarly with the remaining affected instructions.

There is currently no way that I can see to trigger the bug, but as we add other ways of exploiting these instructions, there may very well be instances that do.

This is an NFC patch in practical terms since the changes it introduces can not be triggered without an MIR test.

Diff Detail

Repository
rL LLVM

Event Timeline

nemanjai created this revision.Oct 16 2018, 6:40 AM

The patch will disable some valid transformation post RA(i.e. LXSDX --> LXSD if the def reg is valid for D-form). We can continue to check the dst Reg to see if it is valid, instead of disabling it completely.

nemanjai updated this revision to Diff 170192.Oct 19 2018, 6:18 AM

Modified the changeset to not reduce the capabilities of the pass (select the correct opcode based on the register for post-ra).

nemanjai updated this revision to Diff 170193.Oct 19 2018, 6:27 AM
jsji accepted this revision.Oct 19 2018, 7:34 AM

LGTM! Thanks for fixing!

This revision is now accepted and ready to land.Oct 19 2018, 7:34 AM
This revision was automatically updated to reflect the committed changes.