[Mlir-commits] [mlir] [mlir][affine]Introduce AffineSymbol trait and use it for gpu.threadid op (PR #118478)

lonely eagle llvmlistbot at llvm.org
Wed Jan 8 01:20:39 PST 2025


linuxlonelyeagle wrote:

> Extensibility like this appears welcome. Here are a few quick things to think about while on this (some of these may be side-issues/open questions):
> 
> 1. Are ops with AffineSymbol trait always also side-effect-free/pure?
> 2. Can such ops always be canonicalized to be placed at (or hoisted to) the top-level of an `AffineScope`?
> 3. Will (and should) such ops always have zero operands?
> 
> E.g. arith.constant satisfies all of the above properties

I designed AffineSymbol at the beginning by referring to constant's properties for design.
1.The ops should be pure.
2.Yes.
3.Yes.
It seems to me that AffineSymbol is just a convenient way to tell if it's a valid symbol.The key is that the Op with this Trait attached is itself a valid Symbol.
I have modified the content you mentioned in the document.Thank you.

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


More information about the Mlir-commits mailing list