This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by paulwalker-arm on Dec 5 2022, 9:26 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:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 5 2022, 9:26 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
paulwalker-arm requested review of this revision.Dec 5 2022, 9:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 5 2022, 9:26 AM

Converted binop_reverse to show flags get preserved.

Tighten up LHS==RHS case based on feedback from @david-arm.

This revision is now accepted and ready to land.Dec 16 2022, 7:05 AM