This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] Improve bitreverse optimization
ClosedPublic

Authored by austin880625 on May 23 2023, 1:00 PM.

Details

Summary

This patch utilizes the helper function implemented in D149699 and thus folds the following cases:

bitreverse(logic_op(x, bitreverse(y))) -> logic_op(bitreverse(x), y)
bitreverse(logic_op(bitreverse(x), y)) -> logic_op(x, bitreverse(y))
bitreverse(logic_op(bitreverse(x), bitreverse(y))) -> logic_op(x, y) in multiuse case

Diff Detail

Event Timeline

austin880625 created this revision.May 23 2023, 1:00 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 23 2023, 1:00 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
austin880625 requested review of this revision.May 23 2023, 1:00 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 23 2023, 1:00 PM
goldstein.w.n accepted this revision.May 23 2023, 1:14 PM

Thanks for following this up :)

LGTM. I'll wait a day or so to push so others have a chance to take a look.

This revision is now accepted and ready to land.May 23 2023, 1:14 PM
nikic added inline comments.May 23 2023, 1:43 PM
llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
1723–1727

nit: Omit braces for single-line if.

It also looks like some tab indentation snuck in here?

Fix indentation and if formatting

RKSimon accepted this revision.May 24 2023, 8:52 AM

LGTM

This revision was landed with ongoing or failed builds.May 25 2023, 11:42 AM
This revision was automatically updated to reflect the committed changes.