Skip to content

Commit 0bec083

Browse files
committed
[AArch64] Make apple-m4 armv8.7-a again (from armv9.2-a).
This is a partial revert of c66e1d6. Even though that allowed us to declare v9.2-a support without picking up SVE2 in both the backend and the driver, the frontend itself still enabled SVE via the arch version's default extensions. Avoid that by reverting back to v8.7-a while we look into longer-term solutions.
1 parent 148a119 commit 0bec083

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

clang/test/CodeGen/aarch64-targetattr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ void applem4() {}
218218
// CHECK: attributes #[[ATTR15]] = { noinline nounwind optnone "branch-target-enforcement" "guarded-control-stack" "no-trapping-math"="true" "sign-return-address"="non-leaf" "sign-return-address-key"="a_key" "stack-protector-buffer-size"="8" "target-cpu"="neoverse-n1" "target-features"="+aes,+bf16,+bti,+ccidx,+complxnum,+crc,+dit,+dotprod,+flagm,+fp-armv8,+fullfp16,+i8mm,+jsconv,+lse,+neon,+pauth,+perfmon,+predres,+ras,+rcpc,+rdm,+sb,+sha2,+spe,+ssbs,+sve,+sve2,+v8.1a,+v8.2a,+v8.3a,+v8.4a,+v8.5a,+v8.6a,+v8a" "tune-cpu"="cortex-a710" }
219219
// CHECK: attributes #[[ATTR16]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
220220
// CHECK: attributes #[[ATTR17]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="-v9.3a" }
221-
// CHECK: attributes #[[ATTR18]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="apple-m4" "target-features"="+aes,+bf16,+bti,+ccidx,+complxnum,+crc,+dit,+dotprod,+flagm,+fp-armv8,+fp16fml,+fpac,+fullfp16,+i8mm,+jsconv,+lse,+mec,+neon,+pauth,+perfmon,+predres,+ras,+rcpc,+rdm,+rme,+sb,+sha2,+sha3,+sme,+sme-f64f64,+sme-i16i64,+sme2,+ssbs,+sve,+sve2,+v8.1a,+v8.2a,+v8.3a,+v8.4a,+v8.5a,+v8.6a,+v8.7a,+v8a,+v9.1a,+v9.2a,+v9a,+wfxt" }
221+
// CHECK: attributes #[[ATTR18]] = { noinline nounwind optnone "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="apple-m4" "target-features"="+aes,+bf16,+bti,+ccidx,+complxnum,+crc,+dit,+dotprod,+flagm,+fp-armv8,+fp16fml,+fpac,+fullfp16,+i8mm,+jsconv,+lse,+neon,+pauth,+perfmon,+predres,+ras,+rcpc,+rdm,+sb,+sha2,+sha3,+sme,+sme-f64f64,+sme-i16i64,+sme2,+ssbs,+v8.1a,+v8.2a,+v8.3a,+v8.4a,+v8.5a,+v8.6a,+v8.7a,+v8a,+wfxt" }
222222
//.
223223
// CHECK: [[META0:![0-9]+]] = !{i32 1, !"wchar_size", i32 4}
224224
// CHECK: [[META1:![0-9]+]] = !{!"{{.*}}clang version {{.*}}"}

llvm/lib/Target/AArch64/AArch64Processors.td

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,10 @@ def ProcessorFeatures {
895895
FeatureLSE, FeaturePAuth, FeatureFPAC,
896896
FeatureRAS, FeatureRCPC, FeatureRDM,
897897
FeatureBF16, FeatureDotProd, FeatureMatMulInt8, FeatureSSBS];
898-
list<SubtargetFeature> AppleM4 = [HasV9_2aOps, FeatureSHA2, FeatureFPARMv8,
898+
// Technically apple-m4 is ARMv9.2a, but a quirk of LLVM defines v9.0 as
899+
// requiring SVE, which is optional according to the Arm ARM and not
900+
// supported by the core. ARMv8.7a is the next closest choice.
901+
list<SubtargetFeature> AppleM4 = [HasV8_7aOps, FeatureSHA2, FeatureFPARMv8,
899902
FeatureNEON, FeaturePerfMon, FeatureSHA3,
900903
FeatureFullFP16, FeatureFP16FML,
901904
FeatureAES, FeatureBF16,

llvm/unittests/TargetParser/TargetParserTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1122,7 +1122,7 @@ INSTANTIATE_TEST_SUITE_P(
11221122
AArch64CPUTestParams("apple-a16", "armv8.6-a"),
11231123
AArch64CPUTestParams("apple-m3", "armv8.6-a"),
11241124
AArch64CPUTestParams("apple-a17", "armv8.6-a"),
1125-
AArch64CPUTestParams("apple-m4", "armv9.2-a"),
1125+
AArch64CPUTestParams("apple-m4", "armv8.7-a"),
11261126
AArch64CPUTestParams("exynos-m3", "armv8-a"),
11271127
AArch64CPUTestParams("exynos-m4", "armv8.2-a"),
11281128
AArch64CPUTestParams("exynos-m5", "armv8.2-a"),

0 commit comments

Comments
 (0)