This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] Bubble vector.reverse of compare operands to their result.
ClosedPublic

Authored by paulwalker-arm on Dec 5 2022, 9:23 AM.

Details

Summary

This mirrors a similar shufflevector transformation so the same
effect is obtained for scalable vectors. The transformation is
only performed when it can be proven the number of resulting
reversals is not increased. By bubbling the reversals from operand
to result this should typically be the case and ideally leads to
back-back shuffles that can be elimitated entirely.

Diff Detail

Event Timeline

paulwalker-arm created this revision.Dec 5 2022, 9:23 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 5 2022, 9:23 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
paulwalker-arm requested review of this revision.Dec 5 2022, 9:23 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 5 2022, 9:23 AM
david-arm added inline comments.Dec 6 2022, 3:14 AM
llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
6099

If possible it would be nice to have a fcmp fast test that showed the propagation of flags here.

Converted reverse_fcmp_reverse to show flags get preserved.

david-arm accepted this revision.Dec 8 2022, 7:53 AM

LGTM!

This revision is now accepted and ready to land.Dec 8 2022, 7:53 AM
This revision was landed with ongoing or failed builds.Dec 21 2022, 8:01 AM
This revision was automatically updated to reflect the committed changes.