Skip to content

Commit a1b75bf

Browse files
New test file for fp8 to check memory function attribute
1 parent 27917c4 commit a1b75bf

File tree

11 files changed

+37
-42
lines changed

11 files changed

+37
-42
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Check memory attribute for FP8 function
2+
3+
// REQUIRES: aarch64-registered-target
4+
5+
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +neon -target-feature +fp8 -target-feature +sve -target-feature +sme -target-feature +sme2 -target-feature +sme-f8f16 -target-feature +sme-f8f32 -target-feature +ssve-fp8fma -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | FileCheck %s
6+
7+
#include <arm_neon.h>
8+
#include <arm_sme.h>
9+
10+
11+
// SIMD
12+
mfloat8x16_t test_vcvtq_mf8_f16_fpm(float16x8_t vn, float16x8_t vm, fpm_t fpm) {
13+
return vcvtq_mf8_f16_fpm(vn, vm, fpm);
14+
}
15+
16+
// SVE
17+
svfloat16_t test_svcvtlt2_f16_mf8(svmfloat8_t zn, fpm_t fpm) __arm_streaming {
18+
return svcvtlt2_f16_mf8_fpm(zn, fpm);
19+
}
20+
21+
// CHECK: declare void @llvm.aarch64.set.fpmr(i64) [[ATTR3:#.*]]
22+
// CHECK: declare <vscale x 8 x half> @llvm.aarch64.sve.fp8.cvtlt2.nxv8f16(<vscale x 16 x i8>) [[ATTR4:#.*]]
23+
24+
25+
// SME
26+
svfloat32_t test_svmlalltt_lane_f32_mf8(svfloat32_t zda, svmfloat8_t zn, svmfloat8_t zm, fpm_t fpm) __arm_streaming {
27+
return svmlalltt_lane_f32_mf8_fpm(zda, zn, zm, 7, fpm);
28+
}
29+
30+
// CHECK: declare <vscale x 4 x float> @llvm.aarch64.sve.fp8.fmlalltt.lane.nxv4f32(<vscale x 4 x float>, <vscale x 16 x i8>, <vscale x 16 x i8>, i32 immarg) [[ATTR4]]
31+
32+
// CHECK: declare <16 x i8> @llvm.aarch64.neon.fp8.fcvtn.v16i8.v8f16(<8 x half>, <8 x half>) [[ATTR4]]
33+
34+
// CHECK: attributes [[ATTR1:#.*]] = {{{.*}}}
35+
// CHECK: attributes [[ATTR2:#.*]] = {{{.*}}}
36+
// CHECK: attributes [[ATTR3]] = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
37+
// CHECK: attributes [[ATTR4]] = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: read) }

clang/test/CodeGen/AArch64/fp8-intrinsics/acle_neon_fp8_cvt.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,3 @@ mfloat8x8_t test_vcvt_mf8_f16_fpm(float16x4_t vn, float16x4_t vm, fpm_t fpm) {
330330
mfloat8x16_t test_vcvtq_mf8_f16_fpm(float16x8_t vn, float16x8_t vm, fpm_t fpm) {
331331
return vcvtq_mf8_f16_fpm(vn, vm, fpm);
332332
}
333-
334-
// CHECK: declare void @llvm.aarch64.set.fpmr(i64) [[ATTR1:#.*]]
335-
// CHECK: attributes [[ATTR1]] = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }

clang/test/CodeGen/AArch64/fp8-intrinsics/acle_neon_fp8_fdot.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,6 @@ float16x4_t test_vdot_lane_f16(float16x4_t vd, mfloat8x8_t vn, mfloat8x8_t vm, f
8383
return vdot_lane_f16_mf8_fpm(vd, vn, vm, 3, fpmr);
8484
}
8585

86-
// CHECK: declare void @llvm.aarch64.set.fpmr(i64) [[ATTR1:#.*]]
87-
8886
// CHECK-LABEL: define dso_local <4 x half> @test_vdot_laneq_f16(
8987
// CHECK-SAME: <4 x half> noundef [[VD:%.*]], <8 x i8> [[VN:%.*]], <16 x i8> [[VM:%.*]], i64 noundef [[FPMR:%.*]]) #[[ATTR0]] {
9088
// CHECK-NEXT: [[ENTRY:.*:]]
@@ -271,4 +269,3 @@ float32x4_t test_vdotq_laneq_f32(float32x4_t vd, mfloat8x16_t vn, mfloat8x16_t v
271269
return vdotq_laneq_f32_mf8_fpm(vd, vn, vm, 3, fpmr);
272270
}
273271

274-
// CHECK: attributes [[ATTR1]] = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }

clang/test/CodeGen/AArch64/fp8-intrinsics/acle_neon_fp8_fmla.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,6 @@ float16x8_t test_vmlalb_lane(float16x8_t vd, mfloat8x16_t vn, mfloat8x8_t vm, fp
154154
return vmlalbq_lane_f16_mf8_fpm(vd, vn, vm, 0, fpm);
155155
}
156156

157-
// CHECK: declare void @llvm.aarch64.set.fpmr(i64) [[ATTR1:#.*]]
158-
159157
// CHECK-LABEL: define dso_local <8 x half> @test_vmlalb_laneq(
160158
// CHECK-SAME: <8 x half> noundef [[VD:%.*]], <16 x i8> [[VN:%.*]], <16 x i8> [[VM:%.*]], i64 noundef [[FPM:%.*]]) #[[ATTR0]] {
161159
// CHECK-NEXT: [[ENTRY:.*:]]
@@ -381,5 +379,3 @@ float32x4_t test_vmlalltt_lane(float32x4_t vd, mfloat8x16_t vn, mfloat8x8_t vm,
381379
float32x4_t test_vmlalltt_laneq(float32x4_t vd, mfloat8x16_t vn, mfloat8x16_t vm, fpm_t fpm) {
382380
return vmlallttq_laneq_f32_mf8_fpm(vd, vn, vm, 15, fpm);
383381
}
384-
385-
// CHECK: attributes [[ATTR1]] = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }

clang/test/CodeGen/AArch64/fp8-intrinsics/acle_sme2_fp8_cvt.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ svmfloat8_t test_cvt_f16_x2(svfloat16x2_t zn, fpm_t fpmr) __arm_streaming {
3232
return SVE_ACLE_FUNC(svcvt_mf8,_f16_x2,_fpm)(zn, fpmr);
3333
}
3434

35-
// CHECK: declare void @llvm.aarch64.set.fpmr(i64) [[ATTR1:#.*]]
36-
3735
// CHECK-LABEL: @test_cvt_f32_x4(
3836
// CHECK-NEXT: entry:
3937
// CHECK-NEXT: tail call void @llvm.aarch64.set.fpmr(i64 [[FPMR:%.*]])
@@ -210,4 +208,3 @@ svbfloat16x2_t test_cvtl2_bf16_x2(svmfloat8_t zn, fpm_t fpmr) __arm_streaming {
210208
return SVE_ACLE_FUNC(svcvtl2_bf16,_mf8,_x2_fpm)(zn, fpmr);
211209
}
212210

213-
// CHECK: attributes [[ATTR1]] = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }

clang/test/CodeGen/AArch64/fp8-intrinsics/acle_sme2_fp8_fmopa.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ void test_svmopa_za16_mf8_m(svbool_t pn, svbool_t pm, svmfloat8_t zn,
3535
SVE_ACLE_FUNC(svmopa_za16,_mf8,_m_fpm)(1, pn, pm, zn, zm, fpmr);
3636
}
3737

38-
// CHECK: declare void @llvm.aarch64.set.fpmr(i64) [[ATTR1:#.*]]
39-
//
4038
// CHECK-LABEL: define dso_local void @test_svmopa_za32_mf8_m(
4139
// CHECK-SAME: <vscale x 16 x i1> [[PN:%.*]], <vscale x 16 x i1> [[PM:%.*]], <vscale x 16 x i8> [[ZN:%.*]], <vscale x 16 x i8> [[ZM:%.*]], i64 noundef [[FPMR:%.*]]) #[[ATTR0]] {
4240
// CHECK-NEXT: [[ENTRY:.*:]]
@@ -56,5 +54,3 @@ void test_svmopa_za32_mf8_m(svbool_t pn, svbool_t pm, svmfloat8_t zn,
5654
SVE_ACLE_FUNC(svmopa_za32,_mf8,_m_fpm)(3, pn, pm, zn, zm, fpmr);
5755
}
5856

59-
60-
// CHECK: attributes [[ATTR1]] = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }

clang/test/CodeGen/AArch64/fp8-intrinsics/acle_sme2_fp8_mla.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ void test_svmla_lane_za16_vg2x1(uint32_t slice, svmfloat8_t zn, svmfloat8_t zm,
3535
SME_ACLE_FUNC(svmla_lane_za16,_mf8,_vg2x1_fpm,,)(slice, zn, zm, 0, fpm);
3636
}
3737

38-
// CHECK: declare void @llvm.aarch64.set.fpmr(i64) [[ATTR1:#.*]]
39-
4038
// CHECK-LABEL: define dso_local void @test_svmla_lane_za16_vg2x2(
4139
// CHECK-SAME: i32 noundef [[SLICE:%.*]], <vscale x 16 x i8> [[ZN_COERCE0:%.*]], <vscale x 16 x i8> [[ZN_COERCE1:%.*]], <vscale x 16 x i8> [[ZM:%.*]], i64 noundef [[FPM:%.*]]) #[[ATTR0]] {
4240
// CHECK-NEXT: [[ENTRY:.*:]]
@@ -316,6 +314,3 @@ void test_svmla_multi_za32_vg4x2(uint32_t slice, svmfloat8x2_t zn, svmfloat8x2_t
316314
void test_svmla_multi_za32_vg4x4(uint32_t slice, svmfloat8x4_t zn, svmfloat8x4_t zm, fpm_t fpm) __arm_streaming __arm_inout("za") {
317315
SME_ACLE_FUNC(svmla_za32,_mf8,_vg4x4_fpm,,)(slice, zn, zm, fpm);
318316
}
319-
320-
321-
// CHECK: attributes [[ATTR1]] = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }

clang/test/CodeGen/AArch64/fp8-intrinsics/acle_sve2_fp8_cvt.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ svbfloat16_t test_svcvt1_bf16_mf8(svmfloat8_t zn, fpm_t fpm) STREAMING {
4646
return SVE_ACLE_FUNC(svcvt1_bf16,_mf8,_fpm)(zn, fpm);
4747
}
4848

49-
// CHECK: declare void @llvm.aarch64.set.fpmr(i64) [[ATTR1:#.*]]
50-
5149
// CHECK-LABEL: define dso_local <vscale x 8 x bfloat> @test_svcvt2_bf16_mf8(
5250
// CHECK-SAME: <vscale x 16 x i8> [[ZN:%.*]], i64 noundef [[FPM:%.*]]) #[[ATTR0]] {
5351
// CHECK-NEXT: [[ENTRY:.*:]]
@@ -173,6 +171,3 @@ svfloat16_t test_svcvtlt1_f16_mf8(svmfloat8_t zn, fpm_t fpm) STREAMING {
173171
svfloat16_t test_svcvtlt2_f16_mf8(svmfloat8_t zn, fpm_t fpm) STREAMING {
174172
return SVE_ACLE_FUNC(svcvtlt2_f16,_mf8,_fpm)(zn, fpm);
175173
}
176-
177-
178-
// CHECK: attributes [[ATTR1]] = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }

clang/test/CodeGen/AArch64/fp8-intrinsics/acle_sve2_fp8_cvtn.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ svmfloat8_t test_svcvtn_f8_bf16(svbfloat16x2_t zn_zm, fpm_t fpm) STREAMING {
4646
return SVE_ACLE_FUNC(svcvtn_mf8,_bf16_x2,_fpm)(zn_zm, fpm);
4747
}
4848

49-
// CHECK: declare void @llvm.aarch64.set.fpmr(i64) [[ATTR1:#.*]]
50-
5149
// CHECK-LABEL: define dso_local <vscale x 16 x i8> @test_svcvtn_f8_f16(
5250
// CHECK-SAME: <vscale x 8 x half> [[ZN_ZM_COERCE0:%.*]], <vscale x 8 x half> [[ZN_ZM_COERCE1:%.*]], i64 noundef [[FPM:%.*]]) #[[ATTR0]] {
5351
// CHECK-NEXT: [[ENTRY:.*:]]
@@ -101,6 +99,3 @@ svmfloat8_t test_svcvtnb_f8_f32(svfloat32x2_t zn_zm, fpm_t fpm) STREAMING {
10199
svmfloat8_t test_svcvtnt_f8_f32(svmfloat8_t zd, svfloat32x2_t zn_zm, fpm_t fpm) STREAMING {
102100
return SVE_ACLE_FUNC(svcvtnt_mf8,_f32_x2,_fpm)(zd, zn_zm, fpm);
103101
}
104-
105-
106-
// CHECK: attributes [[ATTR1]] = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }

clang/test/CodeGen/AArch64/fp8-intrinsics/acle_sve2_fp8_fdot.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ svfloat32_t test_svdot_f32_mf8(svfloat32_t zda, svmfloat8_t zn, svmfloat8_t zm,
4646
return SVE_ACLE_FUNC(svdot,_f32_mf8,_fpm)(zda, zn, zm, fpm);
4747
}
4848

49-
// CHECK: declare void @llvm.aarch64.set.fpmr(i64) [[ATTR1:#.*]]
50-
5149
// CHECK-LABEL: define dso_local <vscale x 4 x float> @test_svdot_n_f32_mf8(
5250
// CHECK-SAME: <vscale x 4 x float> [[ZDA:%.*]], <vscale x 16 x i8> [[ZN:%.*]], <1 x i8> [[ZM:%.*]], i64 noundef [[FPM:%.*]]) #[[ATTR0]] {
5351
// CHECK-NEXT: [[ENTRY:.*:]]
@@ -149,6 +147,3 @@ svfloat32_t test_svdot_lane_f32_mf8(svfloat32_t zda, svmfloat8_t zn, svmfloat8_t
149147
svfloat16_t test_svdot_lane_f16_mf8(svfloat16_t zda, svmfloat8_t zn, svmfloat8_t zm, fpm_t fpm) STREAMING {
150148
return SVE_ACLE_FUNC(svdot_lane,_f16_mf8,_fpm)(zda, zn, zm, 7, fpm);
151149
}
152-
153-
154-
// CHECK: attributes [[ATTR1]] = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }

0 commit comments

Comments
 (0)