[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
Sun Jan 12 01:14:54 PST 2025


================
@@ -1390,6 +1390,14 @@ LogicalResult OpTrait::impl::verifyIsIsolatedFromAbove(Operation *isolatedOp) {
   return success();
 }
 
+LogicalResult OpTrait::impl::verifyIndexResultType(Operation *op) {
+  if (op->getNumResults() != 1)
+    op->emitError("operation's result number should be 1.");
+  if (!mlir::isa<IndexType>(op->getResult(0).getType()))
+    op->emitError("operation's result type should be index.");
----------------
linuxlonelyeagle wrote:

Honestly, I don't know how to write this test, hahahahaha, I can't seem to find a trait for op hold, other than threadid, and the key problem is that it seems to require a change to the definition of op in the ods. Or is it possible to specify the trait of the op in IR and then use it.

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


More information about the Mlir-commits mailing list