Page MenuHomePhabricator

[X86] Improve x86-partial-reduction to support abs intrinsic
ClosedPublic

Authored by wxiao3 on Mar 30 2022, 7:01 PM.

Details

Summary

Current implementation only recognizes absolute operation implemented by
select instruction. This patch adds support for abs intrinsic.

Diff Detail

Unit TestsFailed

TimeTest
60,110 msx64 debian > AddressSanitizer-x86_64-linux-dynamic.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 -shared-libasan -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_64LinuxDynamicConfig/TestCases/Output/scariness_score_test.cpp.tmp
60,100 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

Event Timeline

wxiao3 created this revision.Mar 30 2022, 7:01 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 30 2022, 7:01 PM
wxiao3 requested review of this revision.Mar 30 2022, 7:01 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 30 2022, 7:01 PM
LuoYuanke accepted this revision.Mar 31 2022, 9:08 PM

LGTM, pls wait for 1 or 2 days to land in case Craig or Phoebe have some comments.

This revision is now accepted and ready to land.Mar 31 2022, 9:08 PM
craig.topper added inline comments.Mar 31 2022, 10:08 PM
llvm/lib/Target/X86/X86PartialReduction.cpp
225

Sink RHS into the else so it doens't get accidentally used.

226
llvm/test/CodeGen/X86/sad.ll
1133

This part about SelectionDAGBuilder I think refers to the how we handled these cases before X86PartialReduction.cpp was added.

wxiao3 updated this revision to Diff 419700.Apr 1 2022, 3:29 AM

Address comments from Craig.

wxiao3 marked 2 inline comments as done.Apr 1 2022, 3:31 AM
This revision was landed with ongoing or failed builds.Apr 4 2022, 8:33 PM
This revision was automatically updated to reflect the committed changes.