[Mlir-commits] [mlir] 19992ee - Partially revert "[mlir][NVVM] Add constant memory space identifier" (#111169)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Fri Oct 4 08:03:47 PDT 2024
Author: Danial Klimkin
Date: 2024-10-04T17:03:43+02:00
New Revision: 19992eea2300f1e97a71013b50f582538cad5022
URL: https://github.com/llvm/llvm-project/commit/19992eea2300f1e97a71013b50f582538cad5022
DIFF: https://github.com/llvm/llvm-project/commit/19992eea2300f1e97a71013b50f582538cad5022.diff
LOG: Partially revert "[mlir][NVVM] Add constant memory space identifier" (#111169)
The second part of the change introduced circular dependency between
LLVMDialect and BasicPtxBuilderInterface.
Added:
Modified:
mlir/lib/Dialect/LLVMIR/IR/BasicPtxBuilderInterface.cpp
Removed:
################################################################################
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