Page MenuHomePhabricator

[AArch64] Fold an sqadd of a sqdmull at lane 0 into an sqdmlal
Needs ReviewPublic

Authored by samtebbs on Aug 31 2021, 8:36 AM.



This patch folds a sqadd (i32, vector_extract (sqdmull v4i16, v4i16, 0)) into a sqdmlal. We already generate an sqdmlal for lanes greater than 0, so this patch emits an sqdmlal of the same format but for a lane of 0, and is necessary as the existing pattern doesn't match.

Diff Detail

Unit TestsFailed

2,880 msx64 debian > AddressSanitizer-x86_64-linux.TestCases::strcmp.c
Script: -- : 'RUN: at line 1'; /var/lib/buildkite-agent/builds/llvm-project/build/./bin/clang -fsanitize=address -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only -m64 /var/lib/buildkite-agent/builds/llvm-project/compiler-rt/test/asan/TestCases/strcmp.c -o /var/lib/buildkite-agent/builds/llvm-project/build/projects/compiler-rt/test/asan/X86_64LinuxConfig/TestCases/Output/strcmp.c.tmp
570 msx64 debian > LLVM.CodeGen/AArch64::arm64-neon-2velem.ll
Script: -- : 'RUN: at line 2'; /var/lib/buildkite-agent/builds/llvm-project/build/bin/llc < /var/lib/buildkite-agent/builds/llvm-project/llvm/test/CodeGen/AArch64/arm64-neon-2velem.ll -verify-machineinstrs -mtriple=arm64-none-linux-gnu -mattr=+neon -fp-contract=fast | /var/lib/buildkite-agent/builds/llvm-project/build/bin/FileCheck /var/lib/buildkite-agent/builds/llvm-project/llvm/test/CodeGen/AArch64/arm64-neon-2velem.ll --check-prefix=CHECK
920 msx64 windows > LLVM.CodeGen/AArch64::arm64-neon-2velem.ll
Script: -- : 'RUN: at line 2'; c:\ws\w6\llvm-project\premerge-checks\build\bin\llc.exe < C:\ws\w6\llvm-project\premerge-checks\llvm\test\CodeGen\AArch64\arm64-neon-2velem.ll -verify-machineinstrs -mtriple=arm64-none-linux-gnu -mattr=+neon -fp-contract=fast | c:\ws\w6\llvm-project\premerge-checks\build\bin\filecheck.exe C:\ws\w6\llvm-project\premerge-checks\llvm\test\CodeGen\AArch64\arm64-neon-2velem.ll --check-prefix=CHECK

Event Timeline

samtebbs created this revision.Aug 31 2021, 8:36 AM
samtebbs requested review of this revision.Aug 31 2021, 8:36 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 31 2021, 8:36 AM
dmgreen added inline comments.Sep 1 2021, 3:11 PM

There should probably be other types to this? Not just v4i16.
And it doesn't look like it should be in the SVE file.
From looking around, it appears most of the other patterns are in SIMDIndexedLongSQDMLXSDTied.

But if this is from a scalar intrinsic, should it be producing a scalar sqdmlal?