[clang] [llvm] [AArch64TargetParser]Fix reconstructFromParsedFeatures ignoring negative features (PR #142236)

Tomas Matheson via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 9 02:36:44 PDT 2025


================
@@ -1831,6 +1831,22 @@ TEST_P(AArch64ExtensionDependenciesBaseCPUTestFixture,
   }
 }
 
+TEST(TargetParserTest, testAArch64ReconstructFromParsedFeatures) {
+  AArch64::ExtensionSet Extensions;
+  std::vector<std::string> FeatureOptions = {
+      "-sve2", "-Baz", "+sve", "+FooBar", "+sve2", "+neon", "-sve",
----------------
tmatheson-arm wrote:

I think the original intention was for it to be able to handle _either_ positive (added to the `ExtensionSet` without dependencies) or negative (marked as "touched" on the `ExtensionSet`) for a given feature, but not see both of them in the same list. As @labrinea pointed out though the code is not perfect, the negative branch looks dead since `targetFeatureToExtension` doesn't handle negative features.

https://github.com/llvm/llvm-project/pull/142236


More information about the llvm-commits mailing list