Skip to content

Commit 19992ee

Browse files
authored
Partially revert "[mlir][NVVM] Add constant memory space identifier" (llvm#111169)
The second part of the change introduced circular dependency between LLVMDialect and BasicPtxBuilderInterface.
1 parent ed59d57 commit 19992ee

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mlir/lib/Dialect/LLVMIR/IR/BasicPtxBuilderInterface.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
//===----------------------------------------------------------------------===//
1313

1414
#include "mlir/Dialect/LLVMIR/BasicPtxBuilderInterface.h"
15-
#include "mlir/Dialect/LLVMIR/NVVMDialect.h"
1615

1716
#define DEBUG_TYPE "ptx-builder"
1817
#define DBGS() (llvm::dbgs() << "[" DEBUG_TYPE "]: ")
@@ -27,6 +26,8 @@
2726
using namespace mlir;
2827
using namespace NVVM;
2928

29+
static constexpr int64_t kSharedMemorySpace = 3;
30+
3031
static char getRegisterType(Type type) {
3132
if (type.isInteger(1))
3233
return 'b';
@@ -42,7 +43,7 @@ static char getRegisterType(Type type) {
4243
return 'd';
4344
if (auto ptr = dyn_cast<LLVM::LLVMPointerType>(type)) {
4445
// Shared address spaces is addressed with 32-bit pointers.
45-
if (ptr.getAddressSpace() == NVVMMemorySpace::kSharedMemorySpace) {
46+
if (ptr.getAddressSpace() == kSharedMemorySpace) {
4647
return 'r';
4748
}
4849
return 'l';

0 commit comments

Comments
 (0)