[Mlir-commits] [mlir] [mlir][gpu] Eliminate redundant gpu.barrier ops (PR #71575)

Lei Zhang llvmlistbot at llvm.org
Tue Nov 7 13:25:09 PST 2023


================
@@ -1139,6 +1139,34 @@ void ShuffleOp::build(OpBuilder &builder, OperationState &result, Value value,
         mode);
 }
 
+//===----------------------------------------------------------------------===//
+// BarrierOp
+//===----------------------------------------------------------------------===//
+
+namespace {
+
+/// Remove gpu.barrier after gpu.barrier, the threads are already synchronized!
+struct EraseRedundantGpuBarrierOpPairs : public OpRewritePattern<BarrierOp> {
----------------
antiagainst wrote:

There is a simpler way to write this to avoid all the boilerplate. See https://github.com/llvm/llvm-project/commit/7897a944d9e72d79f38a443afffbbfd1accfe4ad as an example.

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


More information about the Mlir-commits mailing list