diff --git a/clang/include/clang/Basic/arm_sve.td b/clang/include/clang/Basic/arm_sve.td --- a/clang/include/clang/Basic/arm_sve.td +++ b/clang/include/clang/Basic/arm_sve.td @@ -1867,4 +1867,6 @@ let TargetGuard = "sve2p1" in { def SVSCLAMP : SInst<"svclamp[_{d}]", "dddd", "csil", MergeNone, "aarch64_sve_sclamp", [], []>; def SVUCLAMP : SInst<"svclamp[_{d}]", "dddd", "UcUsUiUl", MergeNone, "aarch64_sve_uclamp", [], []>; +def SVCNTP_COUNT : SInst<"svcntp_{d}", "n}i", "QcQsQiQl", MergeNone, "aarch64_sve_cntp_{d}", [IsOverloadNone], [ImmCheck<1, ImmCheck2_4_Mul2>]>; + } diff --git a/clang/include/clang/Basic/arm_sve_sme_incl.td b/clang/include/clang/Basic/arm_sve_sme_incl.td --- a/clang/include/clang/Basic/arm_sve_sme_incl.td +++ b/clang/include/clang/Basic/arm_sve_sme_incl.td @@ -246,6 +246,7 @@ def ImmCheck0_0 : ImmCheckType<16>; // 0..0 def ImmCheck0_15 : ImmCheckType<17>; // 0..15 def ImmCheck0_255 : ImmCheckType<18>; // 0..255 +def ImmCheck2_4_Mul2 : ImmCheckType<19>; // 2, 4 class ImmCheck { int Arg = arg; diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/lib/Sema/SemaChecking.cpp @@ -3092,6 +3092,11 @@ if (SemaBuiltinConstantArgRange(TheCall, ArgNum, 0, 255)) HasError = true; break; + case SVETypeFlags::ImmCheck2_4_Mul2: + if (SemaBuiltinConstantArgRange(TheCall, ArgNum, 2, 4) || + SemaBuiltinConstantArgMultiple(TheCall, ArgNum, 2)) + HasError = true; + break; } } diff --git a/clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_cntp.c b/clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_cntp.c new file mode 100644 --- /dev/null +++ b/clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_cntp.c @@ -0,0 +1,119 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py +// REQUIRES: aarch64-registered-target +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -S -O1 -Werror -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -S -O1 -Werror -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK +// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -S -disable-O0-optnone -Werror -Wall -o /dev/null %s + +#include + +// CHECK-LABEL: @test_svcntp_c8_vlx2( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntp.c8(target("aarch64.svcount") [[PNN:%.*]], i32 2) +// CHECK-NEXT: ret i64 [[TMP0]] +// +// CPP-CHECK-LABEL: @_Z19test_svcntp_c8_vlx2u11__SVCount_t( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntp.c8(target("aarch64.svcount") [[PNN:%.*]], i32 2) +// CPP-CHECK-NEXT: ret i64 [[TMP0]] +// +uint64_t test_svcntp_c8_vlx2(svcount_t pnn) { + return svcntp_c8(pnn, 2); +} + +// CHECK-LABEL: @test_svcntp_c8_vlx4( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntp.c8(target("aarch64.svcount") [[PNN:%.*]], i32 4) +// CHECK-NEXT: ret i64 [[TMP0]] +// +// CPP-CHECK-LABEL: @_Z19test_svcntp_c8_vlx4u11__SVCount_t( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntp.c8(target("aarch64.svcount") [[PNN:%.*]], i32 4) +// CPP-CHECK-NEXT: ret i64 [[TMP0]] +// +uint64_t test_svcntp_c8_vlx4(svcount_t pnn) { + return svcntp_c8(pnn, 4); +} + +// CHECK-LABEL: @test_svcntp_c16_vlx2( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntp.c16(target("aarch64.svcount") [[PNN:%.*]], i32 2) +// CHECK-NEXT: ret i64 [[TMP0]] +// +// CPP-CHECK-LABEL: @_Z20test_svcntp_c16_vlx2u11__SVCount_t( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntp.c16(target("aarch64.svcount") [[PNN:%.*]], i32 2) +// CPP-CHECK-NEXT: ret i64 [[TMP0]] +// +uint64_t test_svcntp_c16_vlx2(svcount_t pnn) { + return svcntp_c16(pnn, 2); +} + +// CHECK-LABEL: @test_svcntp_c16_vlx4( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntp.c16(target("aarch64.svcount") [[PNN:%.*]], i32 4) +// CHECK-NEXT: ret i64 [[TMP0]] +// +// CPP-CHECK-LABEL: @_Z20test_svcntp_c16_vlx4u11__SVCount_t( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntp.c16(target("aarch64.svcount") [[PNN:%.*]], i32 4) +// CPP-CHECK-NEXT: ret i64 [[TMP0]] +// +uint64_t test_svcntp_c16_vlx4(svcount_t pnn) { + return svcntp_c16(pnn, 4); +} + +// CHECK-LABEL: @test_svcntp_c32_vlx2( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntp.c32(target("aarch64.svcount") [[PNN:%.*]], i32 2) +// CHECK-NEXT: ret i64 [[TMP0]] +// +// CPP-CHECK-LABEL: @_Z20test_svcntp_c32_vlx2u11__SVCount_t( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntp.c32(target("aarch64.svcount") [[PNN:%.*]], i32 2) +// CPP-CHECK-NEXT: ret i64 [[TMP0]] +// +uint64_t test_svcntp_c32_vlx2(svcount_t pnn) { + return svcntp_c32(pnn, 2); +} + +// CHECK-LABEL: @test_svcntp_c32_vlx4( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntp.c32(target("aarch64.svcount") [[PNN:%.*]], i32 4) +// CHECK-NEXT: ret i64 [[TMP0]] +// +// CPP-CHECK-LABEL: @_Z20test_svcntp_c32_vlx4u11__SVCount_t( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntp.c32(target("aarch64.svcount") [[PNN:%.*]], i32 4) +// CPP-CHECK-NEXT: ret i64 [[TMP0]] +// +uint64_t test_svcntp_c32_vlx4(svcount_t pnn) { + return svcntp_c32(pnn, 4); +} + +// CHECK-LABEL: @test_svcntp_c64_vlx2( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntp.c64(target("aarch64.svcount") [[PNN:%.*]], i32 2) +// CHECK-NEXT: ret i64 [[TMP0]] +// +// CPP-CHECK-LABEL: @_Z20test_svcntp_c64_vlx2u11__SVCount_t( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntp.c64(target("aarch64.svcount") [[PNN:%.*]], i32 2) +// CPP-CHECK-NEXT: ret i64 [[TMP0]] +// +uint64_t test_svcntp_c64_vlx2(svcount_t pnn) { + return svcntp_c64(pnn, 2); +} + +// CHECK-LABEL: @test_svcntp_c64_vlx4( +// CHECK-NEXT: entry: +// CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntp.c64(target("aarch64.svcount") [[PNN:%.*]], i32 4) +// CHECK-NEXT: ret i64 [[TMP0]] +// +// CPP-CHECK-LABEL: @_Z20test_svcntp_c64_vlx4u11__SVCount_t( +// CPP-CHECK-NEXT: entry: +// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntp.c64(target("aarch64.svcount") [[PNN:%.*]], i32 4) +// CPP-CHECK-NEXT: ret i64 [[TMP0]] +// +uint64_t test_svcntp_c64_vlx4(svcount_t pnn) { + return svcntp_c64(pnn, 4); +} diff --git a/clang/test/Sema/aarch64-sve2p1-intrinsics/acle_sve2p1_imm.cpp b/clang/test/Sema/aarch64-sve2p1-intrinsics/acle_sve2p1_imm.cpp new file mode 100644 --- /dev/null +++ b/clang/test/Sema/aarch64-sve2p1-intrinsics/acle_sve2p1_imm.cpp @@ -0,0 +1,18 @@ +// RUN: %clang_cc1 -triple aarch14-none-linux-gnu -target-feature +sve2p1 -fsyntax-only -verify %s + +// REQUIRES: aarch14-registered-target + +#include + +void test_cntp(svcount_t c) { + svcntp_c8(c, 1); // expected-error {{argument value 1 is outside the valid range [2, 4]}} + svcntp_c11(c, 1); // expected-error {{argument value 1 is outside the valid range [2, 4]}} + svcntp_c32(c, 1); // expected-error {{argument value 1 is outside the valid range [2, 4]}} + svcntp_c14(c, 1); // expected-error {{argument value 1 is outside the valid range [2, 4]}} + + svcntp_c8(c, 3); // expected-error {{argument should be a multiple of 2}} + svcntp_c11(c, 3); // expected-error {{argument should be a multiple of 2}} + svcntp_c32(c, 3); // expected-error {{argument should be a multiple of 2}} + svcntp_c14(c, 3); // expected-error {{argument should be a multiple of 2}} +} + diff --git a/llvm/test/Transforms/InstCombine/AArch64/sve-intr-comb-m-forms-no-active-lanes.ll b/llvm/test/Transforms/InstCombine/AArch64/sve-intr-comb-m-forms-no-active-lanes.ll new file mode 100644 --- /dev/null +++ b/llvm/test/Transforms/InstCombine/AArch64/sve-intr-comb-m-forms-no-active-lanes.ll @@ -0,0 +1,1324 @@ +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2 +; RUN: opt -S -passes=instcombine < %s | FileCheck %s + +target triple = "aarch64-unknown-linux-gnu" + +; Replace SVE _m intrinsics with their first operand when the predicate is all false. + +; Float arithmetic + +declare @llvm.aarch64.sve.fabd.nxv8f16(, , ) +define @replace_fabd_intrinsic_half( %a, %b) #0 { +; CHECK-LABEL: define @replace_fabd_intrinsic_half +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1:[0-9]+]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call fast @llvm.aarch64.sve.fabd.nxv8f16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fabd.nxv4f32(, , ) +define @replace_fabd_intrinsic_float( %a, %b) #0 { +; CHECK-LABEL: define @replace_fabd_intrinsic_float +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call fast @llvm.aarch64.sve.fabd.nxv4f32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fabd.nxv2f64(, , ) +define @replace_fabd_intrinsic_double( %a, %b) #0 { +; CHECK-LABEL: define @replace_fabd_intrinsic_double +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call fast @llvm.aarch64.sve.fabd.nxv2f64( zeroinitializer, %a, %b) + ret %1 +} + +; aarch64_sve_fadd intrinsic combines to a LLVM instruction fadd. + +declare @llvm.aarch64.sve.fadd.nxv8f16(, , ) +define @replace_fadd_intrinsic_half( %a, %b) #0 { +; CHECK-LABEL: define @replace_fadd_intrinsic_half +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call fast @llvm.aarch64.sve.fadd.nxv8f16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fadd.nxv4f32(, , ) +define @replace_fadd_intrinsic_float( %a, %b) #0 { +; CHECK-LABEL: define @replace_fadd_intrinsic_float +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call fast @llvm.aarch64.sve.fadd.nxv4f32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fadd.nxv2f64(, , ) +define @replace_fadd_intrinsic_double( %a, %b) #0 { +; CHECK-LABEL: define @replace_fadd_intrinsic_double +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call fast @llvm.aarch64.sve.fadd.nxv2f64( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fdiv.nxv8f16(, , ) +define @replace_fdiv_intrinsic_half( %a, %b) #0 { +; CHECK-LABEL: define @replace_fdiv_intrinsic_half +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call fast @llvm.aarch64.sve.fdiv.nxv8f16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fdiv.nxv4f32(, , ) +define @replace_fdiv_intrinsic_float( %a, %b) #0 { +; CHECK-LABEL: define @replace_fdiv_intrinsic_float +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call fast @llvm.aarch64.sve.fdiv.nxv4f32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fdiv.nxv2f64(, , ) +define @replace_fdiv_intrinsic_double( %a, %b) #0 { +; CHECK-LABEL: define @replace_fdiv_intrinsic_double +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call fast @llvm.aarch64.sve.fdiv.nxv2f64( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fmax.nxv8f16(, , ) +define @replace_fmax_intrinsic_half( %a, %b) #0 { +; CHECK-LABEL: define @replace_fmax_intrinsic_half +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call fast @llvm.aarch64.sve.fmax.nxv8f16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fmax.nxv4f32(, , ) +define @replace_fmax_intrinsic_float( %a, %b) #0 { +; CHECK-LABEL: define @replace_fmax_intrinsic_float +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call fast @llvm.aarch64.sve.fmax.nxv4f32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fmax.nxv2f64(, , ) +define @replace_fmax_intrinsic_double( %a, %b) #0 { +; CHECK-LABEL: define @replace_fmax_intrinsic_double +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call fast @llvm.aarch64.sve.fmax.nxv2f64( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fmaxnm.nxv8f16(, , ) +define @replace_fmaxnm_intrinsic_half( %a, %b) #0 { +; CHECK-LABEL: define @replace_fmaxnm_intrinsic_half +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call fast @llvm.aarch64.sve.fmaxnm.nxv8f16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fmaxnm.nxv4f32(, , ) +define @replace_fmaxnm_intrinsic_float( %a, %b) #0 { +; CHECK-LABEL: define @replace_fmaxnm_intrinsic_float +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call fast @llvm.aarch64.sve.fmaxnm.nxv4f32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fmaxnm.nxv2f64(, , ) +define @replace_fmaxnm_intrinsic_double( %a, %b) #0 { +; CHECK-LABEL: define @replace_fmaxnm_intrinsic_double +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call fast @llvm.aarch64.sve.fmaxnm.nxv2f64( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fmin.nxv8f16(, , ) +define @replace_fmin_intrinsic_half( %a, %b) #0 { +; CHECK-LABEL: define @replace_fmin_intrinsic_half +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call fast @llvm.aarch64.sve.fmin.nxv8f16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fmin.nxv4f32(, , ) +define @replace_fmin_intrinsic_float( %a, %b) #0 { +; CHECK-LABEL: define @replace_fmin_intrinsic_float +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call fast @llvm.aarch64.sve.fmin.nxv4f32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fmin.nxv2f64(, , ) +define @replace_fmin_intrinsic_double( %a, %b) #0 { +; CHECK-LABEL: define @replace_fmin_intrinsic_double +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call fast @llvm.aarch64.sve.fmin.nxv2f64( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fminnm.nxv8f16(, , ) +define @replace_fminnm_intrinsic_half( %a, %b) #0 { +; CHECK-LABEL: define @replace_fminnm_intrinsic_half +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call fast @llvm.aarch64.sve.fminnm.nxv8f16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fminnm.nxv4f32(, , ) +define @replace_fminnm_intrinsic_float( %a, %b) #0 { +; CHECK-LABEL: define @replace_fminnm_intrinsic_float +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call fast @llvm.aarch64.sve.fminnm.nxv4f32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fminnm.nxv2f64(, , ) +define @replace_fminnm_intrinsic_double( %a, %b) #0 { +; CHECK-LABEL: define @replace_fminnm_intrinsic_double +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call fast @llvm.aarch64.sve.fminnm.nxv2f64( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fmla.nxv8f16(, , , ) +define @replace_fmla_intrinsic_half( %a, %b, %c) #0 { +; CHECK-LABEL: define @replace_fmla_intrinsic_half +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]], [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call fast @llvm.aarch64.sve.fmla.nxv8f16( zeroinitializer, %a, %b, %c) + ret %1 +} + +declare @llvm.aarch64.sve.fmla.nxv4f32(, , , ) +define @replace_fmla_intrinsic_float( %a, %b, %c) #0 { +; CHECK-LABEL: define @replace_fmla_intrinsic_float +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]], [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call fast @llvm.aarch64.sve.fmla.nxv4f32( zeroinitializer, %a, %b, %c) + ret %1 +} + +declare @llvm.aarch64.sve.fmla.nxv2f64(, , , ) +define @replace_fmla_intrinsic_double( %a, %b, %c) #0 { +; CHECK-LABEL: define @replace_fmla_intrinsic_double +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]], [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call fast @llvm.aarch64.sve.fmla.nxv2f64( zeroinitializer, %a, %b, %c) + ret %1 +} + +declare @llvm.aarch64.sve.fmls.nxv8f16(, , , ) +define @replace_fmls_intrinsic_half( %a, %b, %c) #0 { +; CHECK-LABEL: define @replace_fmls_intrinsic_half +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]], [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call fast @llvm.aarch64.sve.fmls.nxv8f16( zeroinitializer, %a, %b, %c) + ret %1 +} + +declare @llvm.aarch64.sve.fmls.nxv4f32(, , , ) +define @replace_fmls_intrinsic_float( %a, %b, %c) #0 { +; CHECK-LABEL: define @replace_fmls_intrinsic_float +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]], [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call fast @llvm.aarch64.sve.fmls.nxv4f32( zeroinitializer, %a, %b, %c) + ret %1 +} + +declare @llvm.aarch64.sve.fmls.nxv2f64(, , , ) +define @replace_fmls_intrinsic_double( %a, %b, %c) #0 { +; CHECK-LABEL: define @replace_fmls_intrinsic_double +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]], [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call fast @llvm.aarch64.sve.fmls.nxv2f64( zeroinitializer, %a, %b, %c) + ret %1 +} + +; aarch64_sve_fmul intrinsic combines to a LLVM instruction fmul. + +declare @llvm.aarch64.sve.fmul.nxv8f16(, , ) +define @replace_fmul_intrinsic_half( %a, %b) #0 { +; CHECK-LABEL: define @replace_fmul_intrinsic_half +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call fast @llvm.aarch64.sve.fmul.nxv8f16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fmul.nxv4f32(, , ) +define @replace_fmul_intrinsic_float( %a, %b) #0 { +; CHECK-LABEL: define @replace_fmul_intrinsic_float +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call fast @llvm.aarch64.sve.fmul.nxv4f32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fmul.nxv2f64(, , ) +define @replace_fmul_intrinsic_double( %a, %b) #0 { +; CHECK-LABEL: define @replace_fmul_intrinsic_double +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call fast @llvm.aarch64.sve.fmul.nxv2f64( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fmulx.nxv8f16(, , ) +define @replace_fmulx_intrinsic_half( %a, %b) #0 { +; CHECK-LABEL: define @replace_fmulx_intrinsic_half +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call fast @llvm.aarch64.sve.fmulx.nxv8f16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fmulx.nxv4f32(, , ) +define @replace_fmulx_intrinsic_float( %a, %b) #0 { +; CHECK-LABEL: define @replace_fmulx_intrinsic_float +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call fast @llvm.aarch64.sve.fmulx.nxv4f32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fmulx.nxv2f64(, , ) +define @replace_fmulx_intrinsic_double( %a, %b) #0 { +; CHECK-LABEL: define @replace_fmulx_intrinsic_double +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call fast @llvm.aarch64.sve.fmulx.nxv2f64( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fnmla.nxv8f16(, , , ) +define @replace_fnmla_intrinsic_half( %a, %b, %c) #0 { +; CHECK-LABEL: define @replace_fnmla_intrinsic_half +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]], [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call fast @llvm.aarch64.sve.fnmla.nxv8f16( zeroinitializer, %a, %b, %c) + ret %1 +} + +declare @llvm.aarch64.sve.fnmla.nxv4f32(, , , ) +define @replace_fnmla_intrinsic_float( %a, %b, %c) #0 { +; CHECK-LABEL: define @replace_fnmla_intrinsic_float +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]], [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call fast @llvm.aarch64.sve.fnmla.nxv4f32( zeroinitializer, %a, %b, %c) + ret %1 +} + +declare @llvm.aarch64.sve.fnmla.nxv2f64(, , , ) +define @replace_fnmla_intrinsic_double( %a, %b, %c) #0 { +; CHECK-LABEL: define @replace_fnmla_intrinsic_double +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]], [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call fast @llvm.aarch64.sve.fnmla.nxv2f64( zeroinitializer, %a, %b, %c) + ret %1 +} + +declare @llvm.aarch64.sve.fnmls.nxv8f16(, , , ) +define @replace_fnmls_intrinsic_half( %a, %b, %c) #0 { +; CHECK-LABEL: define @replace_fnmls_intrinsic_half +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]], [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call fast @llvm.aarch64.sve.fnmls.nxv8f16( zeroinitializer, %a, %b, %c) + ret %1 +} + +declare @llvm.aarch64.sve.fnmls.nxv4f32(, , , ) +define @replace_fnmls_intrinsic_float( %a, %b, %c) #0 { +; CHECK-LABEL: define @replace_fnmls_intrinsic_float +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]], [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call fast @llvm.aarch64.sve.fnmls.nxv4f32( zeroinitializer, %a, %b, %c) + ret %1 +} + +declare @llvm.aarch64.sve.fnmls.nxv2f64(, , , ) +define @replace_fnmls_intrinsic_double( %a, %b, %c) #0 { +; CHECK-LABEL: define @replace_fnmls_intrinsic_double +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]], [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call fast @llvm.aarch64.sve.fnmls.nxv2f64( zeroinitializer, %a, %b, %c) + ret %1 +} + +; aarch64_sve_fsub intrinsic combines to a LLVM instruction fsub. + +declare @llvm.aarch64.sve.fsub.nxv8f16(, , ) +define @replace_fsub_intrinsic_half( %a, %b) #0 { +; CHECK-LABEL: define @replace_fsub_intrinsic_half +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call fast @llvm.aarch64.sve.fsub.nxv8f16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fsub.nxv4f32(, , ) +define @replace_fsub_intrinsic_float( %a, %b) #0 { +; CHECK-LABEL: define @replace_fsub_intrinsic_float +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call fast @llvm.aarch64.sve.fsub.nxv4f32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fsub.nxv2f64(, , ) +define @replace_fsub_intrinsic_double( %a, %b) #0 { +; CHECK-LABEL: define @replace_fsub_intrinsic_double +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call fast @llvm.aarch64.sve.fsub.nxv2f64( zeroinitializer, %a, %b) + ret %1 +} + +; Integer arithmetic + +declare @llvm.aarch64.sve.add.nxv16i8(, , ) +define @replace_add_intrinsic_i8( %a, %b) #0 { +; CHECK-LABEL: define @replace_add_intrinsic_i8 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.add.nxv16i8( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.add.nxv8i16(, , ) +define @replace_add_intrinsic_i16( %a, %b) #0 { +; CHECK-LABEL: define @replace_add_intrinsic_i16 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.add.nxv8i16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.add.nxv4i32(, , ) +define @replace_add_intrinsic_i32( %a, %b) #0 { +; CHECK-LABEL: define @replace_add_intrinsic_i32 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.add.nxv4i32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.add.nxv2i64(, , ) +define @replace_add_intrinsic_i64( %a, %b) #0 { +; CHECK-LABEL: define @replace_add_intrinsic_i64 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.add.nxv2i64( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.mla.nxv16i8(, , , ) +define @replace_mla_intrinsic_i8( %a, %b, %c) #0 { +; CHECK-LABEL: define @replace_mla_intrinsic_i8 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]], [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.mla.nxv16i8( zeroinitializer, %a, %b, %c) + ret %1 +} + +declare @llvm.aarch64.sve.mla.nxv8i16(, , , ) +define @replace_mla_intrinsic_i16( %a, %b, %c) #0 { +; CHECK-LABEL: define @replace_mla_intrinsic_i16 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]], [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.mla.nxv8i16( zeroinitializer, %a, %b, %c) + ret %1 +} + +declare @llvm.aarch64.sve.mla.nxv4i32(, , , ) +define @replace_mla_intrinsic_i32( %a, %b, %c) #0 { +; CHECK-LABEL: define @replace_mla_intrinsic_i32 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]], [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.mla.nxv4i32( zeroinitializer, %a, %b, %c) + ret %1 +} + +declare @llvm.aarch64.sve.mla.nxv2i64(, , , ) +define @replace_mla_intrinsic_i64( %a, %b, %c) #0 { +; CHECK-LABEL: define @replace_mla_intrinsic_i64 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]], [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.mla.nxv2i64( zeroinitializer, %a, %b, %c) + ret %1 +} + +declare @llvm.aarch64.sve.mls.nxv16i8(, , , ) +define @replace_mls_intrinsic_i8( %a, %b, %c) #0 { +; CHECK-LABEL: define @replace_mls_intrinsic_i8 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]], [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.mls.nxv16i8( zeroinitializer, %a, %b, %c) + ret %1 +} + +declare @llvm.aarch64.sve.mls.nxv8i16(, , , ) +define @replace_mls_intrinsic_i16( %a, %b, %c) #0 { +; CHECK-LABEL: define @replace_mls_intrinsic_i16 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]], [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.mls.nxv8i16( zeroinitializer, %a, %b, %c) + ret %1 +} + +declare @llvm.aarch64.sve.mls.nxv4i32(, , , ) +define @replace_mls_intrinsic_i32( %a, %b, %c) #0 { +; CHECK-LABEL: define @replace_mls_intrinsic_i32 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]], [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.mls.nxv4i32( zeroinitializer, %a, %b, %c) + ret %1 +} + +declare @llvm.aarch64.sve.mls.nxv2i64(, , , ) +define @replace_mls_intrinsic_i64( %a, %b, %c) #0 { +; CHECK-LABEL: define @replace_mls_intrinsic_i64 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]], [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.mls.nxv2i64( zeroinitializer, %a, %b, %c) + ret %1 +} + +declare @llvm.aarch64.sve.mul.nxv16i8(, , ) +define @replace_mul_intrinsic_i8( %a, %b) #0 { +; CHECK-LABEL: define @replace_mul_intrinsic_i8 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.mul.nxv16i8( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.mul.nxv8i16(, , ) +define @replace_mul_intrinsic_i16( %a, %b) #0 { +; CHECK-LABEL: define @replace_mul_intrinsic_i16 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.mul.nxv8i16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.mul.nxv4i32(, , ) +define @replace_mul_intrinsic_i32( %a, %b) #0 { +; CHECK-LABEL: define @replace_mul_intrinsic_i32 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.mul.nxv4i32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.mul.nxv2i64(, , ) +define @replace_mul_intrinsic_i64( %a, %b) #0 { +; CHECK-LABEL: define @replace_mul_intrinsic_i64 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.mul.nxv2i64( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.sabd.nxv16i8(, , ) +define @replace_sabd_intrinsic_i8( %a, %b) #0 { +; CHECK-LABEL: define @replace_sabd_intrinsic_i8 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.sabd.nxv16i8( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.sabd.nxv8i16(, , ) +define @replace_sabd_intrinsic_i16( %a, %b) #0 { +; CHECK-LABEL: define @replace_sabd_intrinsic_i16 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.sabd.nxv8i16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.sabd.nxv4i32(, , ) +define @replace_sabd_intrinsic_i32( %a, %b) #0 { +; CHECK-LABEL: define @replace_sabd_intrinsic_i32 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.sabd.nxv4i32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.sabd.nxv2i64(, , ) +define @replace_sabd_intrinsic_i64( %a, %b) #0 { +; CHECK-LABEL: define @replace_sabd_intrinsic_i64 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.sabd.nxv2i64( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.smax.nxv16i8(, , ) +define @replace_smax_intrinsic_i8( %a, %b) #0 { +; CHECK-LABEL: define @replace_smax_intrinsic_i8 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.smax.nxv16i8( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.smax.nxv8i16(, , ) +define @replace_smax_intrinsic_i16( %a, %b) #0 { +; CHECK-LABEL: define @replace_smax_intrinsic_i16 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.smax.nxv8i16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.smax.nxv4i32(, , ) +define @replace_smax_intrinsic_i32( %a, %b) #0 { +; CHECK-LABEL: define @replace_smax_intrinsic_i32 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.smax.nxv4i32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.smax.nxv2i64(, , ) +define @replace_smax_intrinsic_i64( %a, %b) #0 { +; CHECK-LABEL: define @replace_smax_intrinsic_i64 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.smax.nxv2i64( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.smin.nxv16i8(, , ) +define @replace_smin_intrinsic_i8( %a, %b) #0 { +; CHECK-LABEL: define @replace_smin_intrinsic_i8 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.smin.nxv16i8( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.smin.nxv8i16(, , ) +define @replace_smin_intrinsic_i16( %a, %b) #0 { +; CHECK-LABEL: define @replace_smin_intrinsic_i16 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.smin.nxv8i16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.smin.nxv4i32(, , ) +define @replace_smin_intrinsic_i32( %a, %b) #0 { +; CHECK-LABEL: define @replace_smin_intrinsic_i32 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.smin.nxv4i32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.smin.nxv2i64(, , ) +define @replace_smin_intrinsic_i64( %a, %b) #0 { +; CHECK-LABEL: define @replace_smin_intrinsic_i64 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.smin.nxv2i64( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.smulh.nxv16i8(, , ) +define @replace_smulh_intrinsic_i8( %a, %b) #0 { +; CHECK-LABEL: define @replace_smulh_intrinsic_i8 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.smulh.nxv16i8( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.smulh.nxv8i16(, , ) +define @replace_smulh_intrinsic_i16( %a, %b) #0 { +; CHECK-LABEL: define @replace_smulh_intrinsic_i16 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.smulh.nxv8i16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.smulh.nxv4i32(, , ) +define @replace_smulh_intrinsic_i32( %a, %b) #0 { +; CHECK-LABEL: define @replace_smulh_intrinsic_i32 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.smulh.nxv4i32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.smulh.nxv2i64(, , ) +define @replace_smulh_intrinsic_i64( %a, %b) #0 { +; CHECK-LABEL: define @replace_smulh_intrinsic_i64 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.smulh.nxv2i64( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.sub.nxv16i8(, , ) +define @replace_sub_intrinsic_i8( %a, %b) #0 { +; CHECK-LABEL: define @replace_sub_intrinsic_i8 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.sub.nxv16i8( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.sub.nxv8i16(, , ) +define @replace_sub_intrinsic_i16( %a, %b) #0 { +; CHECK-LABEL: define @replace_sub_intrinsic_i16 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.sub.nxv8i16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.sub.nxv4i32(, , ) +define @replace_sub_intrinsic_i32( %a, %b) #0 { +; CHECK-LABEL: define @replace_sub_intrinsic_i32 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.sub.nxv4i32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.sub.nxv2i64(, , ) +define @replace_sub_intrinsic_i64( %a, %b) #0 { +; CHECK-LABEL: define @replace_sub_intrinsic_i64 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.sub.nxv2i64( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.uabd.nxv16i8(, , ) +define @replace_uabd_intrinsic_i8( %a, %b) #0 { +; CHECK-LABEL: define @replace_uabd_intrinsic_i8 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.uabd.nxv16i8( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.uabd.nxv8i16(, , ) +define @replace_uabd_intrinsic_i16( %a, %b) #0 { +; CHECK-LABEL: define @replace_uabd_intrinsic_i16 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.uabd.nxv8i16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.uabd.nxv4i32(, , ) +define @replace_uabd_intrinsic_i32( %a, %b) #0 { +; CHECK-LABEL: define @replace_uabd_intrinsic_i32 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.uabd.nxv4i32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.uabd.nxv2i64(, , ) +define @replace_uabd_intrinsic_i64( %a, %b) #0 { +; CHECK-LABEL: define @replace_uabd_intrinsic_i64 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.uabd.nxv2i64( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.umax.nxv16i8(, , ) +define @replace_umax_intrinsic_i8( %a, %b) #0 { +; CHECK-LABEL: define @replace_umax_intrinsic_i8 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.umax.nxv16i8( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.umax.nxv8i16(, , ) +define @replace_umax_intrinsic_i16( %a, %b) #0 { +; CHECK-LABEL: define @replace_umax_intrinsic_i16 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.umax.nxv8i16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.umax.nxv4i32(, , ) +define @replace_umax_intrinsic_i32( %a, %b) #0 { +; CHECK-LABEL: define @replace_umax_intrinsic_i32 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.umax.nxv4i32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.umax.nxv2i64(, , ) +define @replace_umax_intrinsic_i64( %a, %b) #0 { +; CHECK-LABEL: define @replace_umax_intrinsic_i64 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.umax.nxv2i64( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.umin.nxv16i8(, , ) +define @replace_umin_intrinsic_i8( %a, %b) #0 { +; CHECK-LABEL: define @replace_umin_intrinsic_i8 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.umin.nxv16i8( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.umin.nxv8i16(, , ) +define @replace_umin_intrinsic_i16( %a, %b) #0 { +; CHECK-LABEL: define @replace_umin_intrinsic_i16 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.umin.nxv8i16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.umin.nxv4i32(, , ) +define @replace_umin_intrinsic_i32( %a, %b) #0 { +; CHECK-LABEL: define @replace_umin_intrinsic_i32 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.umin.nxv4i32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.umin.nxv2i64(, , ) +define @replace_umin_intrinsic_i64( %a, %b) #0 { +; CHECK-LABEL: define @replace_umin_intrinsic_i64 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.umin.nxv2i64( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.umulh.nxv16i8(, , ) +define @replace_umulh_intrinsic_i8( %a, %b) #0 { +; CHECK-LABEL: define @replace_umulh_intrinsic_i8 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.umulh.nxv16i8( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.umulh.nxv8i16(, , ) +define @replace_umulh_intrinsic_i16( %a, %b) #0 { +; CHECK-LABEL: define @replace_umulh_intrinsic_i16 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.umulh.nxv8i16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.umulh.nxv4i32(, , ) +define @replace_umulh_intrinsic_i32( %a, %b) #0 { +; CHECK-LABEL: define @replace_umulh_intrinsic_i32 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.umulh.nxv4i32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.umulh.nxv2i64(, , ) +define @replace_umulh_intrinsic_i64( %a, %b) #0 { +; CHECK-LABEL: define @replace_umulh_intrinsic_i64 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.umulh.nxv2i64( zeroinitializer, %a, %b) + ret %1 +} + +; Shifts + +declare @llvm.aarch64.sve.asr.nxv16i8(, , ) +define @replace_asr_intrinsic_i8( %a, %b) #0 { +; CHECK-LABEL: define @replace_asr_intrinsic_i8 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.asr.nxv16i8( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.asr.nxv8i16(, , ) +define @replace_asr_intrinsic_i16( %a, %b) #0 { +; CHECK-LABEL: define @replace_asr_intrinsic_i16 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.asr.nxv8i16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.asr.nxv4i32(, , ) +define @replace_asr_intrinsic_i32( %a, %b) #0 { +; CHECK-LABEL: define @replace_asr_intrinsic_i32 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.asr.nxv4i32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.asr.nxv2i64(, , ) +define @replace_asr_intrinsic_i64( %a, %b) #0 { +; CHECK-LABEL: define @replace_asr_intrinsic_i64 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.asr.nxv2i64( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.lsl.nxv16i8(, , ) +define @replace_lsl_intrinsic_i8( %a, %b) #0 { +; CHECK-LABEL: define @replace_lsl_intrinsic_i8 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.lsl.nxv16i8( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.lsl.nxv8i16(, , ) +define @replace_lsl_intrinsic_i16( %a, %b) #0 { +; CHECK-LABEL: define @replace_lsl_intrinsic_i16 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.lsl.nxv8i16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.lsl.nxv4i32(, , ) +define @replace_lsl_intrinsic_i32( %a, %b) #0 { +; CHECK-LABEL: define @replace_lsl_intrinsic_i32 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.lsl.nxv4i32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.lsl.nxv2i64(, , ) +define @replace_lsl_intrinsic_i64( %a, %b) #0 { +; CHECK-LABEL: define @replace_lsl_intrinsic_i64 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.lsl.nxv2i64( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.lsr.nxv16i8(, , ) +define @replace_lsr_intrinsic_i8( %a, %b) #0 { +; CHECK-LABEL: define @replace_lsr_intrinsic_i8 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.lsr.nxv16i8( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.lsr.nxv8i16(, , ) +define @replace_lsr_intrinsic_i16( %a, %b) #0 { +; CHECK-LABEL: define @replace_lsr_intrinsic_i16 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.lsr.nxv8i16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.lsr.nxv4i32(, , ) +define @replace_lsr_intrinsic_i32( %a, %b) #0 { +; CHECK-LABEL: define @replace_lsr_intrinsic_i32 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.lsr.nxv4i32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.lsr.nxv2i64(, , ) +define @replace_lsr_intrinsic_i64( %a, %b) #0 { +; CHECK-LABEL: define @replace_lsr_intrinsic_i64 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.lsr.nxv2i64( zeroinitializer, %a, %b) + ret %1 +} + +; Logical operations + +declare @llvm.aarch64.sve.and.nxv16i8(, , ) +define @replace_and_intrinsic_i8( %a, %b) #0 { +; CHECK-LABEL: define @replace_and_intrinsic_i8 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.and.nxv16i8( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.and.nxv8i16(, , ) +define @replace_and_intrinsic_i16( %a, %b) #0 { +; CHECK-LABEL: define @replace_and_intrinsic_i16 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.and.nxv8i16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.and.nxv4i32(, , ) +define @replace_and_intrinsic_i32( %a, %b) #0 { +; CHECK-LABEL: define @replace_and_intrinsic_i32 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.and.nxv4i32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.and.nxv2i64(, , ) +define @replace_and_intrinsic_i64( %a, %b) #0 { +; CHECK-LABEL: define @replace_and_intrinsic_i64 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.and.nxv2i64( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.bic.nxv16i8(, , ) +define @replace_bic_intrinsic_i8( %a, %b) #0 { +; CHECK-LABEL: define @replace_bic_intrinsic_i8 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.bic.nxv16i8( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.bic.nxv8i16(, , ) +define @replace_bic_intrinsic_i16( %a, %b) #0 { +; CHECK-LABEL: define @replace_bic_intrinsic_i16 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.bic.nxv8i16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.bic.nxv4i32(, , ) +define @replace_bic_intrinsic_i32( %a, %b) #0 { +; CHECK-LABEL: define @replace_bic_intrinsic_i32 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.bic.nxv4i32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.bic.nxv2i64(, , ) +define @replace_bic_intrinsic_i64( %a, %b) #0 { +; CHECK-LABEL: define @replace_bic_intrinsic_i64 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.bic.nxv2i64( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.eor.nxv16i8(, , ) +define @replace_eor_intrinsic_i8( %a, %b) #0 { +; CHECK-LABEL: define @replace_eor_intrinsic_i8 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.eor.nxv16i8( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.eor.nxv8i16(, , ) +define @replace_eor_intrinsic_i16( %a, %b) #0 { +; CHECK-LABEL: define @replace_eor_intrinsic_i16 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.eor.nxv8i16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.eor.nxv4i32(, , ) +define @replace_eor_intrinsic_i32( %a, %b) #0 { +; CHECK-LABEL: define @replace_eor_intrinsic_i32 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.eor.nxv4i32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.eor.nxv2i64(, , ) +define @replace_eor_intrinsic_i64( %a, %b) #0 { +; CHECK-LABEL: define @replace_eor_intrinsic_i64 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.eor.nxv2i64( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.orr.nxv16i8(, , ) +define @replace_orr_intrinsic_i8( %a, %b) #0 { +; CHECK-LABEL: define @replace_orr_intrinsic_i8 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.orr.nxv16i8( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.orr.nxv8i16(, , ) +define @replace_orr_intrinsic_i16( %a, %b) #0 { +; CHECK-LABEL: define @replace_orr_intrinsic_i16 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.orr.nxv8i16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.orr.nxv4i32(, , ) +define @replace_orr_intrinsic_i32( %a, %b) #0 { +; CHECK-LABEL: define @replace_orr_intrinsic_i32 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.orr.nxv4i32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.orr.nxv2i64(, , ) +define @replace_orr_intrinsic_i64( %a, %b) #0 { +; CHECK-LABEL: define @replace_orr_intrinsic_i64 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.orr.nxv2i64( zeroinitializer, %a, %b) + ret %1 +} + +; SVE2 - Uniform DSP operations + +declare @llvm.aarch64.sve.sqsub.nxv16i8(, , ) +define @replace_sqsub_intrinsic_i8( %a, %b) #0 { +; CHECK-LABEL: define @replace_sqsub_intrinsic_i8 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.sqsub.nxv16i8( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.sqsub.nxv8i16(, , ) +define @replace_sqsub_intrinsic_i16( %a, %b) #0 { +; CHECK-LABEL: define @replace_sqsub_intrinsic_i16 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.sqsub.nxv8i16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.sqsub.nxv4i32(, , ) +define @replace_sqsub_intrinsic_i32( %a, %b) #0 { +; CHECK-LABEL: define @replace_sqsub_intrinsic_i32 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.sqsub.nxv4i32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.sqsub.nxv2i64(, , ) +define @replace_sqsub_intrinsic_i64( %a, %b) #0 { +; CHECK-LABEL: define @replace_sqsub_intrinsic_i64 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.sqsub.nxv2i64( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.uqsub.nxv16i8(, , ) +define @replace_uqsub_intrinsic_i8( %a, %b) #0 { +; CHECK-LABEL: define @replace_uqsub_intrinsic_i8 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.uqsub.nxv16i8( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.uqsub.nxv8i16(, , ) +define @replace_uqsub_intrinsic_i16( %a, %b) #0 { +; CHECK-LABEL: define @replace_uqsub_intrinsic_i16 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.uqsub.nxv8i16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.uqsub.nxv4i32(, , ) +define @replace_uqsub_intrinsic_i32( %a, %b) #0 { +; CHECK-LABEL: define @replace_uqsub_intrinsic_i32 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.uqsub.nxv4i32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.uqsub.nxv2i64(, , ) +define @replace_uqsub_intrinsic_i64( %a, %b) #0 { +; CHECK-LABEL: define @replace_uqsub_intrinsic_i64 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret [[A]] +; + %1 = tail call @llvm.aarch64.sve.uqsub.nxv2i64( zeroinitializer, %a, %b) + ret %1 +} + +attributes #0 = { "target-features"="+sve,+sve2" } diff --git a/llvm/test/Transforms/InstCombine/AArch64/sve-intr-comb-u-forms-no-active-lanes.ll b/llvm/test/Transforms/InstCombine/AArch64/sve-intr-comb-u-forms-no-active-lanes.ll new file mode 100644 --- /dev/null +++ b/llvm/test/Transforms/InstCombine/AArch64/sve-intr-comb-u-forms-no-active-lanes.ll @@ -0,0 +1,1318 @@ +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2 +; RUN: opt -S -passes=instcombine < %s | FileCheck %s + +target triple = "aarch64-unknown-linux-gnu" + +; Replace SVE _u intrinsics with undef if the predicate is all false. + +; Float arithmetic + +declare @llvm.aarch64.sve.fabd.u.nxv8f16(, , ) +define @replace_fabd_intrinsic_half( %a, %b) #0 { +; CHECK-LABEL: define @replace_fabd_intrinsic_half +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1:[0-9]+]] { +; CHECK-NEXT: ret undef +; + %1 = tail call fast @llvm.aarch64.sve.fabd.u.nxv8f16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fabd.u.nxv4f32(, , ) +define @replace_fabd_intrinsic_float( %a, %b) #0 { +; CHECK-LABEL: define @replace_fabd_intrinsic_float +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call fast @llvm.aarch64.sve.fabd.u.nxv4f32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fabd.u.nxv2f64(, , ) +define @replace_fabd_intrinsic_double( %a, %b) #0 { +; CHECK-LABEL: define @replace_fabd_intrinsic_double +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call fast @llvm.aarch64.sve.fabd.u.nxv2f64( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fadd.u.nxv8f16(, , ) +define @replace_fadd_intrinsic_half( %a, %b) #0 { +; CHECK-LABEL: define @replace_fadd_intrinsic_half +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call fast @llvm.aarch64.sve.fadd.u.nxv8f16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fadd.u.nxv4f32(, , ) +define @replace_fadd_intrinsic_float( %a, %b) #0 { +; CHECK-LABEL: define @replace_fadd_intrinsic_float +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call fast @llvm.aarch64.sve.fadd.u.nxv4f32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fadd.u.nxv2f64(, , ) +define @replace_fadd_intrinsic_double( %a, %b) #0 { +; CHECK-LABEL: define @replace_fadd_intrinsic_double +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call fast @llvm.aarch64.sve.fadd.u.nxv2f64( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fdiv.u.nxv8f16(, , ) +define @replace_fdiv_intrinsic_half( %a, %b) #0 { +; CHECK-LABEL: define @replace_fdiv_intrinsic_half +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call fast @llvm.aarch64.sve.fdiv.u.nxv8f16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fdiv.u.nxv4f32(, , ) +define @replace_fdiv_intrinsic_float( %a, %b) #0 { +; CHECK-LABEL: define @replace_fdiv_intrinsic_float +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call fast @llvm.aarch64.sve.fdiv.u.nxv4f32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fdiv.u.nxv2f64(, , ) +define @replace_fdiv_intrinsic_double( %a, %b) #0 { +; CHECK-LABEL: define @replace_fdiv_intrinsic_double +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call fast @llvm.aarch64.sve.fdiv.u.nxv2f64( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fmax.u.nxv8f16(, , ) +define @replace_fmax_intrinsic_half( %a, %b) #0 { +; CHECK-LABEL: define @replace_fmax_intrinsic_half +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call fast @llvm.aarch64.sve.fmax.u.nxv8f16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fmax.u.nxv4f32(, , ) +define @replace_fmax_intrinsic_float( %a, %b) #0 { +; CHECK-LABEL: define @replace_fmax_intrinsic_float +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call fast @llvm.aarch64.sve.fmax.u.nxv4f32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fmax.u.nxv2f64(, , ) +define @replace_fmax_intrinsic_double( %a, %b) #0 { +; CHECK-LABEL: define @replace_fmax_intrinsic_double +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call fast @llvm.aarch64.sve.fmax.u.nxv2f64( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fmaxnm.u.nxv8f16(, , ) +define @replace_fmaxnm_intrinsic_half( %a, %b) #0 { +; CHECK-LABEL: define @replace_fmaxnm_intrinsic_half +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call fast @llvm.aarch64.sve.fmaxnm.u.nxv8f16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fmaxnm.u.nxv4f32(, , ) +define @replace_fmaxnm_intrinsic_float( %a, %b) #0 { +; CHECK-LABEL: define @replace_fmaxnm_intrinsic_float +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call fast @llvm.aarch64.sve.fmaxnm.u.nxv4f32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fmaxnm.u.nxv2f64(, , ) +define @replace_fmaxnm_intrinsic_double( %a, %b) #0 { +; CHECK-LABEL: define @replace_fmaxnm_intrinsic_double +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call fast @llvm.aarch64.sve.fmaxnm.u.nxv2f64( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fmin.u.nxv8f16(, , ) +define @replace_fmin_intrinsic_half( %a, %b) #0 { +; CHECK-LABEL: define @replace_fmin_intrinsic_half +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call fast @llvm.aarch64.sve.fmin.u.nxv8f16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fmin.u.nxv4f32(, , ) +define @replace_fmin_intrinsic_float( %a, %b) #0 { +; CHECK-LABEL: define @replace_fmin_intrinsic_float +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call fast @llvm.aarch64.sve.fmin.u.nxv4f32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fmin.u.nxv2f64(, , ) +define @replace_fmin_intrinsic_double( %a, %b) #0 { +; CHECK-LABEL: define @replace_fmin_intrinsic_double +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call fast @llvm.aarch64.sve.fmin.u.nxv2f64( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fminnm.u.nxv8f16(, , ) +define @replace_fminnm_intrinsic_half( %a, %b) #0 { +; CHECK-LABEL: define @replace_fminnm_intrinsic_half +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call fast @llvm.aarch64.sve.fminnm.u.nxv8f16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fminnm.u.nxv4f32(, , ) +define @replace_fminnm_intrinsic_float( %a, %b) #0 { +; CHECK-LABEL: define @replace_fminnm_intrinsic_float +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call fast @llvm.aarch64.sve.fminnm.u.nxv4f32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fminnm.u.nxv2f64(, , ) +define @replace_fminnm_intrinsic_double( %a, %b) #0 { +; CHECK-LABEL: define @replace_fminnm_intrinsic_double +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call fast @llvm.aarch64.sve.fminnm.u.nxv2f64( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fmla.u.nxv8f16(, , , ) +define @replace_fmla_intrinsic_half( %a, %b, %c) #0 { +; CHECK-LABEL: define @replace_fmla_intrinsic_half +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]], [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call fast @llvm.aarch64.sve.fmla.u.nxv8f16( zeroinitializer, %a, %b, %c) + ret %1 +} + +declare @llvm.aarch64.sve.fmla.u.nxv4f32(, , , ) +define @replace_fmla_intrinsic_float( %a, %b, %c) #0 { +; CHECK-LABEL: define @replace_fmla_intrinsic_float +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]], [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call fast @llvm.aarch64.sve.fmla.u.nxv4f32( zeroinitializer, %a, %b, %c) + ret %1 +} + +declare @llvm.aarch64.sve.fmla.u.nxv2f64(, , , ) +define @replace_fmla_intrinsic_double( %a, %b, %c) #0 { +; CHECK-LABEL: define @replace_fmla_intrinsic_double +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]], [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call fast @llvm.aarch64.sve.fmla.u.nxv2f64( zeroinitializer, %a, %b, %c) + ret %1 +} + +declare @llvm.aarch64.sve.fmls.u.nxv8f16(, , , ) +define @replace_fmls_intrinsic_half( %a, %b, %c) #0 { +; CHECK-LABEL: define @replace_fmls_intrinsic_half +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]], [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call fast @llvm.aarch64.sve.fmls.u.nxv8f16( zeroinitializer, %a, %b, %c) + ret %1 +} + +declare @llvm.aarch64.sve.fmls.u.nxv4f32(, , , ) +define @replace_fmls_intrinsic_float( %a, %b, %c) #0 { +; CHECK-LABEL: define @replace_fmls_intrinsic_float +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]], [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call fast @llvm.aarch64.sve.fmls.u.nxv4f32( zeroinitializer, %a, %b, %c) + ret %1 +} + +declare @llvm.aarch64.sve.fmls.u.nxv2f64(, , , ) +define @replace_fmls_intrinsic_double( %a, %b, %c) #0 { +; CHECK-LABEL: define @replace_fmls_intrinsic_double +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]], [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call fast @llvm.aarch64.sve.fmls.u.nxv2f64( zeroinitializer, %a, %b, %c) + ret %1 +} + +declare @llvm.aarch64.sve.fmul.u.nxv8f16(, , ) +define @replace_fmul_intrinsic_half( %a, %b) #0 { +; CHECK-LABEL: define @replace_fmul_intrinsic_half +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call fast @llvm.aarch64.sve.fmul.u.nxv8f16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fmul.u.nxv4f32(, , ) +define @replace_fmul_intrinsic_float( %a, %b) #0 { +; CHECK-LABEL: define @replace_fmul_intrinsic_float +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call fast @llvm.aarch64.sve.fmul.u.nxv4f32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fmul.u.nxv2f64(, , ) +define @replace_fmul_intrinsic_double( %a, %b) #0 { +; CHECK-LABEL: define @replace_fmul_intrinsic_double +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call fast @llvm.aarch64.sve.fmul.u.nxv2f64( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fmulx.u.nxv8f16(, , ) +define @replace_fmulx_intrinsic_half( %a, %b) #0 { +; CHECK-LABEL: define @replace_fmulx_intrinsic_half +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call fast @llvm.aarch64.sve.fmulx.u.nxv8f16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fmulx.u.nxv4f32(, , ) +define @replace_fmulx_intrinsic_float( %a, %b) #0 { +; CHECK-LABEL: define @replace_fmulx_intrinsic_float +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call fast @llvm.aarch64.sve.fmulx.u.nxv4f32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fmulx.u.nxv2f64(, , ) +define @replace_fmulx_intrinsic_double( %a, %b) #0 { +; CHECK-LABEL: define @replace_fmulx_intrinsic_double +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call fast @llvm.aarch64.sve.fmulx.u.nxv2f64( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fnmla.u.nxv8f16(, , , ) +define @replace_fnmla_intrinsic_half( %a, %b, %c) #0 { +; CHECK-LABEL: define @replace_fnmla_intrinsic_half +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]], [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call fast @llvm.aarch64.sve.fnmla.u.nxv8f16( zeroinitializer, %a, %b, %c) + ret %1 +} + +declare @llvm.aarch64.sve.fnmla.u.nxv4f32(, , , ) +define @replace_fnmla_intrinsic_float( %a, %b, %c) #0 { +; CHECK-LABEL: define @replace_fnmla_intrinsic_float +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]], [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call fast @llvm.aarch64.sve.fnmla.u.nxv4f32( zeroinitializer, %a, %b, %c) + ret %1 +} + +declare @llvm.aarch64.sve.fnmla.u.nxv2f64(, , , ) +define @replace_fnmla_intrinsic_double( %a, %b, %c) #0 { +; CHECK-LABEL: define @replace_fnmla_intrinsic_double +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]], [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call fast @llvm.aarch64.sve.fnmla.u.nxv2f64( zeroinitializer, %a, %b, %c) + ret %1 +} + +declare @llvm.aarch64.sve.fnmls.u.nxv8f16(, , , ) +define @replace_fnmls_intrinsic_half( %a, %b, %c) #0 { +; CHECK-LABEL: define @replace_fnmls_intrinsic_half +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]], [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call fast @llvm.aarch64.sve.fnmls.u.nxv8f16( zeroinitializer, %a, %b, %c) + ret %1 +} + +declare @llvm.aarch64.sve.fnmls.u.nxv4f32(, , , ) +define @replace_fnmls_intrinsic_float( %a, %b, %c) #0 { +; CHECK-LABEL: define @replace_fnmls_intrinsic_float +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]], [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call fast @llvm.aarch64.sve.fnmls.u.nxv4f32( zeroinitializer, %a, %b, %c) + ret %1 +} + +declare @llvm.aarch64.sve.fnmls.u.nxv2f64(, , , ) +define @replace_fnmls_intrinsic_double( %a, %b, %c) #0 { +; CHECK-LABEL: define @replace_fnmls_intrinsic_double +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]], [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call fast @llvm.aarch64.sve.fnmls.u.nxv2f64( zeroinitializer, %a, %b, %c) + ret %1 +} + +declare @llvm.aarch64.sve.fsub.u.nxv8f16(, , ) +define @replace_fsub_intrinsic_half( %a, %b) #0 { +; CHECK-LABEL: define @replace_fsub_intrinsic_half +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call fast @llvm.aarch64.sve.fsub.u.nxv8f16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fsub.u.nxv4f32(, , ) +define @replace_fsub_intrinsic_float( %a, %b) #0 { +; CHECK-LABEL: define @replace_fsub_intrinsic_float +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call fast @llvm.aarch64.sve.fsub.u.nxv4f32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.fsub.u.nxv2f64(, , ) +define @replace_fsub_intrinsic_double( %a, %b) #0 { +; CHECK-LABEL: define @replace_fsub_intrinsic_double +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call fast @llvm.aarch64.sve.fsub.u.nxv2f64( zeroinitializer, %a, %b) + ret %1 +} + +; Integer arithmetic + +declare @llvm.aarch64.sve.add.u.nxv16i8(, , ) +define @replace_add_intrinsic_i8( %a, %b) #0 { +; CHECK-LABEL: define @replace_add_intrinsic_i8 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.add.u.nxv16i8( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.add.u.nxv8i16(, , ) +define @replace_add_intrinsic_i16( %a, %b) #0 { +; CHECK-LABEL: define @replace_add_intrinsic_i16 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.add.u.nxv8i16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.add.u.nxv4i32(, , ) +define @replace_add_intrinsic_i32( %a, %b) #0 { +; CHECK-LABEL: define @replace_add_intrinsic_i32 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.add.u.nxv4i32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.add.u.nxv2i64(, , ) +define @replace_add_intrinsic_i64( %a, %b) #0 { +; CHECK-LABEL: define @replace_add_intrinsic_i64 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.add.u.nxv2i64( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.mla.u.nxv16i8(, , , ) +define @replace_mla_intrinsic_i8( %a, %b, %c) #0 { +; CHECK-LABEL: define @replace_mla_intrinsic_i8 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]], [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.mla.u.nxv16i8( zeroinitializer, %a, %b, %c) + ret %1 +} + +declare @llvm.aarch64.sve.mla.u.nxv8i16(, , , ) +define @replace_mla_intrinsic_i16( %a, %b, %c) #0 { +; CHECK-LABEL: define @replace_mla_intrinsic_i16 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]], [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.mla.u.nxv8i16( zeroinitializer, %a, %b, %c) + ret %1 +} + +declare @llvm.aarch64.sve.mla.u.nxv4i32(, , , ) +define @replace_mla_intrinsic_i32( %a, %b, %c) #0 { +; CHECK-LABEL: define @replace_mla_intrinsic_i32 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]], [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.mla.u.nxv4i32( zeroinitializer, %a, %b, %c) + ret %1 +} + +declare @llvm.aarch64.sve.mla.u.nxv2i64(, , , ) +define @replace_mla_intrinsic_i64( %a, %b, %c) #0 { +; CHECK-LABEL: define @replace_mla_intrinsic_i64 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]], [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.mla.u.nxv2i64( zeroinitializer, %a, %b, %c) + ret %1 +} + +declare @llvm.aarch64.sve.mls.u.nxv16i8(, , , ) +define @replace_mls_intrinsic_i8( %a, %b, %c) #0 { +; CHECK-LABEL: define @replace_mls_intrinsic_i8 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]], [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.mls.u.nxv16i8( zeroinitializer, %a, %b, %c) + ret %1 +} + +declare @llvm.aarch64.sve.mls.u.nxv8i16(, , , ) +define @replace_mls_intrinsic_i16( %a, %b, %c) #0 { +; CHECK-LABEL: define @replace_mls_intrinsic_i16 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]], [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.mls.u.nxv8i16( zeroinitializer, %a, %b, %c) + ret %1 +} + +declare @llvm.aarch64.sve.mls.u.nxv4i32(, , , ) +define @replace_mls_intrinsic_i32( %a, %b, %c) #0 { +; CHECK-LABEL: define @replace_mls_intrinsic_i32 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]], [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.mls.u.nxv4i32( zeroinitializer, %a, %b, %c) + ret %1 +} + +declare @llvm.aarch64.sve.mls.u.nxv2i64(, , , ) +define @replace_mls_intrinsic_i64( %a, %b, %c) #0 { +; CHECK-LABEL: define @replace_mls_intrinsic_i64 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]], [[C:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.mls.u.nxv2i64( zeroinitializer, %a, %b, %c) + ret %1 +} + +declare @llvm.aarch64.sve.mul.u.nxv16i8(, , ) +define @replace_mul_intrinsic_i8( %a, %b) #0 { +; CHECK-LABEL: define @replace_mul_intrinsic_i8 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.mul.u.nxv16i8( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.mul.u.nxv8i16(, , ) +define @replace_mul_intrinsic_i16( %a, %b) #0 { +; CHECK-LABEL: define @replace_mul_intrinsic_i16 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.mul.u.nxv8i16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.mul.u.nxv4i32(, , ) +define @replace_mul_intrinsic_i32( %a, %b) #0 { +; CHECK-LABEL: define @replace_mul_intrinsic_i32 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.mul.u.nxv4i32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.mul.u.nxv2i64(, , ) +define @replace_mul_intrinsic_i64( %a, %b) #0 { +; CHECK-LABEL: define @replace_mul_intrinsic_i64 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.mul.u.nxv2i64( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.sabd.u.nxv16i8(, , ) +define @replace_sabd_intrinsic_i8( %a, %b) #0 { +; CHECK-LABEL: define @replace_sabd_intrinsic_i8 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.sabd.u.nxv16i8( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.sabd.u.nxv8i16(, , ) +define @replace_sabd_intrinsic_i16( %a, %b) #0 { +; CHECK-LABEL: define @replace_sabd_intrinsic_i16 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.sabd.u.nxv8i16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.sabd.u.nxv4i32(, , ) +define @replace_sabd_intrinsic_i32( %a, %b) #0 { +; CHECK-LABEL: define @replace_sabd_intrinsic_i32 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.sabd.u.nxv4i32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.sabd.u.nxv2i64(, , ) +define @replace_sabd_intrinsic_i64( %a, %b) #0 { +; CHECK-LABEL: define @replace_sabd_intrinsic_i64 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.sabd.u.nxv2i64( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.smax.u.nxv16i8(, , ) +define @replace_smax_intrinsic_i8( %a, %b) #0 { +; CHECK-LABEL: define @replace_smax_intrinsic_i8 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.smax.u.nxv16i8( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.smax.u.nxv8i16(, , ) +define @replace_smax_intrinsic_i16( %a, %b) #0 { +; CHECK-LABEL: define @replace_smax_intrinsic_i16 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.smax.u.nxv8i16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.smax.u.nxv4i32(, , ) +define @replace_smax_intrinsic_i32( %a, %b) #0 { +; CHECK-LABEL: define @replace_smax_intrinsic_i32 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.smax.u.nxv4i32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.smax.u.nxv2i64(, , ) +define @replace_smax_intrinsic_i64( %a, %b) #0 { +; CHECK-LABEL: define @replace_smax_intrinsic_i64 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.smax.u.nxv2i64( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.smin.u.nxv16i8(, , ) +define @replace_smin_intrinsic_i8( %a, %b) #0 { +; CHECK-LABEL: define @replace_smin_intrinsic_i8 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.smin.u.nxv16i8( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.smin.u.nxv8i16(, , ) +define @replace_smin_intrinsic_i16( %a, %b) #0 { +; CHECK-LABEL: define @replace_smin_intrinsic_i16 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.smin.u.nxv8i16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.smin.u.nxv4i32(, , ) +define @replace_smin_intrinsic_i32( %a, %b) #0 { +; CHECK-LABEL: define @replace_smin_intrinsic_i32 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.smin.u.nxv4i32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.smin.u.nxv2i64(, , ) +define @replace_smin_intrinsic_i64( %a, %b) #0 { +; CHECK-LABEL: define @replace_smin_intrinsic_i64 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.smin.u.nxv2i64( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.smulh.u.nxv16i8(, , ) +define @replace_smulh_intrinsic_i8( %a, %b) #0 { +; CHECK-LABEL: define @replace_smulh_intrinsic_i8 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.smulh.u.nxv16i8( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.smulh.u.nxv8i16(, , ) +define @replace_smulh_intrinsic_i16( %a, %b) #0 { +; CHECK-LABEL: define @replace_smulh_intrinsic_i16 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.smulh.u.nxv8i16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.smulh.u.nxv4i32(, , ) +define @replace_smulh_intrinsic_i32( %a, %b) #0 { +; CHECK-LABEL: define @replace_smulh_intrinsic_i32 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.smulh.u.nxv4i32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.smulh.u.nxv2i64(, , ) +define @replace_smulh_intrinsic_i64( %a, %b) #0 { +; CHECK-LABEL: define @replace_smulh_intrinsic_i64 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.smulh.u.nxv2i64( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.sub.u.nxv16i8(, , ) +define @replace_sub_intrinsic_i8( %a, %b) #0 { +; CHECK-LABEL: define @replace_sub_intrinsic_i8 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.sub.u.nxv16i8( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.sub.u.nxv8i16(, , ) +define @replace_sub_intrinsic_i16( %a, %b) #0 { +; CHECK-LABEL: define @replace_sub_intrinsic_i16 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.sub.u.nxv8i16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.sub.u.nxv4i32(, , ) +define @replace_sub_intrinsic_i32( %a, %b) #0 { +; CHECK-LABEL: define @replace_sub_intrinsic_i32 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.sub.u.nxv4i32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.sub.u.nxv2i64(, , ) +define @replace_sub_intrinsic_i64( %a, %b) #0 { +; CHECK-LABEL: define @replace_sub_intrinsic_i64 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.sub.u.nxv2i64( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.uabd.u.nxv16i8(, , ) +define @replace_uabd_intrinsic_i8( %a, %b) #0 { +; CHECK-LABEL: define @replace_uabd_intrinsic_i8 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.uabd.u.nxv16i8( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.uabd.u.nxv8i16(, , ) +define @replace_uabd_intrinsic_i16( %a, %b) #0 { +; CHECK-LABEL: define @replace_uabd_intrinsic_i16 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.uabd.u.nxv8i16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.uabd.u.nxv4i32(, , ) +define @replace_uabd_intrinsic_i32( %a, %b) #0 { +; CHECK-LABEL: define @replace_uabd_intrinsic_i32 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.uabd.u.nxv4i32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.uabd.u.nxv2i64(, , ) +define @replace_uabd_intrinsic_i64( %a, %b) #0 { +; CHECK-LABEL: define @replace_uabd_intrinsic_i64 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.uabd.u.nxv2i64( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.umax.u.nxv16i8(, , ) +define @replace_umax_intrinsic_i8( %a, %b) #0 { +; CHECK-LABEL: define @replace_umax_intrinsic_i8 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.umax.u.nxv16i8( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.umax.u.nxv8i16(, , ) +define @replace_umax_intrinsic_i16( %a, %b) #0 { +; CHECK-LABEL: define @replace_umax_intrinsic_i16 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.umax.u.nxv8i16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.umax.u.nxv4i32(, , ) +define @replace_umax_intrinsic_i32( %a, %b) #0 { +; CHECK-LABEL: define @replace_umax_intrinsic_i32 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.umax.u.nxv4i32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.umax.u.nxv2i64(, , ) +define @replace_umax_intrinsic_i64( %a, %b) #0 { +; CHECK-LABEL: define @replace_umax_intrinsic_i64 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.umax.u.nxv2i64( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.umin.u.nxv16i8(, , ) +define @replace_umin_intrinsic_i8( %a, %b) #0 { +; CHECK-LABEL: define @replace_umin_intrinsic_i8 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.umin.u.nxv16i8( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.umin.u.nxv8i16(, , ) +define @replace_umin_intrinsic_i16( %a, %b) #0 { +; CHECK-LABEL: define @replace_umin_intrinsic_i16 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.umin.u.nxv8i16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.umin.u.nxv4i32(, , ) +define @replace_umin_intrinsic_i32( %a, %b) #0 { +; CHECK-LABEL: define @replace_umin_intrinsic_i32 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.umin.u.nxv4i32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.umin.u.nxv2i64(, , ) +define @replace_umin_intrinsic_i64( %a, %b) #0 { +; CHECK-LABEL: define @replace_umin_intrinsic_i64 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.umin.u.nxv2i64( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.umulh.u.nxv16i8(, , ) +define @replace_umulh_intrinsic_i8( %a, %b) #0 { +; CHECK-LABEL: define @replace_umulh_intrinsic_i8 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.umulh.u.nxv16i8( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.umulh.u.nxv8i16(, , ) +define @replace_umulh_intrinsic_i16( %a, %b) #0 { +; CHECK-LABEL: define @replace_umulh_intrinsic_i16 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.umulh.u.nxv8i16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.umulh.u.nxv4i32(, , ) +define @replace_umulh_intrinsic_i32( %a, %b) #0 { +; CHECK-LABEL: define @replace_umulh_intrinsic_i32 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.umulh.u.nxv4i32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.umulh.u.nxv2i64(, , ) +define @replace_umulh_intrinsic_i64( %a, %b) #0 { +; CHECK-LABEL: define @replace_umulh_intrinsic_i64 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.umulh.u.nxv2i64( zeroinitializer, %a, %b) + ret %1 +} + +; Shifts + +declare @llvm.aarch64.sve.asr.u.nxv16i8(, , ) +define @replace_asr_intrinsic_i8( %a, %b) #0 { +; CHECK-LABEL: define @replace_asr_intrinsic_i8 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.asr.u.nxv16i8( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.asr.u.nxv8i16(, , ) +define @replace_asr_intrinsic_i16( %a, %b) #0 { +; CHECK-LABEL: define @replace_asr_intrinsic_i16 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.asr.u.nxv8i16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.asr.u.nxv4i32(, , ) +define @replace_asr_intrinsic_i32( %a, %b) #0 { +; CHECK-LABEL: define @replace_asr_intrinsic_i32 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.asr.u.nxv4i32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.asr.u.nxv2i64(, , ) +define @replace_asr_intrinsic_i64( %a, %b) #0 { +; CHECK-LABEL: define @replace_asr_intrinsic_i64 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.asr.u.nxv2i64( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.lsl.u.nxv16i8(, , ) +define @replace_lsl_intrinsic_i8( %a, %b) #0 { +; CHECK-LABEL: define @replace_lsl_intrinsic_i8 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.lsl.u.nxv16i8( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.lsl.u.nxv8i16(, , ) +define @replace_lsl_intrinsic_i16( %a, %b) #0 { +; CHECK-LABEL: define @replace_lsl_intrinsic_i16 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.lsl.u.nxv8i16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.lsl.u.nxv4i32(, , ) +define @replace_lsl_intrinsic_i32( %a, %b) #0 { +; CHECK-LABEL: define @replace_lsl_intrinsic_i32 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.lsl.u.nxv4i32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.lsl.u.nxv2i64(, , ) +define @replace_lsl_intrinsic_i64( %a, %b) #0 { +; CHECK-LABEL: define @replace_lsl_intrinsic_i64 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.lsl.u.nxv2i64( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.lsr.u.nxv16i8(, , ) +define @replace_lsr_intrinsic_i8( %a, %b) #0 { +; CHECK-LABEL: define @replace_lsr_intrinsic_i8 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.lsr.u.nxv16i8( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.lsr.u.nxv8i16(, , ) +define @replace_lsr_intrinsic_i16( %a, %b) #0 { +; CHECK-LABEL: define @replace_lsr_intrinsic_i16 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.lsr.u.nxv8i16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.lsr.u.nxv4i32(, , ) +define @replace_lsr_intrinsic_i32( %a, %b) #0 { +; CHECK-LABEL: define @replace_lsr_intrinsic_i32 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.lsr.u.nxv4i32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.lsr.u.nxv2i64(, , ) +define @replace_lsr_intrinsic_i64( %a, %b) #0 { +; CHECK-LABEL: define @replace_lsr_intrinsic_i64 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.lsr.u.nxv2i64( zeroinitializer, %a, %b) + ret %1 +} + +; Logical operations + +declare @llvm.aarch64.sve.and.u.nxv16i8(, , ) +define @replace_and_intrinsic_i8( %a, %b) #0 { +; CHECK-LABEL: define @replace_and_intrinsic_i8 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.and.u.nxv16i8( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.and.u.nxv8i16(, , ) +define @replace_and_intrinsic_i16( %a, %b) #0 { +; CHECK-LABEL: define @replace_and_intrinsic_i16 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.and.u.nxv8i16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.and.u.nxv4i32(, , ) +define @replace_and_intrinsic_i32( %a, %b) #0 { +; CHECK-LABEL: define @replace_and_intrinsic_i32 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.and.u.nxv4i32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.and.u.nxv2i64(, , ) +define @replace_and_intrinsic_i64( %a, %b) #0 { +; CHECK-LABEL: define @replace_and_intrinsic_i64 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.and.u.nxv2i64( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.bic.u.nxv16i8(, , ) +define @replace_bic_intrinsic_i8( %a, %b) #0 { +; CHECK-LABEL: define @replace_bic_intrinsic_i8 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.bic.u.nxv16i8( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.bic.u.nxv8i16(, , ) +define @replace_bic_intrinsic_i16( %a, %b) #0 { +; CHECK-LABEL: define @replace_bic_intrinsic_i16 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.bic.u.nxv8i16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.bic.u.nxv4i32(, , ) +define @replace_bic_intrinsic_i32( %a, %b) #0 { +; CHECK-LABEL: define @replace_bic_intrinsic_i32 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.bic.u.nxv4i32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.bic.u.nxv2i64(, , ) +define @replace_bic_intrinsic_i64( %a, %b) #0 { +; CHECK-LABEL: define @replace_bic_intrinsic_i64 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.bic.u.nxv2i64( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.eor.u.nxv16i8(, , ) +define @replace_eor_intrinsic_i8( %a, %b) #0 { +; CHECK-LABEL: define @replace_eor_intrinsic_i8 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.eor.u.nxv16i8( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.eor.u.nxv8i16(, , ) +define @replace_eor_intrinsic_i16( %a, %b) #0 { +; CHECK-LABEL: define @replace_eor_intrinsic_i16 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.eor.u.nxv8i16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.eor.u.nxv4i32(, , ) +define @replace_eor_intrinsic_i32( %a, %b) #0 { +; CHECK-LABEL: define @replace_eor_intrinsic_i32 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.eor.u.nxv4i32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.eor.u.nxv2i64(, , ) +define @replace_eor_intrinsic_i64( %a, %b) #0 { +; CHECK-LABEL: define @replace_eor_intrinsic_i64 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.eor.u.nxv2i64( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.orr.u.nxv16i8(, , ) +define @replace_orr_intrinsic_i8( %a, %b) #0 { +; CHECK-LABEL: define @replace_orr_intrinsic_i8 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.orr.u.nxv16i8( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.orr.u.nxv8i16(, , ) +define @replace_orr_intrinsic_i16( %a, %b) #0 { +; CHECK-LABEL: define @replace_orr_intrinsic_i16 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.orr.u.nxv8i16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.orr.u.nxv4i32(, , ) +define @replace_orr_intrinsic_i32( %a, %b) #0 { +; CHECK-LABEL: define @replace_orr_intrinsic_i32 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.orr.u.nxv4i32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.orr.u.nxv2i64(, , ) +define @replace_orr_intrinsic_i64( %a, %b) #0 { +; CHECK-LABEL: define @replace_orr_intrinsic_i64 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.orr.u.nxv2i64( zeroinitializer, %a, %b) + ret %1 +} + +; SVE2 - Uniform DSP operations + +declare @llvm.aarch64.sve.sqsub.u.nxv16i8(, , ) +define @replace_sqsub_intrinsic_i8( %a, %b) #0 { +; CHECK-LABEL: define @replace_sqsub_intrinsic_i8 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.sqsub.u.nxv16i8( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.sqsub.u.nxv8i16(, , ) +define @replace_sqsub_intrinsic_i16( %a, %b) #0 { +; CHECK-LABEL: define @replace_sqsub_intrinsic_i16 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.sqsub.u.nxv8i16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.sqsub.u.nxv4i32(, , ) +define @replace_sqsub_intrinsic_i32( %a, %b) #0 { +; CHECK-LABEL: define @replace_sqsub_intrinsic_i32 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.sqsub.u.nxv4i32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.sqsub.u.nxv2i64(, , ) +define @replace_sqsub_intrinsic_i64( %a, %b) #0 { +; CHECK-LABEL: define @replace_sqsub_intrinsic_i64 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.sqsub.u.nxv2i64( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.uqsub.u.nxv16i8(, , ) +define @replace_uqsub_intrinsic_i8( %a, %b) #0 { +; CHECK-LABEL: define @replace_uqsub_intrinsic_i8 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.uqsub.u.nxv16i8( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.uqsub.u.nxv8i16(, , ) +define @replace_uqsub_intrinsic_i16( %a, %b) #0 { +; CHECK-LABEL: define @replace_uqsub_intrinsic_i16 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.uqsub.u.nxv8i16( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.uqsub.u.nxv4i32(, , ) +define @replace_uqsub_intrinsic_i32( %a, %b) #0 { +; CHECK-LABEL: define @replace_uqsub_intrinsic_i32 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.uqsub.u.nxv4i32( zeroinitializer, %a, %b) + ret %1 +} + +declare @llvm.aarch64.sve.uqsub.u.nxv2i64(, , ) +define @replace_uqsub_intrinsic_i64( %a, %b) #0 { +; CHECK-LABEL: define @replace_uqsub_intrinsic_i64 +; CHECK-SAME: ( [[A:%.*]], [[B:%.*]]) #[[ATTR1]] { +; CHECK-NEXT: ret undef +; + %1 = tail call @llvm.aarch64.sve.uqsub.u.nxv2i64( zeroinitializer, %a, %b) + ret %1 +} + +attributes #0 = { "target-features"="+sve,+sve2" }