Skip to content

[AArch64] add some more tests for FMV #91490

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 9, 2024

Conversation

tmatheson-arm
Copy link
Contributor

@tmatheson-arm tmatheson-arm commented May 8, 2024

Add a couple of tests to make it clear:

  • when FMV should be enabled and disabled by the driver.
  • which extensions are enabled/disabled based on the dependencies specified in TargetParser.

@llvmbot llvmbot added clang Clang issues not falling into any other category clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' labels May 8, 2024
@llvmbot
Copy link
Member

llvmbot commented May 8, 2024

@llvm/pr-subscribers-clang-driver

@llvm/pr-subscribers-clang

Author: Tomas Matheson (tmatheson-arm)

Changes

Patch is 28.62 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/91490.diff

2 Files Affected:

  • (added) clang/test/CodeGen/aarch64-fmv-dependencies.c (+381)
  • (added) clang/test/Driver/aarch64-fmv.c (+25)
diff --git a/clang/test/CodeGen/aarch64-fmv-dependencies.c b/clang/test/CodeGen/aarch64-fmv-dependencies.c
new file mode 100644
index 0000000000000..3f5f970eda96a
--- /dev/null
+++ b/clang/test/CodeGen/aarch64-fmv-dependencies.c
@@ -0,0 +1,381 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --check-attributes --check-globals all --filter "define|attributes" --include-generated-funcs --version 4
+
+// Test/document all of the dependencies between possible AArch64 FMV extensions.
+// Also test the name mangling.
+
+// RUN: %clang --target=aarch64-linux-gnu --rtlib=compiler-rt -emit-llvm -S -o - %s | FileCheck %s
+
+
+int __attribute__((target_version("aes"))) fmv(void) { return 0; }
+int __attribute__((target_version("bf16"))) fmv(void) { return 0; }
+int __attribute__((target_version("bti"))) fmv(void) { return 0; }
+int __attribute__((target_version("crc"))) fmv(void) { return 0; }
+int __attribute__((target_version("dgh"))) fmv(void) { return 0; }
+int __attribute__((target_version("dit"))) fmv(void) { return 0; }
+int __attribute__((target_version("dotprod"))) fmv(void) { return 0; }
+int __attribute__((target_version("dpb"))) fmv(void) { return 0; }
+int __attribute__((target_version("dpb2"))) fmv(void) { return 0; }
+int __attribute__((target_version("ebf16"))) fmv(void) { return 0; }
+int __attribute__((target_version("f32mm"))) fmv(void) { return 0; }
+int __attribute__((target_version("f64mm"))) fmv(void) { return 0; }
+int __attribute__((target_version("fcma"))) fmv(void) { return 0; }
+int __attribute__((target_version("flagm"))) fmv(void) { return 0; }
+int __attribute__((target_version("flagm2"))) fmv(void) { return 0; }
+int __attribute__((target_version("fp"))) fmv(void) { return 0; }
+int __attribute__((target_version("fp16"))) fmv(void) { return 0; }
+int __attribute__((target_version("fp16fml"))) fmv(void) { return 0; }
+int __attribute__((target_version("frintts"))) fmv(void) { return 0; }
+int __attribute__((target_version("i8mm"))) fmv(void) { return 0; }
+int __attribute__((target_version("jscvt"))) fmv(void) { return 0; }
+int __attribute__((target_version("ls64"))) fmv(void) { return 0; }
+int __attribute__((target_version("ls64_accdata"))) fmv(void) { return 0; }
+int __attribute__((target_version("ls64_v"))) fmv(void) { return 0; }
+int __attribute__((target_version("lse"))) fmv(void) { return 0; }
+int __attribute__((target_version("memtag"))) fmv(void) { return 0; }
+int __attribute__((target_version("memtag2"))) fmv(void) { return 0; }
+int __attribute__((target_version("memtag3"))) fmv(void) { return 0; }
+int __attribute__((target_version("mops"))) fmv(void) { return 0; }
+int __attribute__((target_version("pmull"))) fmv(void) { return 0; }
+int __attribute__((target_version("predres"))) fmv(void) { return 0; }
+int __attribute__((target_version("rcpc"))) fmv(void) { return 0; }
+int __attribute__((target_version("rcpc2"))) fmv(void) { return 0; }
+int __attribute__((target_version("rcpc3"))) fmv(void) { return 0; }
+int __attribute__((target_version("rdm"))) fmv(void) { return 0; }
+int __attribute__((target_version("rng"))) fmv(void) { return 0; }
+int __attribute__((target_version("rpres"))) fmv(void) { return 0; }
+int __attribute__((target_version("sb"))) fmv(void) { return 0; }
+int __attribute__((target_version("sha1"))) fmv(void) { return 0; }
+int __attribute__((target_version("sha2"))) fmv(void) { return 0; }
+int __attribute__((target_version("sha3"))) fmv(void) { return 0; }
+int __attribute__((target_version("simd"))) fmv(void) { return 0; }
+int __attribute__((target_version("sm4"))) fmv(void) { return 0; }
+int __attribute__((target_version("sme"))) fmv(void) { return 0; }
+int __attribute__((target_version("sme-f64f64"))) fmv(void) { return 0; }
+int __attribute__((target_version("sme-i16i64"))) fmv(void) { return 0; }
+int __attribute__((target_version("sme2"))) fmv(void) { return 0; }
+int __attribute__((target_version("ssbs"))) fmv(void) { return 0; }
+int __attribute__((target_version("ssbs2"))) fmv(void) { return 0; }
+int __attribute__((target_version("sve"))) fmv(void) { return 0; }
+int __attribute__((target_version("sve-bf16"))) fmv(void) { return 0; }
+int __attribute__((target_version("sve-ebf16"))) fmv(void) { return 0; }
+int __attribute__((target_version("sve-i8mm"))) fmv(void) { return 0; }
+int __attribute__((target_version("sve2"))) fmv(void) { return 0; }
+int __attribute__((target_version("sve2-aes"))) fmv(void) { return 0; }
+int __attribute__((target_version("sve2-bitperm"))) fmv(void) { return 0; }
+int __attribute__((target_version("sve2-pmull128"))) fmv(void) { return 0; }
+int __attribute__((target_version("sve2-sha3"))) fmv(void) { return 0; }
+int __attribute__((target_version("sve2-sm4"))) fmv(void) { return 0; }
+int __attribute__((target_version("wfxt"))) fmv(void) { return 0; }
+
+int __attribute__((target_version("default"))) fmv(void);
+
+int caller() {
+  return fmv();
+}
+
+//.
+// CHECK: @__aarch64_cpu_features = external dso_local global { i64 }
+// CHECK: @fmv.ifunc = weak_odr dso_local alias i32 (), ptr @fmv
+// CHECK: @fmv = weak_odr dso_local ifunc i32 (), ptr @fmv.resolver
+//.
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Maes(
+// CHECK-SAME: ) #[[ATTR0:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @caller(
+// CHECK-SAME: ) #[[ATTR0:[0-9]+]] {
+//
+// CHECK-LABEL: define weak_odr ptr @fmv.resolver() comdat {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Mbf16(
+// CHECK-SAME: ) #[[ATTR1:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Mbti(
+// CHECK-SAME: ) #[[ATTR2:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Mcrc(
+// CHECK-SAME: ) #[[ATTR3:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Mdgh(
+// CHECK-SAME: ) #[[ATTR0:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Mdit(
+// CHECK-SAME: ) #[[ATTR4:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Mdotprod(
+// CHECK-SAME: ) #[[ATTR5:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Mdpb(
+// CHECK-SAME: ) #[[ATTR6:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Mdpb2(
+// CHECK-SAME: ) #[[ATTR7:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Mebf16(
+// CHECK-SAME: ) #[[ATTR1:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Mf32mm(
+// CHECK-SAME: ) #[[ATTR8:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Mf64mm(
+// CHECK-SAME: ) #[[ATTR9:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Mfcma(
+// CHECK-SAME: ) #[[ATTR10:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Mflagm(
+// CHECK-SAME: ) #[[ATTR11:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Mflagm2(
+// CHECK-SAME: ) #[[ATTR12:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Mfp(
+// CHECK-SAME: ) #[[ATTR0:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Mfp16(
+// CHECK-SAME: ) #[[ATTR13:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Mfp16fml(
+// CHECK-SAME: ) #[[ATTR14:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Mfrintts(
+// CHECK-SAME: ) #[[ATTR15:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Mi8mm(
+// CHECK-SAME: ) #[[ATTR16:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Mjscvt(
+// CHECK-SAME: ) #[[ATTR17:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Mls64(
+// CHECK-SAME: ) #[[ATTR0:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Mls64_accdata(
+// CHECK-SAME: ) #[[ATTR18:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Mls64_v(
+// CHECK-SAME: ) #[[ATTR0:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Mlse(
+// CHECK-SAME: ) #[[ATTR19:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Mmemtag(
+// CHECK-SAME: ) #[[ATTR0:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Mmemtag2(
+// CHECK-SAME: ) #[[ATTR20:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Mmemtag3(
+// CHECK-SAME: ) #[[ATTR20:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Mmops(
+// CHECK-SAME: ) #[[ATTR21:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Mpmull(
+// CHECK-SAME: ) #[[ATTR22:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Mpredres(
+// CHECK-SAME: ) #[[ATTR23:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Mrcpc(
+// CHECK-SAME: ) #[[ATTR24:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Mrcpc2(
+// CHECK-SAME: ) #[[ATTR24:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Mrcpc3(
+// CHECK-SAME: ) #[[ATTR25:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Mrdm(
+// CHECK-SAME: ) #[[ATTR26:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Mrng(
+// CHECK-SAME: ) #[[ATTR27:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Mrpres(
+// CHECK-SAME: ) #[[ATTR0:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Msb(
+// CHECK-SAME: ) #[[ATTR28:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Msha1(
+// CHECK-SAME: ) #[[ATTR0:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Msha2(
+// CHECK-SAME: ) #[[ATTR29:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Msha3(
+// CHECK-SAME: ) #[[ATTR30:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Msimd(
+// CHECK-SAME: ) #[[ATTR0:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Msm4(
+// CHECK-SAME: ) #[[ATTR31:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Msme(
+// CHECK-SAME: ) #[[ATTR32:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Msme-f64f64(
+// CHECK-SAME: ) #[[ATTR33:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Msme-i16i64(
+// CHECK-SAME: ) #[[ATTR34:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Msme2(
+// CHECK-SAME: ) #[[ATTR35:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Mssbs(
+// CHECK-SAME: ) #[[ATTR0:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Mssbs2(
+// CHECK-SAME: ) #[[ATTR36:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Msve(
+// CHECK-SAME: ) #[[ATTR37:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Msve-bf16(
+// CHECK-SAME: ) #[[ATTR38:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Msve-ebf16(
+// CHECK-SAME: ) #[[ATTR38:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Msve-i8mm(
+// CHECK-SAME: ) #[[ATTR39:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Msve2(
+// CHECK-SAME: ) #[[ATTR40:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Msve2-aes(
+// CHECK-SAME: ) #[[ATTR41:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Msve2-bitperm(
+// CHECK-SAME: ) #[[ATTR42:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Msve2-pmull128(
+// CHECK-SAME: ) #[[ATTR41:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Msve2-sha3(
+// CHECK-SAME: ) #[[ATTR43:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Msve2-sm4(
+// CHECK-SAME: ) #[[ATTR44:[0-9]+]] {
+//
+// CHECK: Function Attrs: noinline nounwind optnone uwtable
+// CHECK-LABEL: define dso_local i32 @fmv._Mwfxt(
+// CHECK-SAME: ) #[[ATTR45:[0-9]+]] {
+//.
+// CHECK: attributes #[[ATTR0:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+fp-armv8,+neon,+outline-atomics,+v8a" }
+// CHECK: attributes #[[ATTR1:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+bf16,+fp-armv8,+neon,+outline-atomics,+v8a" }
+// CHECK: attributes #[[ATTR2:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+bti,+fp-armv8,+neon,+outline-atomics,+v8a" }
+// CHECK: attributes #[[ATTR3:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+crc,+fp-armv8,+neon,+outline-atomics,+v8a" }
+// CHECK: attributes #[[ATTR4:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+dit,+fp-armv8,+neon,+outline-atomics,+v8a" }
+// CHECK: attributes #[[ATTR5:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+dotprod,+fp-armv8,+neon,+outline-atomics,+v8a" }
+// CHECK: attributes #[[ATTR6:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+ccpp,+fp-armv8,+neon,+outline-atomics,+v8a" }
+// CHECK: attributes #[[ATTR7:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+ccdp,+ccpp,+fp-armv8,+neon,+outline-atomics,+v8a" }
+// CHECK: attributes #[[ATTR8:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+f32mm,+fp-armv8,+fullfp16,+neon,+outline-atomics,+sve,+v8a" }
+// CHECK: attributes #[[ATTR9:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+f64mm,+fp-armv8,+fullfp16,+neon,+outline-atomics,+sve,+v8a" }
+// CHECK: attributes #[[ATTR10:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+complxnum,+fp-armv8,+neon,+outline-atomics,+v8a" }
+// CHECK: attributes #[[ATTR11:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+flagm,+fp-armv8,+neon,+outline-atomics,+v8a" }
+// CHECK: attributes #[[ATTR12:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+altnzcv,+flagm,+fp-armv8,+neon,+outline-atomics,+v8a" }
+// CHECK: attributes #[[ATTR13:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+fp-armv8,+fullfp16,+neon,+outline-atomics,+v8a" }
+// CHECK: attributes #[[ATTR14:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+fp-armv8,+fp16fml,+fullfp16,+neon,+outline-atomics,+v8a" }
+// CHECK: attributes #[[ATTR15:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+fp-armv8,+fptoint,+neon,+outline-atomics,+v8a" }
+// CHECK: attributes #[[ATTR16:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+fp-armv8,+i8mm,+neon,+outline-atomics,+v8a" }
+// CHECK: attributes #[[ATTR17:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+fp-armv8,+jsconv,+neon,+outline-atomics,+v8a" }
+// CHECK: attributes #[[ATTR18:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+fp-armv8,+ls64,+neon,+outline-atomics,+v8a" }
+// CHECK: attributes #[[ATTR19:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+fp-armv8,+lse,+neon,+outline-atomics,+v8a" }
+// CHECK: attributes #[[ATTR20:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+fp-armv8,+mte,+neon,+outline-atomics,+v8a" }
+// CHECK: attributes #[[ATTR21:[0-9]+]] = { noinline nounwind optnone uwtable "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+fp-armv8,+mops,+neon,+outline-atomics,+v8a" }
+// CHECK: attributes #[[ATTR2...
[truncated]

@tmatheson-arm tmatheson-arm requested a review from ilinpv May 8, 2024 15:47
Copy link
Contributor

@ilinpv ilinpv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for additional FMV tests!

@ilinpv ilinpv requested review from labrinea and jroelofs May 8, 2024 16:00
@tmatheson-arm
Copy link
Contributor Author

The autogenerated checks for clang/test/CodeGen/aarch64-fmv-dependencies.c did not actually pass, due to changes in function ordering, so I have manually written the check lines, which makes the intent clearer anyway.

Some things look odd to me:

  • The "aes", "dgh", "fp", "ls64", "ls64_v", "memtag", "rpres", "sha1", "simd", "ssbs" functions all have the same set of target_features: "+fp-armv8,+neon,+outline-atomics,+v8a"
  • bf16 and ebf16 seem to be equivalent, and +ebf16 doesn't get added to the target-features
  • memtag2 and memtag3 both have the same target-features (which has only +mte)
  • +fp-armv8,+neon are present in all cases. I'm guessing this is due to the base architecture enabling them. However, disabling them with -march=+nofp adds -fp-armv8,-neon to all target-features, even where the target_version should re-enable it.

Are any of these cause for concern?

@ilinpv ilinpv requested a review from DanielKristofKiss May 9, 2024 09:56
@tmatheson-arm tmatheson-arm merged commit ddad7c3 into llvm:main May 9, 2024
@vvereschaka
Copy link
Contributor

@tmatheson-arm , the Clang::aarch64-fmv.c gets failed on Windows to Arm Linux cross builds with the following errors:

# .---command stderr------------
# | C:\buildbot\as-builder-2\x-aarch64\llvm-project\clang\test\Driver\aarch64-fmv.c:27:18: error: FMV-DISABLED: expected string not found in input
# | // FMV-DISABLED: "-target-feature" "-fmv"
# |                  ^
# | <stdin>:1:1: note: scanning from here
# | clang version 19.0.0git (https://github.com/llvm/llvm-project.git 639a740035b732e9bc0f43f3f95d1ce3acf82e1b)
# | ^
# | <stdin>:7:362: note: possible intended match here
# |  "C:\\buildbot\\as-builder-2\\x-aarch64\\build\\bin\\clang.exe" "-cc1" "-triple" "aarch64" "-emit-obj" "-disable-free" "-clear-ast-before-backend" "-main-file-name" "aarch64-fmv.c" "-mrelocation-model" "static" "-mframe-pointer=non-leaf" "-fmath-errno" "-ffp-contract=on" "-fno-rounding-math" "-mconstructor-aliases" "-funwind-tables=2" "-target-cpu" "generic" "-target-feature" "+v8a" "-target-feature" "+fp-armv8" "-target-feature" "+neon" "-target-abi" "aapcs" "-debugger-tuning=gdb" "-fdebug-compilation-dir=C:\\buildbot\\as-builder-2\\x-aarch64\\build\\tools\\clang\\test\\Driver" "-fcoverage-compilation-dir=C:\\buildbot\\as-builder-2\\x-aarch64\\build\\tools\\clang\\test\\Driver" "-resource-dir" "C:\\buildbot\\as-builder-2\\x-aarch64\\build\\lib\\clang\\19" "-isysroot" "c:/buildbot/fs/jetson-agx-ubuntu" "-ferror-limit" "19" "-fno-signed-char" "-fgnuc-version=4.2.1" "-fskip-odr-check-in-gmf" "-faddrsig" "-D__GCC_HAVE_DWARF2_CFI_ASM=1" "-o" "aarch64-fmv.o" "-x" "c" "C:\\buildbot\\as-builder-2\\x-aarch64\\llvm-project\\clang\\test\\Driver\\aarch64-fmv.c"
# |                                                                                                                                                                                                                                                                                                                                                                          ^
# | 
# | Input file: <stdin>
# | Check file: C:\buildbot\as-builder-2\x-aarch64\llvm-project\clang\test\Driver\aarch64-fmv.c
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             1: clang version 19.0.0git (https://github.com/llvm/llvm-project.git 639a740035b732e9bc0f43f3f95d1ce3acf82e1b) 
# | check:27'0     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
# |             2: Target: aarch64 
# | check:27'0     ~~~~~~~~~~~~~~~~
# |             3: Thread model: posix 
# | check:27'0     ~~~~~~~~~~~~~~~~~~~~
# |             4: InstalledDir: C:\buildbot\as-builder-2\x-aarch64\build\bin 
# | check:27'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             5: Build config: +assertions 
# | check:27'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             6:  (in-process) 
# | check:27'0     ~~~~~~~~~~~~~~
# |             7:  "C:\\buildbot\\as-builder-2\\x-aarch64\\build\\bin\\clang.exe" "-cc1" "-triple" "aarch64" "-emit-obj" "-disable-free" "-clear-ast-before-backend" "-main-file-name" "aarch64-fmv.c" "-mrelocation-model" "static" "-mframe-pointer=non-leaf" "-fmath-errno" "-ffp-contract=on" "-fno-rounding-math" "-mconstructor-aliases" "-funwind-tables=2" "-target-cpu" "generic" "-target-feature" "+v8a" "-target-feature" "+fp-armv8" "-target-feature" "+neon" "-target-abi" "aapcs" "-debugger-tuning=gdb" "-fdebug-compilation-dir=C:\\buildbot\\as-builder-2\\x-aarch64\\build\\tools\\clang\\test\\Driver" "-fcoverage-compilation-dir=C:\\buildbot\\as-builder-2\\x-aarch64\\build\\tools\\clang\\test\\Driver" "-resource-dir" "C:\\buildbot\\as-builder-2\\x-aarch64\\build\\lib\\clang\\19" "-isysroot" "c:/buildbot/fs/jetson-agx-ubuntu" "-ferror-limit" "19" "-fno-signed-char" "-fgnuc-version=4.2.1" "-fskip-odr-check-in-gmf" "-faddrsig" "-D__GCC_HAVE_DWARF2_CFI_ASM=1" "-o" "aarch64-fmv.o" "-x" "c" "C:\\buildbot\\as-builder-2\\x-aarch64\\llvm-project\\clang\\test\\Driver\\aarch64-fmv.c" 
# | check:27'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | check:27'1                                                                                                                                                                                                                                                                                                                                                                              ?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  possible intended match
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1
--
********************

https://lab.llvm.org/buildbot/#/builders/119/builds/18102

@vvereschaka
Copy link
Contributor

@tmatheson-arm
broken builder

would you take care of it or revert the changes?

@tmatheson-arm tmatheson-arm deleted the fmv_new_tests branch May 10, 2024 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants