[Mlir-commits] [mlir] [mlir][GPU] Add builders to allow passing in integer `upper_bound`s (PR #114252)

Petr Kurapov llvmlistbot at llvm.org
Wed Oct 30 11:16:54 PDT 2024


================
@@ -74,7 +74,20 @@ class GPU_IndexOp<string mnemonic, list<Trait> traits = []> :
     }]>,
     OpBuilder<(ins "::mlir::Type":$resultType, "::mlir::gpu::Dimension":$dimension), [{
       build($_builder, $_state, resultType, dimension, /*upperBound=*/nullptr);
+    }]>,
+    OpBuilder<(ins "::mlir::gpu::Dimension":$dimension, "std::optional<int64_t>":$upperBound), [{
----------------
kurapov-peter wrote:

I also don't get what convenience does it bring. Why would you demand a nullopt when there can be two builders: with and without the attribute/whatever? Or if we want a single builder - a default value.

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


More information about the Mlir-commits mailing list