[Mlir-commits] [mlir] [mlir][NVVM] Add InferTypeOpInterface to NVVM ops with deterministic result types (PR #188173)

Durgadoss R llvmlistbot at llvm.org
Wed Mar 25 06:32:53 PDT 2026


================
@@ -302,6 +302,84 @@ LogicalResult MBarrierArriveDropExpectTxOp::verify() {
                                     getRes());
 }
 
+//===----------------------------------------------------------------------===//
+// inferReturnTypes for mbarrier arrive-like ops
+//===----------------------------------------------------------------------===//
+
+/// Only shared_cluster (ptr<7>) produces zero results; all other address
+/// spaces (including generic) return i64.
+static LogicalResult
+inferMBarrierArriveResultTypes(MLIRContext *context, Value addr,
+                               SmallVectorImpl<Type> &inferredReturnTypes) {
+  auto ptrTy = llvm::cast<LLVM::LLVMPointerType>(addr.getType());
+  if (ptrTy.getAddressSpace() !=
+      static_cast<unsigned>(NVVMMemorySpace::SharedCluster))
----------------
durga4github wrote:

nit: I think we have a few utilities at the top of this file to help with the address-space checks.

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


More information about the Mlir-commits mailing list