[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:32:27 PDT 2025


================
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -triple aarch64-- -target-feature +neon -target-feature +sve\
+// RUN:   -target-feature -sve -emit-llvm %s -o - | FileCheck %s
+
+// Reproducer for bug where clang would reject always_inline for unrelated
+// target features if they were disable with `-feature` on the command line.
+// CHECK: @bar
+__attribute__((always_inline)) __attribute__((target("neon"))) void foo() {}
----------------
tmatheson-arm wrote:

That's true, but the header shouldn't be doing that. `neon` is the LLVM subtarget feature name which shouldn't be exposed to the user, `simd` is the user-facing name that is used on the command line with `-march`. `target` attribute parameters should match the command line, but historically it accepts any LLVM subtarget feature, which we are trying to clean up. Because `neon` is used here rather than `simd`, I believe it is not recognised as an extension and just gets passed through to LLVM as-is, and therefore takes a different codepath.

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


More information about the llvm-commits mailing list