This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Don't reduce the width of loads if it prevents combining a shift
ClosedPublic

Authored by john.brawn on Mar 22 2018, 11:02 AM.

Details

Summary

Loads and stores can only shift the offset register by the size of the value being loaded, but currently the DAGCombiner will reduce the width of the load if it's followed by a trunc making it impossible to later combine the shift.

Solve this by implementing shouldReduceLoadWidth for the AArch64 backend and make it prevent the width reduction if this is what would happen, though do allow it if reducing the load width will let us eliminate a later sign or zero extend.

Diff Detail

Repository
rL LLVM

Event Timeline

john.brawn created this revision.Mar 22 2018, 11:02 AM
t.p.northover accepted this revision.Mar 23 2018, 6:28 AM

Looks reasonable to me.

This revision is now accepted and ready to land.Mar 23 2018, 6:28 AM
This revision was automatically updated to reflect the committed changes.
evandro added a subscriber: evandro.Jun 5 2018, 1:21 PM