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

lonely eagle llvmlistbot at llvm.org
Wed Jan 15 17:43:48 PST 2025


linuxlonelyeagle wrote:

> > I designed AffineSymbol at the beginning by referring to constant's properties for design.
> > 1.The ops should be pure.
> 
> But `gpu.thread_id` not pure! It's not marked so.
> 
> > 2.Yes.
> > 3.Yes.
> 
> Why can't an `AffineSymbol` trait op as proposed here be allowed to have operands which are also in turn valid affine symbols? Can we generalize/extend this?
> 
> If "zero operand" is a hard implied property, the trait verifier should be checking for it, but it isn't in the PR.

the thread_id is indeed marked as pure. I roughly understand what you mean above. Let me ask you again about the concepts of Affine dimensions and symbols. In other words, pure Op + symbol operands, the resulting ssa value is also a symbol.pure Op + dimensional operands, the obtained ssa value is dimensional ssa value.So what does pure op + symbol and dimensional ssa value get?


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


More information about the Mlir-commits mailing list