[llvm] [AMDGPU] Sort features by name, add feature-name parsing (PR #220102)

Krzysztof Drewniak via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 2 08:24:13 PDT 2026


================
@@ -185,6 +185,17 @@ LLVM_ABI const AMDGPUFeatureBitset &getFeatureBitset(GPUKind AK);
 LLVM_ABI void getFeatureNames(const AMDGPUFeatureBitset &Features,
                               SmallVectorImpl<StringRef> &Names);
 
+/// Returns the feature bit named \p Name (e.g. "dot1-insts"), or nullopt if it
+/// is not a frontend-visible feature. This is the inverse of getFeatureNames.
+LLVM_ABI std::optional<AMDGPUFeature> parseFeature(StringRef Name);
+
+/// Applies a comma-separated list of "+feature"/"-feature" modifiers (an
+/// -mattr-style string) to \p Features. Returns the offending entry if one is
+/// missing its +/- prefix or names an unknown feature, in which case the
+/// preceding entries have already been applied; returns nullopt on success.
----------------
krzysz00 wrote:

I don't know if our MC propagates implies. I suspect it might not

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


More information about the llvm-commits mailing list