[llvm] [AMDGPU][NFC] Allow selected generic features on any covered GPU (PR #223177)

Shilei Tian via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 16 10:51:26 PDT 2026


================
@@ -6,21 +6,30 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// TargetParser metadata attached to processor records for the
-// -gen-amdgpu-target-def backend.
+// TargetParser metadata for the -gen-amdgpu-target-def backend.
 //
 //===----------------------------------------------------------------------===//
 
+// A generic target may use this feature if at least one covered GPU has it.
+// These features participate in validation even when not frontend-visible.
+// Other frontend-visible features must be present on every covered GPU.
+// Implied features are checked according to their own classes.
+// This checks feature membership, not numeric ordering of feature values.
+class AMDGPUGenericAnyFeature<string name, string fieldName, string value,
+                             string description,
+                             list<SubtargetFeature> implies = [],
+                             InlineBehavior ib = InlineDefault>
+    : SubtargetFeature<name, fieldName, value, description, implies, ib>;
+
 // Marks a Processor/ProcessorModel record as a canonical GPU.
 //
 // \p isa is the ISA version [major, minor, stepping]. Empty for R600 (no AMDGCN
 // ISA version); required for AMDGCN GPUs. Not derivable from the name.
 class AMDGPUGPUInfo<list<int> isa = []> {
   list<int> IsaVersion = isa;
 
-  // List of targets which are compatible with this target. This
-  // should be used for a "gfxN-generic" targets only, and empty for
-  // individual GPUs.
+  // Nonempty list of concrete AMDGPU GPUs compatible with a "gfxN-generic"
----------------
shiltian wrote:

This seems contradicting: it first says this is a non-empty list, and then later says, empty for ...

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


More information about the llvm-commits mailing list