Page MenuHomePhabricator

[DAGCombiner] Teach scalarizeBinOpOfSplats handle scalable splat.
ClosedPublic

Authored by jacquesguan on Mar 31 2022, 2:15 AM.

Details

Summary

This revision supports to scalarize a binary operation of two scalable
splat vectors.

Diff Detail

Unit TestsFailed

TimeTest
150 msx64 debian > LLVM.CodeGen/AArch64::active_lane_mask.ll
Script: -- : 'RUN: at line 2'; /var/lib/buildkite-agent/builds/llvm-project/build/bin/llc -mtriple=aarch64-linux-gnu -mattr=+sve < /var/lib/buildkite-agent/builds/llvm-project/llvm/test/CodeGen/AArch64/active_lane_mask.ll | /var/lib/buildkite-agent/builds/llvm-project/build/bin/FileCheck /var/lib/buildkite-agent/builds/llvm-project/llvm/test/CodeGen/AArch64/active_lane_mask.ll
120 msx64 debian > LLVM.CodeGen/AArch64::fdiv-combine.ll
Script: -- : 'RUN: at line 2'; /var/lib/buildkite-agent/builds/llvm-project/build/bin/llc -mtriple=aarch64-unknown-unknown < /var/lib/buildkite-agent/builds/llvm-project/llvm/test/CodeGen/AArch64/fdiv-combine.ll | /var/lib/buildkite-agent/builds/llvm-project/build/bin/FileCheck /var/lib/buildkite-agent/builds/llvm-project/llvm/test/CodeGen/AArch64/fdiv-combine.ll
120 msx64 debian > LLVM.CodeGen/AArch64::sve-fixed-length-fp-select.ll
Script: -- : 'RUN: at line 2'; /var/lib/buildkite-agent/builds/llvm-project/build/bin/llc -aarch64-sve-vector-bits-min=256 < /var/lib/buildkite-agent/builds/llvm-project/llvm/test/CodeGen/AArch64/sve-fixed-length-fp-select.ll | /var/lib/buildkite-agent/builds/llvm-project/build/bin/FileCheck /var/lib/buildkite-agent/builds/llvm-project/llvm/test/CodeGen/AArch64/sve-fixed-length-fp-select.ll -check-prefixes=CHECK,VBITS_GE_256
160 msx64 debian > LLVM.CodeGen/AArch64::sve-fixed-length-int-select.ll
Script: -- : 'RUN: at line 2'; /var/lib/buildkite-agent/builds/llvm-project/build/bin/llc -aarch64-sve-vector-bits-min=256 < /var/lib/buildkite-agent/builds/llvm-project/llvm/test/CodeGen/AArch64/sve-fixed-length-int-select.ll | /var/lib/buildkite-agent/builds/llvm-project/build/bin/FileCheck /var/lib/buildkite-agent/builds/llvm-project/llvm/test/CodeGen/AArch64/sve-fixed-length-int-select.ll -check-prefixes=CHECK,VBITS_GE_256
120 msx64 debian > LLVM.CodeGen/AArch64::sve-gep.ll
Script: -- : 'RUN: at line 2'; /var/lib/buildkite-agent/builds/llvm-project/build/bin/llc -mtriple=aarch64-linux-gnu -mattr=+sve < /var/lib/buildkite-agent/builds/llvm-project/llvm/test/CodeGen/AArch64/sve-gep.ll | /var/lib/buildkite-agent/builds/llvm-project/build/bin/FileCheck /var/lib/buildkite-agent/builds/llvm-project/llvm/test/CodeGen/AArch64/sve-gep.ll
View Full Test Results (9 Failed)

Event Timeline

jacquesguan created this revision.Mar 31 2022, 2:15 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 31 2022, 2:15 AM
jacquesguan requested review of this revision.Mar 31 2022, 2:15 AM

precommit the new tests and rebase so the patch shows the diff?

rebase the precommit test.

craig.topper added inline comments.Jun 14 2022, 9:49 PM
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
23501

Not sure we should be creating SPLAT_VECTOR on targets that don't support SPLAT_VECTOR. At the very least it's a waste of compile time to convert it back to a BUILD_VECTOR.

RKSimon added inline comments.Jun 15 2022, 4:31 AM
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
23471

Use DAG.isSplatValue instead?

23501

+1 at the very least we need a hasOperation() check for the getSplatVector path and getBuildVector fallback

Address comment.

Fix test case.

jacquesguan added inline comments.Jul 10 2022, 7:27 PM
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
23471

I tried to use DAG.isSplatValue, but this way would affect many no splat cases of X86 target, some of them are negative.

23501

Done, I only build splat_vector when is scalable now.

RKSimon accepted this revision.Jul 18 2022, 1:53 AM

LGTM with one minor

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
23471

OK - please can you add a TODO comment? It sounds like something that needs revisiting in the future.

This revision is now accepted and ready to land.Jul 18 2022, 1:53 AM

Address comment.

This revision was landed with ongoing or failed builds.Jul 18 2022, 8:23 PM
This revision was automatically updated to reflect the committed changes.
jacquesguan reopened this revision.Jul 19 2022, 1:24 AM
This revision is now accepted and ready to land.Jul 19 2022, 1:24 AM

rebase main