Page MenuHomePhabricator

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

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

Diff Detail

Unit TestsFailed

TimeTest
60,120 msx64 debian > AddressSanitizer-x86_64-linux.TestCases::scariness_score_test.cpp
Script: -- : 'RUN: at line 4'; /var/lib/buildkite-agent/builds/llvm-project/build/./bin/clang --driver-mode=g++ -fsanitize=address -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only -m64 -O0 /var/lib/buildkite-agent/builds/llvm-project/compiler-rt/test/asan/TestCases/scariness_score_test.cpp -o /var/lib/buildkite-agent/builds/llvm-project/build/projects/compiler-rt/test/asan/X86_64LinuxConfig/TestCases/Output/scariness_score_test.cpp.tmp
80 msx64 debian > LLVM.CodeGen/X86::shift-combine.ll
Script: -- : 'RUN: at line 2'; /var/lib/buildkite-agent/builds/llvm-project/build/bin/llc -mtriple=i686-unknown < /var/lib/buildkite-agent/builds/llvm-project/llvm/test/CodeGen/X86/shift-combine.ll | /var/lib/buildkite-agent/builds/llvm-project/build/bin/FileCheck /var/lib/buildkite-agent/builds/llvm-project/llvm/test/CodeGen/X86/shift-combine.ll --check-prefix=X32

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 ↗(On Diff #450737)

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 ↗(On Diff #450737)

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
556 ↗(On Diff #451068)

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
556 ↗(On Diff #451068)

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