-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
[AArch64] Added feature dependencies for SME2p1 to TargetParser #81860
Conversation
Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it is probably because you do not have write If you have received no comments on your PR for a week, you can request a review If you have further questions, they may be answered by the LLVM GitHub User Guide. You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums. |
|
Seems like I cannot add reviewers yet so I am tagging you for review @momchil-velikov @hassnaaHamdi @CarolineConcatto |
Hi @Lukacma , |
Hello @CarolineConcatto , Yes I was thinking about this but I couldn't find a good way to directly test this. Ideally we would have some sme2p1 tests, which just wouldn't work when cc1 would be used, but we don't have that as far as I can tell. I could create a dummy test, which wouldn't pass without this change but that felt little odd to me. Therefore, I wanted to check if there is better way to test this fix I might have missed. |
Can it have a test for the sve types. Something like:
|
Yes it could be like that. I was just wondering if there is not a better way than creating dummy programs and seeing if they compile. We have a test in aarch64-implied-sme-features.c which tests this nicely like this :
Unfortunately this doesn't work with -cc1 and I was wondering if there is not a way to do something similiar for -cc1 that I am missing. If not I will create the dummy test. |
Add something like
|
@llvm/pr-subscribers-clang Author: None (Lukacma) ChangesThis patches adds missing target-feature dependencies for SME2.1 Full diff: https://github.com/llvm/llvm-project/pull/81860.diff 2 Files Affected:
diff --git a/clang/test/Sema/aarch64-sme2p1-diagnostics.c b/clang/test/Sema/aarch64-sme2p1-diagnostics.c
new file mode 100644
index 00000000000000..a0adb040385815
--- /dev/null
+++ b/clang/test/Sema/aarch64-sme2p1-diagnostics.c
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sme2p1 -fsyntax-only -verify %s
+
+// REQUIRES: aarch64-registered-target
+#include "arm_sme.h"
+
+svuint8x2_t test_sme2p1(svuint8x2_t x) {
+ // expected-no-diagnostics
+ return x;
+}
+
diff --git a/llvm/include/llvm/TargetParser/AArch64TargetParser.h b/llvm/include/llvm/TargetParser/AArch64TargetParser.h
index ed9944bcef23d0..7376ac98a2b095 100644
--- a/llvm/include/llvm/TargetParser/AArch64TargetParser.h
+++ b/llvm/include/llvm/TargetParser/AArch64TargetParser.h
@@ -273,7 +273,7 @@ inline constexpr ExtensionInfo Extensions[] = {
{"sme-i16i64", AArch64::AEK_SMEI16I64, "+sme-i16i64", "-sme-i16i64", FEAT_SME_I64, "+sme,+sme-i16i64,+bf16", 570},
{"sme", AArch64::AEK_SME, "+sme", "-sme", FEAT_SME, "+sme,+bf16", 430},
{"sme2", AArch64::AEK_SME2, "+sme2", "-sme2", FEAT_SME2, "+sme2,+sme,+bf16", 580},
- {"sme2p1", AArch64::AEK_SME2p1, "+sme2p1", "-sme2p1", FEAT_INIT, "", 0},
+ {"sme2p1", AArch64::AEK_SME2p1, "+sme2p1", "-sme2p1", FEAT_INIT, "+sme2p1,+sme2,+sme,+bf16", 0},
{"ssbs", AArch64::AEK_SSBS, "+ssbs", "-ssbs", FEAT_SSBS, "", 490},
{"ssbs2", AArch64::AEK_NONE, {}, {}, FEAT_SSBS2, "+ssbs", 500},
{"sve-bf16", AArch64::AEK_NONE, {}, {}, FEAT_SVE_BF16, "+sve,+bf16,+fullfp16,+fp-armv8,+neon", 320},
|
Testcase added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @Lukacma
@Lukacma Congratulations on having your first Pull Request (PR) merged into the LLVM Project! Your changes will be combined with recent changes from other authors, then tested Please check whether problems have been caused by your change specifically, as How to do this, and the rest of the post-merge process, is covered in detail here. If your change does cause a problem, it may be reverted, or you can revert it yourself. If you don't get any reports, no action is required from you. Your changes are working as expected, well done! |
This patches adds missing target-feature dependencies for SME2.1