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

llvmlistbot at llvm.org llvmlistbot at llvm.org
Fri Oct 4 07:49:11 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-mlir

Author: Danial Klimkin (dklimkin)

<details>
<summary>Changes</summary>


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

---
Full diff: https://github.com/llvm/llvm-project/pull/111169.diff


1 Files Affected:

- (modified) mlir/lib/Dialect/LLVMIR/IR/BasicPtxBuilderInterface.cpp (+3-2) 


``````````diff
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';

``````````

</details>


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


More information about the Mlir-commits mailing list