This is an archive of the discontinued LLVM Phabricator instance.

[DAGCombine] add tests for bswap-shift optimization
ClosedPublic

Authored by Chenbing.Zheng on Mar 11 2022, 6:53 PM.

Details

Summary

This patch add some tests to show some optimization opportunities for bswap-shift.

Diff Detail

Event Timeline

Chenbing.Zheng created this revision.Mar 11 2022, 6:53 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 11 2022, 6:53 PM
Chenbing.Zheng requested review of this revision.Mar 11 2022, 6:53 PM
Chenbing.Zheng retitled this revision from [DAGCombine] precommit tests for (bswap(srl (bswap c), x)) -> (shl c, x) to [DAGCombine] add tests for bswap-shift optimization.
Chenbing.Zheng edited the summary of this revision. (Show Details)
Chenbing.Zheng added a reviewer: spatel.
Chenbing.Zheng set the repository for this revision to rG LLVM Github Monorepo.Mar 28 2022, 1:13 AM
RKSimon added inline comments.Mar 28 2022, 5:14 AM
llvm/test/CodeGen/X86/combine-bswap.ll
42

Please can you add one i16 + i64 test case each as well? i16 as it lowers to a rotate and i64 so we can check its correctly handled on 32-bit targets

address comment

This revision is now accepted and ready to land.Mar 29 2022, 12:49 AM
This revision was landed with ongoing or failed builds.Mar 29 2022, 1:37 AM
This revision was automatically updated to reflect the committed changes.