This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Reassociate BFI
ClosedPublic

Authored by dmgreen on Jun 29 2021, 3:02 AM.

Details

Summary

D104868 removed an (incorrect) fold for distributing BFI instructions in a chain, combining them into a single instruction. BFI's like that are hard to test, as the patterns are often destroyed before they become BFIs. But it did lead to regressions in some of our tests.

This patch adds a replacement, which reassociates BFI instructions with non-overlapping insertion masks so that low bits are inserted first. This can end up sorting the nodes so that adjacent inserts are next to one another, allowing the existing folds to combine into a single BFI.

Diff Detail

Event Timeline

dmgreen created this revision.Jun 29 2021, 3:02 AM
dmgreen requested review of this revision.Jun 29 2021, 3:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 29 2021, 3:02 AM

Seems reasonable.

llvm/lib/Target/ARM/ARMISelLowering.cpp
14128

Please add a comment explaining what this is doing.

dmgreen updated this revision to Diff 355461.Jun 30 2021, 12:28 AM

Add a comment.

This revision is now accepted and ready to land.Jun 30 2021, 1:18 AM
This revision was landed with ongoing or failed builds.Jul 1 2021, 1:08 PM
Closed by commit rG3d48775b89cf: [ARM] Reassociate BFI (authored by dmgreen). · Explain Why
This revision was automatically updated to reflect the committed changes.