[Mlir-commits] [mlir] [MLIR][ODS][NVVM] Add EnumAttrIsOneOf/IsNoneOf constraints and use them in NVVM fence ops (PR #182662)

Rajat Bajpai llvmlistbot at llvm.org
Mon Feb 23 23:53:44 PST 2026


================
@@ -750,4 +750,21 @@ class ConstantEnumCase<Attr attribute, string case>
     "attribute must be one of 'EnumAttr' or 'EnumInfo'";
 }
 
+/// Attribute constraint restricting the enum attribute to a subset of allowed
+/// cases. `enumAttr` is the `EnumAttr` attribute and `allowedCases` is a list
+/// of `EnumCase`s that are permitted.
+///
+/// Example:
+/// ```
+/// ConfinedAttr<MyEnumAttr, [EnumAttrIsOneOf<MyEnumAttr, [CaseA, CaseB]>]>
+/// ```
+class EnumAttrIsOneOf<EnumAttr enumAttr, list<EnumCase> allowedCases>
----------------
rajatbajpai wrote:

Sure, added in the latest revision with small motivating example.

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


More information about the Mlir-commits mailing list