Skip to content

Commit 282ea28

Browse files
authored
[mlir][nvvm] Fix circular dependency in (#68934)
BasicPtxBuilder includes NVVMDialect and vice versa. Cmake appereantly forgives that, but this causes bazel build fails. This PR aims to fix that
1 parent 46cb8d9 commit 282ea28

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
#include "mlir/Support/LogicalResult.h"
1716

1817
#define DEBUG_TYPE "ptx-builder"
@@ -28,6 +27,8 @@
2827
using namespace mlir;
2928
using namespace NVVM;
3029

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

0 commit comments

Comments
 (0)