-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[AArch64TargetParser]Fix reconstructFromParsedFeatures ignoring negative features #142236
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
Changes from 1 commit
92da4de
34d6e7f
1a9f8a3
650461d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1831,6 +1831,22 @@ TEST_P(AArch64ExtensionDependenciesBaseCPUTestFixture, | |
| } | ||
| } | ||
|
|
||
| TEST(TargetParserTest, testAArch64ReconstructFromParsedFeatures) { | ||
MatzeB marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| AArch64::ExtensionSet Extensions; | ||
| std::vector<std::string> FeatureOptions = { | ||
| "-sve2", "-Baz", "+sve", "+FooBar", "+sve2", "+neon", "-sve", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this has the same issue as described for the C test: the function is not designed to be able to handle both
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line made me believe it was meant to handle negative features: https://github.com/llvm/llvm-project/blob/main/llvm/lib/TargetParser/AArch64TargetParser.cpp#L368
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the original intention was for it to be able to handle either positive (added to the |
||
| }; | ||
| std::vector<std::string> NonExtensions; | ||
| Extensions.reconstructFromParsedFeatures(FeatureOptions, NonExtensions); | ||
|
|
||
| std::vector<std::string> NonExtensionsExpected = {"-Baz", "+FooBar"}; | ||
| ASSERT_THAT(NonExtensions, testing::ContainerEq(NonExtensionsExpected)); | ||
| std::vector<StringRef> Features; | ||
| Extensions.toLLVMFeatureList(Features); | ||
| std::vector<StringRef> FeaturesExpected = {"+sve2", "+neon", "-sve"}; | ||
| ASSERT_THAT(FeaturesExpected, testing::ContainerEq(FeaturesExpected)); | ||
MatzeB marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| AArch64ExtensionDependenciesBaseArchTestParams | ||
| AArch64ExtensionDependenciesArchData[] = { | ||
| // Base architecture features | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.