| 1 |
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 6 |
| 2 |
// REQUIRES: aarch64-registered-target |
| 3 |
// RUN: %clang_cc1 -triple aarch64 -target-feature +sve -target-feature +sve2p2 -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s |
| 4 |
// RUN: %clang_cc1 -triple aarch64 -target-feature +sme -target-feature +sme2p2 -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s |
| 5 |
// RUN: %clang_cc1 -triple aarch64 -target-feature +sve -target-feature +sme2p2 -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s |
| 6 |
// RUN: %clang_cc1 -triple aarch64 -target-feature +sme -target-feature +sve2p2 -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s |
| 7 |
|
| 8 |
// RUN: %clang_cc1 -triple aarch64 -target-feature +sve -target-feature +sve2p2 -disable-O0-optnone -Werror -Wall -emit-llvm -o - -x c++ %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK |
| 9 |
// RUN: %clang_cc1 -triple aarch64 -target-feature +sve -target-feature +sve2p2 -S -disable-O0-optnone -Werror -Wall -o /dev/null %s |
| 10 |
// RUN: %clang_cc1 -triple aarch64 -target-feature +sme -target-feature +sme2p2 -S -disable-O0-optnone -Werror -Wall -o /dev/null %s |
| 11 |
|
| 12 |
#ifdef __ARM_FEATURE_SME |
| 13 |
#include "arm_sme.h" |
| 14 |
#define STREAMING __arm_streaming |
| 15 |
#else |
| 16 |
#include "arm_sve.h" |
| 17 |
#define STREAMING |
| 18 |
#endif |
| 19 |
|
| 20 |
|
| 21 |
// CHECK-LABEL: define dso_local i64 @test_svfirstp_b8( |
| 22 |
// CHECK-SAME: <vscale x 16 x i1> [[PG:%.*]], <vscale x 16 x i1> [[OP:%.*]]) #[[ATTR0:[0-9]+]] { |
| 23 |
// CHECK-NEXT: [[ENTRY:.*:]] |
| 24 |
// CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.firstp.nxv16i1(<vscale x 16 x i1> [[PG]], <vscale x 16 x i1> [[OP]]) |
| 25 |
// CHECK-NEXT: ret i64 [[TMP0]] |
| 26 |
// |
| 27 |
// CPP-CHECK-LABEL: define dso_local noundef i64 @_Z16test_svfirstp_b8u10__SVBool_tS_( |
| 28 |
// CPP-CHECK-SAME: <vscale x 16 x i1> [[PG:%.*]], <vscale x 16 x i1> [[OP:%.*]]) #[[ATTR0:[0-9]+]] { |
| 29 |
// CPP-CHECK-NEXT: [[ENTRY:.*:]] |
| 30 |
// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.firstp.nxv16i1(<vscale x 16 x i1> [[PG]], <vscale x 16 x i1> [[OP]]) |
| 31 |
// CPP-CHECK-NEXT: ret i64 [[TMP0]] |
| 32 |
// |
| 33 |
int64_t test_svfirstp_b8(svbool_t pg, svbool_t op) STREAMING |
| 34 |
{ |
| 35 |
return svfirstp_b8(pg, op); |
| 36 |
} |
| 37 |
|
| 38 |
// CHECK-LABEL: define dso_local i64 @test_svfirstp_b16( |
| 39 |
// CHECK-SAME: <vscale x 16 x i1> [[PG:%.*]], <vscale x 16 x i1> [[OP:%.*]]) #[[ATTR0]] { |
| 40 |
// CHECK-NEXT: [[ENTRY:.*:]] |
| 41 |
// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG]]) |
| 42 |
// CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[OP]]) |
| 43 |
// CHECK-NEXT: [[TMP2:%.*]] = tail call i64 @llvm.aarch64.sve.firstp.nxv8i1(<vscale x 8 x i1> [[TMP0]], <vscale x 8 x i1> [[TMP1]]) |
| 44 |
// CHECK-NEXT: ret i64 [[TMP2]] |
| 45 |
// |
| 46 |
// CPP-CHECK-LABEL: define dso_local noundef i64 @_Z17test_svfirstp_b16u10__SVBool_tS_( |
| 47 |
// CPP-CHECK-SAME: <vscale x 16 x i1> [[PG:%.*]], <vscale x 16 x i1> [[OP:%.*]]) #[[ATTR0]] { |
| 48 |
// CPP-CHECK-NEXT: [[ENTRY:.*:]] |
| 49 |
// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG]]) |
| 50 |
// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[OP]]) |
| 51 |
// CPP-CHECK-NEXT: [[TMP2:%.*]] = tail call i64 @llvm.aarch64.sve.firstp.nxv8i1(<vscale x 8 x i1> [[TMP0]], <vscale x 8 x i1> [[TMP1]]) |
| 52 |
// CPP-CHECK-NEXT: ret i64 [[TMP2]] |
| 53 |
// |
| 54 |
int64_t test_svfirstp_b16(svbool_t pg, svbool_t op) STREAMING |
| 55 |
{ |
| 56 |
return svfirstp_b16(pg, op); |
| 57 |
} |
| 58 |
|
| 59 |
// CHECK-LABEL: define dso_local i64 @test_svfirstp_b32( |
| 60 |
// CHECK-SAME: <vscale x 16 x i1> [[PG:%.*]], <vscale x 16 x i1> [[OP:%.*]]) #[[ATTR0]] { |
| 61 |
// CHECK-NEXT: [[ENTRY:.*:]] |
| 62 |
// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[PG]]) |
| 63 |
// CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[OP]]) |
| 64 |
// CHECK-NEXT: [[TMP2:%.*]] = tail call i64 @llvm.aarch64.sve.firstp.nxv4i1(<vscale x 4 x i1> [[TMP0]], <vscale x 4 x i1> [[TMP1]]) |
| 65 |
// CHECK-NEXT: ret i64 [[TMP2]] |
| 66 |
// |
| 67 |
// CPP-CHECK-LABEL: define dso_local noundef i64 @_Z17test_svfirstp_b32u10__SVBool_tS_( |
| 68 |
// CPP-CHECK-SAME: <vscale x 16 x i1> [[PG:%.*]], <vscale x 16 x i1> [[OP:%.*]]) #[[ATTR0]] { |
| 69 |
// CPP-CHECK-NEXT: [[ENTRY:.*:]] |
| 70 |
// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[PG]]) |
| 71 |
// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[OP]]) |
| 72 |
// CPP-CHECK-NEXT: [[TMP2:%.*]] = tail call i64 @llvm.aarch64.sve.firstp.nxv4i1(<vscale x 4 x i1> [[TMP0]], <vscale x 4 x i1> [[TMP1]]) |
| 73 |
// CPP-CHECK-NEXT: ret i64 [[TMP2]] |
| 74 |
// |
| 75 |
int64_t test_svfirstp_b32(svbool_t pg, svbool_t op) STREAMING |
| 76 |
{ |
| 77 |
return svfirstp_b32(pg, op); |
| 78 |
} |
| 79 |
|
| 80 |
// CHECK-LABEL: define dso_local i64 @test_svfirstp_b64( |
| 81 |
// CHECK-SAME: <vscale x 16 x i1> [[PG:%.*]], <vscale x 16 x i1> [[OP:%.*]]) #[[ATTR0]] { |
| 82 |
// CHECK-NEXT: [[ENTRY:.*:]] |
| 83 |
// CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[PG]]) |
| 84 |
// CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[OP]]) |
| 85 |
// CHECK-NEXT: [[TMP2:%.*]] = tail call i64 @llvm.aarch64.sve.firstp.nxv2i1(<vscale x 2 x i1> [[TMP0]], <vscale x 2 x i1> [[TMP1]]) |
| 86 |
// CHECK-NEXT: ret i64 [[TMP2]] |
| 87 |
// |
| 88 |
// CPP-CHECK-LABEL: define dso_local noundef i64 @_Z17test_svfirstp_b64u10__SVBool_tS_( |
| 89 |
// CPP-CHECK-SAME: <vscale x 16 x i1> [[PG:%.*]], <vscale x 16 x i1> [[OP:%.*]]) #[[ATTR0]] { |
| 90 |
// CPP-CHECK-NEXT: [[ENTRY:.*:]] |
| 91 |
// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[PG]]) |
| 92 |
// CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[OP]]) |
| 93 |
// CPP-CHECK-NEXT: [[TMP2:%.*]] = tail call i64 @llvm.aarch64.sve.firstp.nxv2i1(<vscale x 2 x i1> [[TMP0]], <vscale x 2 x i1> [[TMP1]]) |
| 94 |
// CPP-CHECK-NEXT: ret i64 [[TMP2]] |
| 95 |
// |
| 96 |
int64_t test_svfirstp_b64(svbool_t pg, svbool_t op) STREAMING |
| 97 |
{ |
| 98 |
return svfirstp_b64(pg, op); |
| 99 |
} |