[Mlir-commits] [mlir] [mlir] Made DefaultResource the root of memory resource hierarchy. (PR #187423)

Slava Zakharin llvmlistbot at llvm.org
Fri Mar 20 09:10:36 PDT 2026


================
@@ -224,10 +224,18 @@ bool CSEDriver::hasOtherSideEffectingOpInBetween(Operation *fromOp,
       if (isa<MemoryEffects::Write>(effect.getEffect())) {
         // A write on a resource disjoint from all read resources cannot
         // conflict with the reads being CSE'd.
-        auto *writeResource = effect.getResource();
-        bool canConflict = llvm::any_of(readResources, [&](auto *readResource) {
-          return !writeResource->isDisjointFrom(readResource);
-        });
+        SideEffects::Resource *writeResource = effect.getResource();
+        bool canConflict =
+            llvm::any_of(readEffects, [&](const auto &readEffect) {
+              SideEffects::Resource *readResource = readEffect.getResource();
+              if (writeResource->isDisjointFrom(readResource))
+                return false;
+              // A pointer-based access to an addressable resource cannot
----------------
vzakhari wrote:

I used `pointer-based` in the initial PR [here](https://github.com/llvm/llvm-project/pull/181229/changes#diff-48d9c257fae41bcc433425437f999382676b084b9046de1fd1f004e349065d9a), but I agree that `pointer` term might be overloaded. Unfortunately, I do not have a better word for this :)

I think I used term `value-based` in some early discussion, and I believe people also did no like it. I am open to any suggestions.

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


More information about the Mlir-commits mailing list