This is an archive of the discontinued LLVM Phabricator instance.

[GlobalISel] Fix load-or combine moving loads across potential aliasing stores.
ClosedPublic

Authored by aemerson on Jul 18 2021, 11:38 PM.

Details

Summary

Although this combine checks that there's no load folding barriers between the loads that it's trying to merge, it was inserting the load at the MIRBuilder's default insertion point, which is the G_OR use inst.

This was causing a miscompile in the test suite's SingleSource/Regression/C/gcc-c-torture/execute/GCC-C-execute-bswap-2

Diff Detail

Event Timeline

aemerson created this revision.Jul 18 2021, 11:38 PM
aemerson requested review of this revision.Jul 18 2021, 11:38 PM
paquette accepted this revision.Jul 19 2021, 9:27 AM

Oh wow.

LGTM, thanks!

This revision is now accepted and ready to land.Jul 19 2021, 9:27 AM
This revision was landed with ongoing or failed builds.Jul 19 2021, 10:23 AM
This revision was automatically updated to reflect the committed changes.