[Mlir-commits] [mlir] Refactor LoopFuseSiblingOp and support parallel fusion (PR #94391)

Oleksandr Alex Zinenko llvmlistbot at llvm.org
Wed Jun 26 10:05:55 PDT 2024


================
@@ -57,4 +57,24 @@ class HasParallelRegion : public TraitBase<ConcreteType, HasParallelRegion> {
 /// Include the generated interface declarations.
 #include "mlir/Interfaces/LoopLikeInterface.h.inc"
 
+namespace mlir {
+/// A function that rewrites `target`'s terminator as a teminator obtained by
+/// fusing `source` into `target`.
+using FuseTerminatorFn =
+    std::function<void(RewriterBase &rewriter, LoopLikeOpInterface source,
----------------
ftynse wrote:

If the function reference doesn't need to outlive the function it is passed into, use `function_ref`. This avoids a dynamic allocation.

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


More information about the Mlir-commits mailing list