391 lines · c
1// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py2// REQUIRES: aarch64-registered-target3// RUN: %clang_cc1 -triple aarch64 -target-feature +sve -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s4// RUN: %clang_cc1 -triple aarch64 -target-feature +sve -disable-O0-optnone -Werror -Wall -emit-llvm -o - -x c++ %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK5// RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s6// RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -disable-O0-optnone -Werror -Wall -emit-llvm -o - -x c++ %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK7// RUN: %clang_cc1 -triple aarch64 -target-feature +sve -S -disable-O0-optnone -Werror -Wall -o /dev/null %s8// RUN: %clang_cc1 -triple aarch64 -target-feature +sme -S -disable-O0-optnone -Werror -Wall -o /dev/null %s9 10#include <arm_sve.h>11 12#if defined __ARM_FEATURE_SME13#define MODE_ATTR __arm_streaming14#else15#define MODE_ATTR16#endif17 18#ifdef SVE_OVERLOADED_FORMS19// A simple used,unused... macro, long enough to represent any SVE builtin.20#define SVE_ACLE_FUNC(A1,A2_UNUSED,A3,A4_UNUSED) A1##A321#else22#define SVE_ACLE_FUNC(A1,A2,A3,A4) A1##A2##A3##A423#endif24 25// CHECK-LABEL: @test_svprfh(26// CHECK-NEXT: entry:27// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])28// CHECK-NEXT: tail call void @llvm.aarch64.sve.prf.nxv8i1(<vscale x 8 x i1> [[TMP0]], ptr [[BASE:%.*]], i32 0)29// CHECK-NEXT: ret void30//31// CPP-CHECK-LABEL: @_Z11test_svprfhu10__SVBool_tPKv(32// CPP-CHECK-NEXT: entry:33// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])34// CPP-CHECK-NEXT: tail call void @llvm.aarch64.sve.prf.nxv8i1(<vscale x 8 x i1> [[TMP0]], ptr [[BASE:%.*]], i32 0)35// CPP-CHECK-NEXT: ret void36//37void test_svprfh(svbool_t pg, const void *base) MODE_ATTR38{39 return svprfh(pg, base, SV_PLDL1KEEP);40}41 42// CHECK-LABEL: @test_svprfh_1(43// CHECK-NEXT: entry:44// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])45// CHECK-NEXT: tail call void @llvm.aarch64.sve.prf.nxv8i1(<vscale x 8 x i1> [[TMP0]], ptr [[BASE:%.*]], i32 1)46// CHECK-NEXT: ret void47//48// CPP-CHECK-LABEL: @_Z13test_svprfh_1u10__SVBool_tPKv(49// CPP-CHECK-NEXT: entry:50// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])51// CPP-CHECK-NEXT: tail call void @llvm.aarch64.sve.prf.nxv8i1(<vscale x 8 x i1> [[TMP0]], ptr [[BASE:%.*]], i32 1)52// CPP-CHECK-NEXT: ret void53//54void test_svprfh_1(svbool_t pg, const void *base) MODE_ATTR55{56 return svprfh(pg, base, SV_PLDL1STRM);57}58 59// CHECK-LABEL: @test_svprfh_2(60// CHECK-NEXT: entry:61// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])62// CHECK-NEXT: tail call void @llvm.aarch64.sve.prf.nxv8i1(<vscale x 8 x i1> [[TMP0]], ptr [[BASE:%.*]], i32 2)63// CHECK-NEXT: ret void64//65// CPP-CHECK-LABEL: @_Z13test_svprfh_2u10__SVBool_tPKv(66// CPP-CHECK-NEXT: entry:67// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])68// CPP-CHECK-NEXT: tail call void @llvm.aarch64.sve.prf.nxv8i1(<vscale x 8 x i1> [[TMP0]], ptr [[BASE:%.*]], i32 2)69// CPP-CHECK-NEXT: ret void70//71void test_svprfh_2(svbool_t pg, const void *base) MODE_ATTR72{73 return svprfh(pg, base, SV_PLDL2KEEP);74}75 76// CHECK-LABEL: @test_svprfh_3(77// CHECK-NEXT: entry:78// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])79// CHECK-NEXT: tail call void @llvm.aarch64.sve.prf.nxv8i1(<vscale x 8 x i1> [[TMP0]], ptr [[BASE:%.*]], i32 3)80// CHECK-NEXT: ret void81//82// CPP-CHECK-LABEL: @_Z13test_svprfh_3u10__SVBool_tPKv(83// CPP-CHECK-NEXT: entry:84// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])85// CPP-CHECK-NEXT: tail call void @llvm.aarch64.sve.prf.nxv8i1(<vscale x 8 x i1> [[TMP0]], ptr [[BASE:%.*]], i32 3)86// CPP-CHECK-NEXT: ret void87//88void test_svprfh_3(svbool_t pg, const void *base) MODE_ATTR89{90 return svprfh(pg, base, SV_PLDL2STRM);91}92 93// CHECK-LABEL: @test_svprfh_4(94// CHECK-NEXT: entry:95// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])96// CHECK-NEXT: tail call void @llvm.aarch64.sve.prf.nxv8i1(<vscale x 8 x i1> [[TMP0]], ptr [[BASE:%.*]], i32 4)97// CHECK-NEXT: ret void98//99// CPP-CHECK-LABEL: @_Z13test_svprfh_4u10__SVBool_tPKv(100// CPP-CHECK-NEXT: entry:101// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])102// CPP-CHECK-NEXT: tail call void @llvm.aarch64.sve.prf.nxv8i1(<vscale x 8 x i1> [[TMP0]], ptr [[BASE:%.*]], i32 4)103// CPP-CHECK-NEXT: ret void104//105void test_svprfh_4(svbool_t pg, const void *base) MODE_ATTR106{107 return svprfh(pg, base, SV_PLDL3KEEP);108}109 110// CHECK-LABEL: @test_svprfh_5(111// CHECK-NEXT: entry:112// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])113// CHECK-NEXT: tail call void @llvm.aarch64.sve.prf.nxv8i1(<vscale x 8 x i1> [[TMP0]], ptr [[BASE:%.*]], i32 5)114// CHECK-NEXT: ret void115//116// CPP-CHECK-LABEL: @_Z13test_svprfh_5u10__SVBool_tPKv(117// CPP-CHECK-NEXT: entry:118// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])119// CPP-CHECK-NEXT: tail call void @llvm.aarch64.sve.prf.nxv8i1(<vscale x 8 x i1> [[TMP0]], ptr [[BASE:%.*]], i32 5)120// CPP-CHECK-NEXT: ret void121//122void test_svprfh_5(svbool_t pg, const void *base) MODE_ATTR123{124 return svprfh(pg, base, SV_PLDL3STRM);125}126 127// CHECK-LABEL: @test_svprfh_6(128// CHECK-NEXT: entry:129// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])130// CHECK-NEXT: tail call void @llvm.aarch64.sve.prf.nxv8i1(<vscale x 8 x i1> [[TMP0]], ptr [[BASE:%.*]], i32 8)131// CHECK-NEXT: ret void132//133// CPP-CHECK-LABEL: @_Z13test_svprfh_6u10__SVBool_tPKv(134// CPP-CHECK-NEXT: entry:135// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])136// CPP-CHECK-NEXT: tail call void @llvm.aarch64.sve.prf.nxv8i1(<vscale x 8 x i1> [[TMP0]], ptr [[BASE:%.*]], i32 8)137// CPP-CHECK-NEXT: ret void138//139void test_svprfh_6(svbool_t pg, const void *base) MODE_ATTR140{141 return svprfh(pg, base, SV_PSTL1KEEP);142}143 144// CHECK-LABEL: @test_svprfh_7(145// CHECK-NEXT: entry:146// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])147// CHECK-NEXT: tail call void @llvm.aarch64.sve.prf.nxv8i1(<vscale x 8 x i1> [[TMP0]], ptr [[BASE:%.*]], i32 9)148// CHECK-NEXT: ret void149//150// CPP-CHECK-LABEL: @_Z13test_svprfh_7u10__SVBool_tPKv(151// CPP-CHECK-NEXT: entry:152// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])153// CPP-CHECK-NEXT: tail call void @llvm.aarch64.sve.prf.nxv8i1(<vscale x 8 x i1> [[TMP0]], ptr [[BASE:%.*]], i32 9)154// CPP-CHECK-NEXT: ret void155//156void test_svprfh_7(svbool_t pg, const void *base) MODE_ATTR157{158 return svprfh(pg, base, SV_PSTL1STRM);159}160 161// CHECK-LABEL: @test_svprfh_8(162// CHECK-NEXT: entry:163// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])164// CHECK-NEXT: tail call void @llvm.aarch64.sve.prf.nxv8i1(<vscale x 8 x i1> [[TMP0]], ptr [[BASE:%.*]], i32 10)165// CHECK-NEXT: ret void166//167// CPP-CHECK-LABEL: @_Z13test_svprfh_8u10__SVBool_tPKv(168// CPP-CHECK-NEXT: entry:169// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])170// CPP-CHECK-NEXT: tail call void @llvm.aarch64.sve.prf.nxv8i1(<vscale x 8 x i1> [[TMP0]], ptr [[BASE:%.*]], i32 10)171// CPP-CHECK-NEXT: ret void172//173void test_svprfh_8(svbool_t pg, const void *base) MODE_ATTR174{175 return svprfh(pg, base, SV_PSTL2KEEP);176}177 178// CHECK-LABEL: @test_svprfh_9(179// CHECK-NEXT: entry:180// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])181// CHECK-NEXT: tail call void @llvm.aarch64.sve.prf.nxv8i1(<vscale x 8 x i1> [[TMP0]], ptr [[BASE:%.*]], i32 11)182// CHECK-NEXT: ret void183//184// CPP-CHECK-LABEL: @_Z13test_svprfh_9u10__SVBool_tPKv(185// CPP-CHECK-NEXT: entry:186// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])187// CPP-CHECK-NEXT: tail call void @llvm.aarch64.sve.prf.nxv8i1(<vscale x 8 x i1> [[TMP0]], ptr [[BASE:%.*]], i32 11)188// CPP-CHECK-NEXT: ret void189//190void test_svprfh_9(svbool_t pg, const void *base) MODE_ATTR191{192 return svprfh(pg, base, SV_PSTL2STRM);193}194 195// CHECK-LABEL: @test_svprfh_10(196// CHECK-NEXT: entry:197// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])198// CHECK-NEXT: tail call void @llvm.aarch64.sve.prf.nxv8i1(<vscale x 8 x i1> [[TMP0]], ptr [[BASE:%.*]], i32 12)199// CHECK-NEXT: ret void200//201// CPP-CHECK-LABEL: @_Z14test_svprfh_10u10__SVBool_tPKv(202// CPP-CHECK-NEXT: entry:203// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])204// CPP-CHECK-NEXT: tail call void @llvm.aarch64.sve.prf.nxv8i1(<vscale x 8 x i1> [[TMP0]], ptr [[BASE:%.*]], i32 12)205// CPP-CHECK-NEXT: ret void206//207void test_svprfh_10(svbool_t pg, const void *base) MODE_ATTR208{209 return svprfh(pg, base, SV_PSTL3KEEP);210}211 212// CHECK-LABEL: @test_svprfh_11(213// CHECK-NEXT: entry:214// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])215// CHECK-NEXT: tail call void @llvm.aarch64.sve.prf.nxv8i1(<vscale x 8 x i1> [[TMP0]], ptr [[BASE:%.*]], i32 13)216// CHECK-NEXT: ret void217//218// CPP-CHECK-LABEL: @_Z14test_svprfh_11u10__SVBool_tPKv(219// CPP-CHECK-NEXT: entry:220// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])221// CPP-CHECK-NEXT: tail call void @llvm.aarch64.sve.prf.nxv8i1(<vscale x 8 x i1> [[TMP0]], ptr [[BASE:%.*]], i32 13)222// CPP-CHECK-NEXT: ret void223//224void test_svprfh_11(svbool_t pg, const void *base) MODE_ATTR225{226 return svprfh(pg, base, SV_PSTL3STRM);227}228 229// CHECK-LABEL: @test_svprfh_vnum(230// CHECK-NEXT: entry:231// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])232// CHECK-NEXT: [[TMP1:%.*]] = getelementptr <vscale x 8 x i16>, ptr [[BASE:%.*]], i64 [[VNUM:%.*]]233// CHECK-NEXT: tail call void @llvm.aarch64.sve.prf.nxv8i1(<vscale x 8 x i1> [[TMP0]], ptr [[TMP1]], i32 0)234// CHECK-NEXT: ret void235//236// CPP-CHECK-LABEL: @_Z16test_svprfh_vnumu10__SVBool_tPKvl(237// CPP-CHECK-NEXT: entry:238// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])239// CPP-CHECK-NEXT: [[TMP1:%.*]] = getelementptr <vscale x 8 x i16>, ptr [[BASE:%.*]], i64 [[VNUM:%.*]]240// CPP-CHECK-NEXT: tail call void @llvm.aarch64.sve.prf.nxv8i1(<vscale x 8 x i1> [[TMP0]], ptr [[TMP1]], i32 0)241// CPP-CHECK-NEXT: ret void242//243void test_svprfh_vnum(svbool_t pg, const void *base, int64_t vnum) MODE_ATTR244{245 return svprfh_vnum(pg, base, vnum, SV_PLDL1KEEP);246}247 248#ifndef __ARM_FEATURE_SME249 250// CHECK-LABEL: @test_svprfh_gather_u32base(251// CHECK-NEXT: entry:252// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[PG:%.*]])253// CHECK-NEXT: tail call void @llvm.aarch64.sve.prfh.gather.scalar.offset.nxv4i32(<vscale x 4 x i1> [[TMP0]], <vscale x 4 x i32> [[BASES:%.*]], i64 0, i32 0)254// CHECK-NEXT: ret void255//256// CPP-CHECK-LABEL: @_Z26test_svprfh_gather_u32baseu10__SVBool_tu12__SVUint32_t(257// CPP-CHECK-NEXT: entry:258// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[PG:%.*]])259// CPP-CHECK-NEXT: tail call void @llvm.aarch64.sve.prfh.gather.scalar.offset.nxv4i32(<vscale x 4 x i1> [[TMP0]], <vscale x 4 x i32> [[BASES:%.*]], i64 0, i32 0)260// CPP-CHECK-NEXT: ret void261//262void test_svprfh_gather_u32base(svbool_t pg, svuint32_t bases)263{264 return SVE_ACLE_FUNC(svprfh_gather,_u32base,,)(pg, bases, SV_PLDL1KEEP);265}266 267// CHECK-LABEL: @test_svprfh_gather_u64base(268// CHECK-NEXT: entry:269// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[PG:%.*]])270// CHECK-NEXT: tail call void @llvm.aarch64.sve.prfh.gather.scalar.offset.nxv2i64(<vscale x 2 x i1> [[TMP0]], <vscale x 2 x i64> [[BASES:%.*]], i64 0, i32 0)271// CHECK-NEXT: ret void272//273// CPP-CHECK-LABEL: @_Z26test_svprfh_gather_u64baseu10__SVBool_tu12__SVUint64_t(274// CPP-CHECK-NEXT: entry:275// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[PG:%.*]])276// CPP-CHECK-NEXT: tail call void @llvm.aarch64.sve.prfh.gather.scalar.offset.nxv2i64(<vscale x 2 x i1> [[TMP0]], <vscale x 2 x i64> [[BASES:%.*]], i64 0, i32 0)277// CPP-CHECK-NEXT: ret void278//279void test_svprfh_gather_u64base(svbool_t pg, svuint64_t bases)280{281 return SVE_ACLE_FUNC(svprfh_gather,_u64base,,)(pg, bases, SV_PLDL1KEEP);282}283 284// CHECK-LABEL: @test_svprfh_gather_s32index(285// CHECK-NEXT: entry:286// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[PG:%.*]])287// CHECK-NEXT: tail call void @llvm.aarch64.sve.prfh.gather.sxtw.index.nxv4i32(<vscale x 4 x i1> [[TMP0]], ptr [[BASE:%.*]], <vscale x 4 x i32> [[INDICES:%.*]], i32 0)288// CHECK-NEXT: ret void289//290// CPP-CHECK-LABEL: @_Z27test_svprfh_gather_s32indexu10__SVBool_tPKvu11__SVInt32_t(291// CPP-CHECK-NEXT: entry:292// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[PG:%.*]])293// CPP-CHECK-NEXT: tail call void @llvm.aarch64.sve.prfh.gather.sxtw.index.nxv4i32(<vscale x 4 x i1> [[TMP0]], ptr [[BASE:%.*]], <vscale x 4 x i32> [[INDICES:%.*]], i32 0)294// CPP-CHECK-NEXT: ret void295//296void test_svprfh_gather_s32index(svbool_t pg, const void *base, svint32_t indices)297{298 return SVE_ACLE_FUNC(svprfh_gather_,s32,index,)(pg, base, indices, SV_PLDL1KEEP);299}300 301// CHECK-LABEL: @test_svprfh_gather_s64index(302// CHECK-NEXT: entry:303// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[PG:%.*]])304// CHECK-NEXT: tail call void @llvm.aarch64.sve.prfh.gather.index.nxv2i64(<vscale x 2 x i1> [[TMP0]], ptr [[BASE:%.*]], <vscale x 2 x i64> [[INDICES:%.*]], i32 0)305// CHECK-NEXT: ret void306//307// CPP-CHECK-LABEL: @_Z27test_svprfh_gather_s64indexu10__SVBool_tPKvu11__SVInt64_t(308// CPP-CHECK-NEXT: entry:309// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[PG:%.*]])310// CPP-CHECK-NEXT: tail call void @llvm.aarch64.sve.prfh.gather.index.nxv2i64(<vscale x 2 x i1> [[TMP0]], ptr [[BASE:%.*]], <vscale x 2 x i64> [[INDICES:%.*]], i32 0)311// CPP-CHECK-NEXT: ret void312//313void test_svprfh_gather_s64index(svbool_t pg, const void *base, svint64_t indices)314{315 return SVE_ACLE_FUNC(svprfh_gather_,s64,index,)(pg, base, indices, SV_PLDL1KEEP);316}317 318// CHECK-LABEL: @test_svprfh_gather_u32index(319// CHECK-NEXT: entry:320// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[PG:%.*]])321// CHECK-NEXT: tail call void @llvm.aarch64.sve.prfh.gather.uxtw.index.nxv4i32(<vscale x 4 x i1> [[TMP0]], ptr [[BASE:%.*]], <vscale x 4 x i32> [[INDICES:%.*]], i32 0)322// CHECK-NEXT: ret void323//324// CPP-CHECK-LABEL: @_Z27test_svprfh_gather_u32indexu10__SVBool_tPKvu12__SVUint32_t(325// CPP-CHECK-NEXT: entry:326// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[PG:%.*]])327// CPP-CHECK-NEXT: tail call void @llvm.aarch64.sve.prfh.gather.uxtw.index.nxv4i32(<vscale x 4 x i1> [[TMP0]], ptr [[BASE:%.*]], <vscale x 4 x i32> [[INDICES:%.*]], i32 0)328// CPP-CHECK-NEXT: ret void329//330void test_svprfh_gather_u32index(svbool_t pg, const void *base, svuint32_t indices)331{332 return SVE_ACLE_FUNC(svprfh_gather_,u32,index,)(pg, base, indices, SV_PLDL1KEEP);333}334 335// CHECK-LABEL: @test_svprfh_gather_u64index(336// CHECK-NEXT: entry:337// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[PG:%.*]])338// CHECK-NEXT: tail call void @llvm.aarch64.sve.prfh.gather.index.nxv2i64(<vscale x 2 x i1> [[TMP0]], ptr [[BASE:%.*]], <vscale x 2 x i64> [[INDICES:%.*]], i32 0)339// CHECK-NEXT: ret void340//341// CPP-CHECK-LABEL: @_Z27test_svprfh_gather_u64indexu10__SVBool_tPKvu12__SVUint64_t(342// CPP-CHECK-NEXT: entry:343// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[PG:%.*]])344// CPP-CHECK-NEXT: tail call void @llvm.aarch64.sve.prfh.gather.index.nxv2i64(<vscale x 2 x i1> [[TMP0]], ptr [[BASE:%.*]], <vscale x 2 x i64> [[INDICES:%.*]], i32 0)345// CPP-CHECK-NEXT: ret void346//347void test_svprfh_gather_u64index(svbool_t pg, const void *base, svuint64_t indices)348{349 return SVE_ACLE_FUNC(svprfh_gather_,u64,index,)(pg, base, indices, SV_PLDL1KEEP);350}351 352// CHECK-LABEL: @test_svprfh_gather_u32base_index(353// CHECK-NEXT: entry:354// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[PG:%.*]])355// CHECK-NEXT: [[TMP1:%.*]] = shl i64 [[INDEX:%.*]], 1356// CHECK-NEXT: tail call void @llvm.aarch64.sve.prfh.gather.scalar.offset.nxv4i32(<vscale x 4 x i1> [[TMP0]], <vscale x 4 x i32> [[BASES:%.*]], i64 [[TMP1]], i32 0)357// CHECK-NEXT: ret void358//359// CPP-CHECK-LABEL: @_Z32test_svprfh_gather_u32base_indexu10__SVBool_tu12__SVUint32_tl(360// CPP-CHECK-NEXT: entry:361// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[PG:%.*]])362// CPP-CHECK-NEXT: [[TMP1:%.*]] = shl i64 [[INDEX:%.*]], 1363// CPP-CHECK-NEXT: tail call void @llvm.aarch64.sve.prfh.gather.scalar.offset.nxv4i32(<vscale x 4 x i1> [[TMP0]], <vscale x 4 x i32> [[BASES:%.*]], i64 [[TMP1]], i32 0)364// CPP-CHECK-NEXT: ret void365//366void test_svprfh_gather_u32base_index(svbool_t pg, svuint32_t bases, int64_t index)367{368 return SVE_ACLE_FUNC(svprfh_gather,_u32base,_index,)(pg, bases, index, SV_PLDL1KEEP);369}370 371// CHECK-LABEL: @test_svprfh_gather_u64base_index(372// CHECK-NEXT: entry:373// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[PG:%.*]])374// CHECK-NEXT: [[TMP1:%.*]] = shl i64 [[INDEX:%.*]], 1375// CHECK-NEXT: tail call void @llvm.aarch64.sve.prfh.gather.scalar.offset.nxv2i64(<vscale x 2 x i1> [[TMP0]], <vscale x 2 x i64> [[BASES:%.*]], i64 [[TMP1]], i32 0)376// CHECK-NEXT: ret void377//378// CPP-CHECK-LABEL: @_Z32test_svprfh_gather_u64base_indexu10__SVBool_tu12__SVUint64_tl(379// CPP-CHECK-NEXT: entry:380// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[PG:%.*]])381// CPP-CHECK-NEXT: [[TMP1:%.*]] = shl i64 [[INDEX:%.*]], 1382// CPP-CHECK-NEXT: tail call void @llvm.aarch64.sve.prfh.gather.scalar.offset.nxv2i64(<vscale x 2 x i1> [[TMP0]], <vscale x 2 x i64> [[BASES:%.*]], i64 [[TMP1]], i32 0)383// CPP-CHECK-NEXT: ret void384//385void test_svprfh_gather_u64base_index(svbool_t pg, svuint64_t bases, int64_t index)386{387 return SVE_ACLE_FUNC(svprfh_gather,_u64base,_index,)(pg, bases, index, SV_PLDL1KEEP);388}389 390#endif391