This is an archive of the discontinued LLVM Phabricator instance.

[FastISel] Fix load folding for registers with fixups
ClosedPublic

Authored by nikic on May 12 2022, 3:52 AM.

Details

Summary

FastISel tries to fold loads into the single using instruction. However, if the register has fixups, then there may be additional uses through an alias of the register.

In particular, this fixes the problem reported at https://reviews.llvm.org/D119432#3507087. The load register is (at the time of load folding) only used in a single call instruction. However, selection of the bitcast has added a fixup between the load register and the cross-BB register of the bitcast result. After fixups are applied, there would now be two uses of the load register, so load folding is not legal.

Diff Detail

Event Timeline

nikic created this revision.May 12 2022, 3:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 12 2022, 3:52 AM
nikic requested review of this revision.May 12 2022, 3:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 12 2022, 3:52 AM
RKSimon accepted this revision.May 13 2022, 8:55 AM

LGTM

This revision is now accepted and ready to land.May 13 2022, 8:55 AM
This revision was landed with ongoing or failed builds.May 16 2022, 1:25 AM
This revision was automatically updated to reflect the committed changes.