Skip to content

Commit 3894bdc

Browse files
committed
[AArch64][GlobalISel] Add regbank handling for scalar rda intrinsics.
1 parent e47e4d8 commit 3894bdc

File tree

2 files changed

+42
-32
lines changed

2 files changed

+42
-32
lines changed

llvm/lib/Target/AArch64/GISel/AArch64RegisterBankInfo.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,11 @@ static bool isFPIntrinsic(const MachineRegisterInfo &MRI,
476476
case Intrinsic::aarch64_neon_facgt:
477477
case Intrinsic::aarch64_neon_fabd:
478478
case Intrinsic::aarch64_sisd_fabd:
479+
case Intrinsic::aarch64_neon_sqrdmlah:
480+
case Intrinsic::aarch64_neon_sqrdmlsh:
481+
case Intrinsic::aarch64_neon_sqrdmulh:
482+
case Intrinsic::aarch64_neon_sqadd:
483+
case Intrinsic::aarch64_neon_sqsub:
479484
return true;
480485
case Intrinsic::aarch64_neon_saddlv: {
481486
const LLT SrcTy = MRI.getType(MI.getOperand(2).getReg());

llvm/test/CodeGen/AArch64/arm64-neon-v8.1a.ll

Lines changed: 37 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,7 @@
11
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
22
; RUN: llc < %s -verify-machineinstrs -mtriple=arm64-eabi -mattr=+rdm | FileCheck %s --check-prefixes=CHECK,CHECK-SD
33
; RUN: llc < %s -verify-machineinstrs -mtriple=arm64-eabi -mattr=+v8.1a | FileCheck %s --check-prefixes=CHECK,CHECK-SD
4-
; RUN: llc < %s -verify-machineinstrs -mtriple=arm64-eabi -mattr=+rdm -global-isel -global-isel-abort=2 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK-GI
5-
6-
; CHECK-GI: warning: Instruction selection used fallback path for test_sqrdmlah_extracted_lane_s32
7-
; CHECK-GI-NEXT: warning: Instruction selection used fallback path for test_sqrdmlahq_extracted_lane_s32
8-
; CHECK-GI-NEXT: warning: Instruction selection used fallback path for test_sqrdmlsh_extracted_lane_s32
9-
; CHECK-GI-NEXT: warning: Instruction selection used fallback path for test_sqrdmlshq_extracted_lane_s32
10-
; CHECK-GI-NEXT: warning: Instruction selection used fallback path for test_sqrdmlah_i32
11-
; CHECK-GI-NEXT: warning: Instruction selection used fallback path for test_sqrdmlsh_i32
12-
; CHECK-GI-NEXT: warning: Instruction selection used fallback path for test_sqrdmlah_extract_i32
13-
; CHECK-GI-NEXT: warning: Instruction selection used fallback path for test_sqrdmlsh_extract_i32
14-
; CHECK-GI-NEXT: warning: Instruction selection used fallback path for test_vqrdmlahs_s32
15-
; CHECK-GI-NEXT: warning: Instruction selection used fallback path for test_vqrdmlahs_lane_s32
16-
; CHECK-GI-NEXT: warning: Instruction selection used fallback path for test_vqrdmlahs_laneq_s32
17-
; CHECK-GI-NEXT: warning: Instruction selection used fallback path for test_vqrdmlshs_s32
18-
; CHECK-GI-NEXT: warning: Instruction selection used fallback path for test_vqrdmlshs_lane_s32
19-
; CHECK-GI-NEXT: warning: Instruction selection used fallback path for test_vqrdmlshs_laneq_s32
4+
; RUN: llc < %s -verify-machineinstrs -mtriple=arm64-eabi -mattr=+rdm -global-isel | FileCheck %s --check-prefixes=CHECK,CHECK-GI
205

216
declare <4 x i16> @llvm.aarch64.neon.sqrdmulh.v4i16(<4 x i16>, <4 x i16>)
227
declare <8 x i16> @llvm.aarch64.neon.sqrdmulh.v8i16(<8 x i16>, <8 x i16>)
@@ -719,14 +704,24 @@ entry:
719704
}
720705

721706
define i32 @test_vqrdmlahs_lane_s32(i32 %a, i32 %b, <2 x i32> %c) {
722-
; CHECK-LABEL: test_vqrdmlahs_lane_s32:
723-
; CHECK: // %bb.0: // %entry
724-
; CHECK-NEXT: fmov s1, w0
725-
; CHECK-NEXT: fmov s2, w1
726-
; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
727-
; CHECK-NEXT: sqrdmlah s1, s2, v0.s[1]
728-
; CHECK-NEXT: fmov w0, s1
729-
; CHECK-NEXT: ret
707+
; CHECK-SD-LABEL: test_vqrdmlahs_lane_s32:
708+
; CHECK-SD: // %bb.0: // %entry
709+
; CHECK-SD-NEXT: fmov s1, w0
710+
; CHECK-SD-NEXT: fmov s2, w1
711+
; CHECK-SD-NEXT: // kill: def $d0 killed $d0 def $q0
712+
; CHECK-SD-NEXT: sqrdmlah s1, s2, v0.s[1]
713+
; CHECK-SD-NEXT: fmov w0, s1
714+
; CHECK-SD-NEXT: ret
715+
;
716+
; CHECK-GI-LABEL: test_vqrdmlahs_lane_s32:
717+
; CHECK-GI: // %bb.0: // %entry
718+
; CHECK-GI-NEXT: // kill: def $d0 killed $d0 def $q0
719+
; CHECK-GI-NEXT: fmov s1, w0
720+
; CHECK-GI-NEXT: fmov s2, w1
721+
; CHECK-GI-NEXT: mov s0, v0.s[1]
722+
; CHECK-GI-NEXT: sqrdmlah s1, s2, s0
723+
; CHECK-GI-NEXT: fmov w0, s1
724+
; CHECK-GI-NEXT: ret
730725
entry:
731726
%vget_lane = extractelement <2 x i32> %c, i64 1
732727
%vqrdmlahs_s32.i = tail call i32 @llvm.aarch64.neon.sqrdmlah.i32(i32 %a, i32 %b, i32 %vget_lane) #4
@@ -889,14 +884,24 @@ entry:
889884
}
890885

891886
define i32 @test_vqrdmlshs_lane_s32(i32 %a, i32 %b, <2 x i32> %c) {
892-
; CHECK-LABEL: test_vqrdmlshs_lane_s32:
893-
; CHECK: // %bb.0: // %entry
894-
; CHECK-NEXT: fmov s1, w0
895-
; CHECK-NEXT: fmov s2, w1
896-
; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
897-
; CHECK-NEXT: sqrdmlsh s1, s2, v0.s[1]
898-
; CHECK-NEXT: fmov w0, s1
899-
; CHECK-NEXT: ret
887+
; CHECK-SD-LABEL: test_vqrdmlshs_lane_s32:
888+
; CHECK-SD: // %bb.0: // %entry
889+
; CHECK-SD-NEXT: fmov s1, w0
890+
; CHECK-SD-NEXT: fmov s2, w1
891+
; CHECK-SD-NEXT: // kill: def $d0 killed $d0 def $q0
892+
; CHECK-SD-NEXT: sqrdmlsh s1, s2, v0.s[1]
893+
; CHECK-SD-NEXT: fmov w0, s1
894+
; CHECK-SD-NEXT: ret
895+
;
896+
; CHECK-GI-LABEL: test_vqrdmlshs_lane_s32:
897+
; CHECK-GI: // %bb.0: // %entry
898+
; CHECK-GI-NEXT: // kill: def $d0 killed $d0 def $q0
899+
; CHECK-GI-NEXT: fmov s1, w0
900+
; CHECK-GI-NEXT: fmov s2, w1
901+
; CHECK-GI-NEXT: mov s0, v0.s[1]
902+
; CHECK-GI-NEXT: sqrdmlsh s1, s2, s0
903+
; CHECK-GI-NEXT: fmov w0, s1
904+
; CHECK-GI-NEXT: ret
900905
entry:
901906
%vget_lane = extractelement <2 x i32> %c, i64 1
902907
%vqrdmlshs_s32.i = tail call i32 @llvm.aarch64.neon.sqrdmlsh.i32(i32 %a, i32 %b, i32 %vget_lane) #4

0 commit comments

Comments
 (0)