This is an archive of the discontinued LLVM Phabricator instance.

[Clang][AArch64][SME] Generate target features from +(no)sme.* options
ClosedPublic

Authored by bryanpkc on Jan 27 2023, 3:44 AM.

Diff Detail

Event Timeline

bryanpkc created this revision.Jan 27 2023, 3:44 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 27 2023, 3:44 AM
bryanpkc requested review of this revision.Jan 27 2023, 3:44 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 27 2023, 3:44 AM
bryanpkc updated this revision to Diff 528293.Jun 4 2023, 11:07 PM
Matt added a subscriber: Matt.Jun 5 2023, 12:24 PM
sdesmalen added inline comments.Jul 6 2023, 12:22 AM
clang/lib/Driver/ToolChains/Arch/AArch64.cpp
87–90

SME shouldn't require SVE or SVE2. You can see the dependence in AArch64.td. We've updated code in AArch64 target SelectionDAG with HasSVEorSME instead of HasSVE where needed, so that code can still compile when only using +sme.

bryanpkc updated this revision to Diff 540842.Jul 16 2023, 6:03 PM
bryanpkc marked an inline comment as done.

Removed dependency on SVE and SVE2 as per @sdesmalen's suggestion. Also made nobf16 imply nosme to be consistent with the handling of other feature dependencies.

sdesmalen accepted this revision.Jul 17 2023, 6:44 AM
This revision is now accepted and ready to land.Jul 17 2023, 6:44 AM
This revision was landed with ongoing or failed builds.Jul 20 2023, 2:58 AM
This revision was automatically updated to reflect the committed changes.
michaelplatings added inline comments.
clang/test/Driver/aarch64-implied-sme-features.c
49

Hi Bryan, this test fails in our downstream toolchain because it has additional features that show up in between these features. Breaking the line up as shown would fix this. Another option could be to add {{.*}} between the features. Doing likewise for other checks in this file would make them less brittle as well.

MaskRay added inline comments.Jul 20 2023, 1:27 PM
clang/test/Driver/aarch64-implied-sme-features.c
49

First: -target has been deprecated since Clang 3.4, Use --target= for new tests.

Do you know why you have additional features? I think placing "-target-feature" on the same line is generally a good practice. It strengthens the test to ensure the feature set is compressive is not interleaved by other stuff.

bryanpkc added inline comments.Jul 20 2023, 1:36 PM
clang/test/Driver/aarch64-implied-sme-features.c
49

@michaelplatings @MaskRay I can submit a patch quickly to fix -target. I am curious what features show up between those ones in my test, because the options to toggle dependent features should be added immediately after one another. When I placed the "-target-feature" strings on the same line, I was following the example in aarch64-implied-sve-features.c.

clang/test/Driver/aarch64-implied-sme-features.c
49

Thanks Bryan & MaskRay for explaining. I was unaware of the importance of feature dependencies for the ordering of target-feature flags so I retract my suggestion.