[Mlir-commits] [mlir] Partially revert "[mlir][NVVM] Add constant memory space identifier (#111141)" (PR #111169)

Danial Klimkin llvmlistbot at llvm.org
Fri Oct 4 07:48:35 PDT 2024


https://github.com/dklimkin created https://github.com/llvm/llvm-project/pull/111169


The second part of the change introduced circular dependency between LLVMDialect and BasicPtxBuilderInterface.

>From 6ab73c372e6649ae2be524ec22c55af1910f81f5 Mon Sep 17 00:00:00 2001
From: Danial Klimkin <dklimkin at google.com>
Date: Fri, 4 Oct 2024 16:46:23 +0200
Subject: [PATCH] Partially revert "[mlir][NVVM] Add constant memory space
 identifier (#111141)

The second part of the change introduced circular dependency between LLVMDialect and BasicPtxBuilderInterface.
---
 mlir/lib/Dialect/LLVMIR/IR/BasicPtxBuilderInterface.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/mlir/lib/Dialect/LLVMIR/IR/BasicPtxBuilderInterface.cpp b/mlir/lib/Dialect/LLVMIR/IR/BasicPtxBuilderInterface.cpp
index d181700f757a5b..b109f00c3da13a 100644
--- a/mlir/lib/Dialect/LLVMIR/IR/BasicPtxBuilderInterface.cpp
+++ b/mlir/lib/Dialect/LLVMIR/IR/BasicPtxBuilderInterface.cpp
@@ -12,7 +12,6 @@
 //===----------------------------------------------------------------------===//
 
 #include "mlir/Dialect/LLVMIR/BasicPtxBuilderInterface.h"
-#include "mlir/Dialect/LLVMIR/NVVMDialect.h"
 
 #define DEBUG_TYPE "ptx-builder"
 #define DBGS() (llvm::dbgs() << "[" DEBUG_TYPE "]: ")
@@ -27,6 +26,8 @@
 using namespace mlir;
 using namespace NVVM;
 
+static constexpr int64_t kSharedMemorySpace = 3;
+
 static char getRegisterType(Type type) {
   if (type.isInteger(1))
     return 'b';
@@ -42,7 +43,7 @@ static char getRegisterType(Type type) {
     return 'd';
   if (auto ptr = dyn_cast<LLVM::LLVMPointerType>(type)) {
     // Shared address spaces is addressed with 32-bit pointers.
-    if (ptr.getAddressSpace() == NVVMMemorySpace::kSharedMemorySpace) {
+    if (ptr.getAddressSpace() == kSharedMemorySpace) {
       return 'r';
     }
     return 'l';



More information about the Mlir-commits mailing list