[llvm] [AArch64] Update aarch64_neon_sqdmulls_scalar pattern (PR #185836)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 11 01:53:16 PDT 2026
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-backend-aarch64
Author: David Green (davemgreen)
<details>
<summary>Changes</summary>
This looks like it was missed in #<!-- -->161840, as there was no test coverage for it.
---
Full diff: https://github.com/llvm/llvm-project/pull/185836.diff
2 Files Affected:
- (modified) llvm/lib/Target/AArch64/AArch64InstrInfo.td (+3-3)
- (modified) llvm/test/CodeGen/AArch64/arm64-vmul.ll (+16-1)
``````````diff
diff --git a/llvm/lib/Target/AArch64/AArch64InstrInfo.td b/llvm/lib/Target/AArch64/AArch64InstrInfo.td
index 2900cf073b5aa..ded2e44bbd190 100644
--- a/llvm/lib/Target/AArch64/AArch64InstrInfo.td
+++ b/llvm/lib/Target/AArch64/AArch64InstrInfo.td
@@ -9041,9 +9041,9 @@ defm UMULL : SIMDVectorIndexedLongSD<1, 0b1010, "umull", AArch64umull>;
// A scalar sqdmull with the second operand being a vector lane can be
// handled directly with the indexed instruction encoding.
-def : Pat<(int_aarch64_neon_sqdmulls_scalar (i32 FPR32:$Rn),
- (vector_extract (v4i32 V128:$Vm),
- VectorIndexS:$idx)),
+def : Pat<(f64 (AArch64sqdmull FPR32:$Rn,
+ (f32 (bitconvert (i32 (vector_extract (v4i32 V128:$Vm),
+ VectorIndexS:$idx)))))),
(SQDMULLv1i64_indexed FPR32:$Rn, V128:$Vm, VectorIndexS:$idx)>;
//----------------------------------------------------------------------------
diff --git a/llvm/test/CodeGen/AArch64/arm64-vmul.ll b/llvm/test/CodeGen/AArch64/arm64-vmul.ll
index 4a3687d3a9fd4..7b639822a0dc0 100644
--- a/llvm/test/CodeGen/AArch64/arm64-vmul.ll
+++ b/llvm/test/CodeGen/AArch64/arm64-vmul.ll
@@ -2,7 +2,7 @@
; RUN: llc -mtriple=aarch64-none-elf -mattr=+aes < %s | FileCheck %s --check-prefixes=CHECK,CHECK-SD
; RUN: llc -mtriple=aarch64-none-elf -mattr=+aes -global-isel -global-isel-abort=2 2>&1 < %s | FileCheck %s --check-prefixes=CHECK,CHECK-GI
-; CHECK-GI: warning: Instruction selection used fallback path for sqdmulh_1s
+; CHECK-GI: warning: Instruction selection used fallback path for sqdmulh_1s
; CHECK-GI-NEXT: warning: Instruction selection used fallback path for fmls_2s
; CHECK-GI-NEXT: warning: Instruction selection used fallback path for fmls_4s
; CHECK-GI-NEXT: warning: Instruction selection used fallback path for fmls_2d
@@ -19,6 +19,7 @@
; CHECK-GI-NEXT: warning: Instruction selection used fallback path for fmla_indexed_scalar_4s_strict
; CHECK-GI-NEXT: warning: Instruction selection used fallback path for fmla_indexed_scalar_2d_strict
; CHECK-GI-NEXT: warning: Instruction selection used fallback path for sqdmulh_lane_1s
+; CHECK-GI-NEXT: warning: Instruction selection used fallback path for test_vqdmulls_lane_s32
; CHECK-GI-NEXT: warning: Instruction selection used fallback path for sqdmlal_lane_1d
; CHECK-GI-NEXT: warning: Instruction selection used fallback path for sqdmlsl_lane_1d
; CHECK-GI-NEXT: warning: Instruction selection used fallback path for scalar_fmls_from_extract_v4f32
@@ -1792,6 +1793,20 @@ define i32 @sqsub_lane1_sqdmull4s(i32 %A, <4 x i16> %B, <4 x i16> %C) nounwind {
ret i32 %res
}
+define i64 @test_vqdmulls_lane_s32(i32 noundef %a, <2 x i32> noundef %b) {
+; CHECK-LABEL: test_vqdmulls_lane_s32:
+; CHECK: // %bb.0: // %entry
+; CHECK-NEXT: fmov s1, w0
+; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
+; CHECK-NEXT: sqdmull d0, s1, v0.s[1]
+; CHECK-NEXT: fmov x0, d0
+; CHECK-NEXT: ret
+entry:
+ %vget_lane = extractelement <2 x i32> %b, i64 1
+ %vqdmulls_s32.i = tail call i64 @llvm.aarch64.neon.sqdmulls.scalar(i32 %a, i32 %vget_lane)
+ ret i64 %vqdmulls_s32.i
+}
+
define i64 @sqdmlal_lane_1d(i64 %A, i32 %B, <2 x i32> %C) nounwind {
; CHECK-LABEL: sqdmlal_lane_1d:
; CHECK: // %bb.0:
``````````
</details>
https://github.com/llvm/llvm-project/pull/185836
More information about the llvm-commits
mailing list