Page MenuHomePhabricator

[WIP] Very early work to enable isel of fixed length vector extracts from scalable vectors.
Needs ReviewPublic

Authored by paulwalker-arm on May 23 2022, 6:56 AM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None

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
1,390 msx64 debian > LLVM.Analysis/CostModel/AArch64::free-widening-casts.ll
Script: -- : 'RUN: at line 1'; /var/lib/buildkite-agent/builds/llvm-project/build/bin/opt < /var/lib/buildkite-agent/builds/llvm-project/llvm/test/Analysis/CostModel/AArch64/free-widening-casts.ll -mtriple=aarch64--linux-gnu -passes='print<cost-model>' 2>&1 -disable-output | /var/lib/buildkite-agent/builds/llvm-project/build/bin/FileCheck /var/lib/buildkite-agent/builds/llvm-project/llvm/test/Analysis/CostModel/AArch64/free-widening-casts.ll --check-prefix=COST
1,160 msx64 debian > LLVM.Analysis/CostModel/AArch64::vector-select.ll
Script: -- : 'RUN: at line 1'; /var/lib/buildkite-agent/builds/llvm-project/build/bin/opt < /var/lib/buildkite-agent/builds/llvm-project/llvm/test/Analysis/CostModel/AArch64/vector-select.ll -mtriple=aarch64--linux-gnu -passes='print<cost-model>' 2>&1 -disable-output | /var/lib/buildkite-agent/builds/llvm-project/build/bin/FileCheck /var/lib/buildkite-agent/builds/llvm-project/llvm/test/Analysis/CostModel/AArch64/vector-select.ll --check-prefixes=COST,COST-NOFP16
310 msx64 debian > LLVM.CodeGen/AArch64::aarch64-insert-subvector-undef.ll
Script: -- : 'RUN: at line 1'; /var/lib/buildkite-agent/builds/llvm-project/build/bin/llc -mtriple=aarch64-none-linux-gnu -mattr=+neon < /var/lib/buildkite-agent/builds/llvm-project/llvm/test/CodeGen/AArch64/aarch64-insert-subvector-undef.ll
320 msx64 debian > LLVM.CodeGen/AArch64::aarch64-load-ext.ll
Script: -- : 'RUN: at line 2'; /var/lib/buildkite-agent/builds/llvm-project/build/bin/llc -mtriple=aarch64-unknown-linux-gnu < /var/lib/buildkite-agent/builds/llvm-project/llvm/test/CodeGen/AArch64/aarch64-load-ext.ll | /var/lib/buildkite-agent/builds/llvm-project/build/bin/FileCheck /var/lib/buildkite-agent/builds/llvm-project/llvm/test/CodeGen/AArch64/aarch64-load-ext.ll --check-prefix CHECK-LE
View Full Test Results (76 Failed)

Event Timeline

paulwalker-arm created this revision.May 23 2022, 6:56 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 23 2022, 6:56 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
paulwalker-arm requested review of this revision.May 23 2022, 6:56 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 23 2022, 6:56 AM
paulwalker-arm added inline comments.May 23 2022, 7:25 AM
llvm/include/llvm/Target/TargetSelectionDAG.td
698

Created new variant because SDTSubVecExtract does not support missed datatypes. Changing SDTSubVecExtract causes LLVM not to build because many isel patterns need updating. Not 100% sure this is the way to go, just depends on how many isel patterns need to be changed.

david-arm added inline comments.
llvm/include/llvm/Target/TargetSelectionDAG.td
698

I imagine you'll need a new ISD enum too, i.e. ISD::EXTRACT_SUBVECTOR2 because otherwise it may alias with def extract_subvector?

paulwalker-arm added inline comments.May 23 2022, 7:33 AM
llvm/include/llvm/Target/TargetSelectionDAG.td
698

To be honest I think updating SDTSubVecExtract is the way to go, but if I do continue with the current route it shouldn't matter because the two definitions will have mutually exclusive type requirements [1] so a 1-1 mapping will be maintained.

[1] extract_subvector requires A.isScalable() == B.isScalable(), whereas the new def will require A.isScalable() != B.isScalable()

Allen added a subscriber: Allen.May 24 2022, 3:41 AM
Matt added a subscriber: Matt.Jun 1 2022, 7:29 PM
Allen added inline comments.Tue, Jun 14, 1:45 AM
llvm/include/llvm/Target/TargetSelectionDAG.td
272

hi @paulwalker-arm:

I'm not familiar with the def, do you mean **SDTCisVec<0>** and **SDTCisInt<2>** have different type, so this is guard with **A.isScalable() != B.isScalable() **? thanks.
llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td
1425

hi, @paulwalker-arm:

do you still working on it, may be it need more pattern to match above commented pattten?
paulwalker-arm added inline comments.Mon, Jun 20, 8:32 AM
llvm/include/llvm/Target/TargetSelectionDAG.td
272

Yes, specially <2> is the index to extract from which is a scalar integer.

llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td
1425

I've not done anything since this initial version. Especially since concluding we can probably use vector_extract_subvec. I can pick this up if you want. I'm kind of interested anyway as a way to remove the original support code from AArch64ISelDAGToDAG.cpp.

Allen added inline comments.Tue, Jun 21, 12:13 AM
llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td
1425

That would be perfect. Thank you so much.