[Mlir-commits] [mlir] [mlir][NVVM] Add InferTypeOpInterface to sync and ldmatrix ops (PR #188238)

Pradeep Kumar llvmlistbot at llvm.org
Tue Mar 24 06:51:24 PDT 2026


================
@@ -2450,6 +2465,26 @@ LogicalResult NVVM::LdMatrixOp::verify() {
   return success();
 }
 
+LogicalResult LdMatrixOp::inferReturnTypes(
+    MLIRContext *context, std::optional<Location> location,
+    LdMatrixOp::Adaptor adaptor,
+    SmallVectorImpl<Type> &inferredReturnTypes) {
+  uint32_t num = adaptor.getNum();
+  uint32_t m = adaptor.getShape().getM();
+  uint32_t n = adaptor.getShape().getN();
+  uint32_t numElements = (m == 16 && n == 16) ? num * 2 : num;
+
+  Type i32 = IntegerType::get(context, 32);
+  if (numElements == 1) {
----------------
schwarzschild-radius wrote:

To be consistent, maybe we can remove the braces around if and else as they have only one statement each

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


More information about the Mlir-commits mailing list