[Mlir-commits] [mlir] [mlir][affine]introduce AffineSymbol trait and use it for using gpu.threadid op in the inner loops. (PR #118478)

Uday Bondhugula llvmlistbot at llvm.org
Sat Jan 11 14:19:31 PST 2025


================
@@ -1268,6 +1269,16 @@ class AffineScope : public TraitBase<ConcreteType, AffineScope> {
   }
 };
 
+/// A trait of operation. Any operation holds the AffineSymbol, and its result
+/// can be used as a symbol.
----------------
bondhugula wrote:

The question of why something specific to the affine dialect and analysis is in `OpDefinition.h` would arise. Ideally, traits are something that are very core to the `Operation`. OTOH, this property should ideally be an `Interface`, i.e., simply create an `AffineSymbolInterface` under `lib/Interfaces/` for this. You can then do: `isa<AffineSymbolInterface>(...)` instead of `hasTrait<...>`. However, it won't have verifiers then.

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


More information about the Mlir-commits mailing list