Skip to content

Partially revert "[mlir][NVVM] Add constant memory space identifier" #111169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 4, 2024

Conversation

dklimkin
Copy link
Member

@dklimkin dklimkin commented Oct 4, 2024

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

…lvm#111141)

The second part of the change introduced circular dependency between LLVMDialect and BasicPtxBuilderInterface.
@dklimkin dklimkin requested a review from grypp as a code owner October 4, 2024 14:48
@dklimkin dklimkin requested review from matthias-springer and removed request for grypp October 4, 2024 14:48
@llvmbot
Copy link
Member

llvmbot commented Oct 4, 2024

@llvm/pr-subscribers-mlir-llvm

@llvm/pr-subscribers-mlir

Author: Danial Klimkin (dklimkin)

Changes

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

@dklimkin dklimkin changed the title Partially revert "[mlir][NVVM] Add constant memory space identifier (#111141)" Partially revert "[mlir][NVVM] Add constant memory space identifier" Oct 4, 2024
@dklimkin
Copy link
Member Author

dklimkin commented Oct 4, 2024

https://buildkite.com/llvm-project/upstream-bazel/builds/112567#019257b3-a062-4ea5-a6d5-e41469ca5055

    @@llvm-project//mlir:BasicPtxBuilderInterface (ccbefc8b2e2900f51345b35211e15a5555c9071718feb222721d0da47fc335fd)
.-> @@llvm-project//mlir:BasicPtxBuilderInterface (d338a3ecd0023e40be049a609bc260c8de25852681e63cddc3bab9e8ceae2ce1)
|   @@llvm-project//mlir:NVVMDialect (d338a3ecd0023e40be049a609bc260c8de25852681e63cddc3bab9e8ceae2ce1)
`-- @@llvm-project//mlir:BasicPtxBuilderInterface (d338a3ecd0023e40be049a609bc260c8de25852681e63cddc3bab9e8ceae2ce1)

@dklimkin dklimkin merged commit 19992ee into llvm:main Oct 4, 2024
9 of 10 checks passed
@dklimkin dklimkin deleted the fix branch October 4, 2024 15:03
@bjacob
Copy link
Contributor

bjacob commented Oct 4, 2024

@dklimkin , I didn't see this and fixed it in a different way by fusing these two Bazel targets in #111172. Hopefully, this unblocks re-landing the commit that was reverted here.

@bjacob
Copy link
Contributor

bjacob commented Oct 4, 2024

FYI @matthias-springer

@joker-eph
Copy link
Collaborator

@dklimkin this kind of Bazel issues are most of the time false dependencies, to be fixed in Bazel instead of changing the code.

Thanks @bjacob for the follow up!

@dklimkin
Copy link
Member Author

@joker-eph well, I did try removing dep to see if it's real, the same way @bjacob did. Generally, the fly-by change was not needed for "Add constant memory space identifier".

Thanks for addressing this, Benoit.

@joker-eph
Copy link
Collaborator

@dklimkin I don't understand what you mean? What didn't work in " I did try removing dep to see if it's real, the same way @bjacob did" that led to changing the code here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants