This is an archive of the discontinued LLVM Phabricator instance.

[DAGCombine] Hoist shifts out of a logic operations tree.
ClosedPublic

Authored by fzhinkin on Aug 4 2022, 11:35 AM.

Diff Detail

Event Timeline

fzhinkin created this revision.Aug 4 2022, 11:35 AM
fzhinkin requested review of this revision.Aug 4 2022, 11:35 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 4 2022, 11:35 AM
fzhinkin edited the summary of this revision. (Show Details)Aug 4 2022, 11:37 AM
fzhinkin added reviewers: spatel, RKSimon.
fzhinkin edited the summary of this revision. (Show Details)Aug 8 2022, 2:24 AM
fzhinkin added inline comments.
llvm/test/CodeGen/X86/shift-combine.ll
510

I'll precommit new tests if there will be no objections to add the new transformation.

spatel added inline comments.Aug 8 2022, 6:10 AM
llvm/test/CodeGen/X86/shift-combine.ll
510

Yes - please go ahead with adding the tests.

fzhinkin updated this revision to Diff 451068.Aug 9 2022, 1:49 AM

Updated x86 tests

spatel added inline comments.Aug 9 2022, 7:09 AM
llvm/test/CodeGen/X86/shift-combine.ll
508–704

Can you vary the operand order in these tests to check the commuted patterns? It seems like we are only testing the case where the shifts are operand 0 of the logic ops.

fzhinkin updated this revision to Diff 451224.Aug 9 2022, 11:33 AM

Rebase

llvm/test/CodeGen/X86/shift-combine.ll
508–704

Done, thank you for suggestion

spatel accepted this revision.Aug 9 2022, 12:03 PM

LGTM

This revision is now accepted and ready to land.Aug 9 2022, 12:03 PM