[Mlir-commits] [mlir] [mlir][gpu] Add field to mark asynchronous side effects (PR #72013)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Fri Nov 10 19:18:21 PST 2023


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 00c3c731893ca88a3f8add63260751a9e36babb6 b98403c1aed8eeac863309d2d45b8625446973e2 -- mlir/include/mlir/Interfaces/SideEffectInterfaces.h mlir/include/mlir/TableGen/SideEffects.h mlir/lib/Dialect/GPU/Transforms/EliminateBarriers.cpp mlir/lib/TableGen/SideEffects.cpp mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/mlir/include/mlir/Interfaces/SideEffectInterfaces.h b/mlir/include/mlir/Interfaces/SideEffectInterfaces.h
index 9bd23fb4f18a..1a252248a6e2 100644
--- a/mlir/include/mlir/Interfaces/SideEffectInterfaces.h
+++ b/mlir/include/mlir/Interfaces/SideEffectInterfaces.h
@@ -141,8 +141,8 @@ public:
   EffectInstance(EffectT *effect, Resource *resource = DefaultResource::get())
       : effect(effect), resource(resource), stage(0),
         effectOnFullRegion(false) {}
-  EffectInstance(EffectT *effect, int stage, bool effectOnFullRegion, bool async,
-                 Resource *resource = DefaultResource::get())
+  EffectInstance(EffectT *effect, int stage, bool effectOnFullRegion,
+                 bool async, Resource *resource = DefaultResource::get())
       : effect(effect), resource(resource), stage(stage),
         effectOnFullRegion(effectOnFullRegion), asynchronous(async) {}
   EffectInstance(EffectT *effect, Value value,
diff --git a/mlir/lib/Dialect/GPU/Transforms/EliminateBarriers.cpp b/mlir/lib/Dialect/GPU/Transforms/EliminateBarriers.cpp
index b1d2f0d67687..d6524c682a15 100644
--- a/mlir/lib/Dialect/GPU/Transforms/EliminateBarriers.cpp
+++ b/mlir/lib/Dialect/GPU/Transforms/EliminateBarriers.cpp
@@ -522,7 +522,8 @@ haveConflictingEffects(ArrayRef<MemoryEffects::EffectInstance> beforeEffects,
     // Before may conflict with after, but since it is async, a BarrierOp cannot
     // synchronize the effects. If the async field is set, it is presumed that
     // some architecture-specific mechanism is needed to synchronize the effect.
-    if (before.getAsynchronous()) continue;
+    if (before.getAsynchronous())
+      continue;
 
     for (const MemoryEffects::EffectInstance &after : afterEffects) {
       // If cannot alias, definitely no conflict.

``````````

</details>


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


More information about the Mlir-commits mailing list