[Mlir-commits] [mlir] [milr][gpu] Make barrier elimination address-space aware (PR #178101)

Jakub Kuderski llvmlistbot at llvm.org
Tue Jan 27 07:32:15 PST 2026


================
@@ -78,14 +78,121 @@ static void addAllValuelessEffects(
   effects.emplace_back(MemoryEffects::Effect::get<MemoryEffects::Free>());
 }
 
+/// Looks through known "view-like" ops to find the base memref.
+static Value getBase(Value v) {
+  while (true) {
+    Operation *definingOp = v.getDefiningOp();
+    if (!definingOp)
+      break;
+
+    bool shouldContinue = TypeSwitch<Operation *, bool>(v.getDefiningOp())
+                              .Case<ViewLikeOpInterface>([&](auto op) {
+                                v = op.getViewSource();
+                                return true;
+                              })
+                              .Case<memref::TransposeOp>([&](auto op) {
----------------
kuhar wrote:

```suggestion
                              .Case([&](ViewLikeOpInterface op) {
                                v = op.getViewSource();
                                return true;
                              })
                              .Case([&](memref::TransposeOp op) {
```

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


More information about the Mlir-commits mailing list