[Mlir-commits] [mlir] [mlir][transform] LISH: Add transform op (PR #70630)

Matthias Springer llvmlistbot at llvm.org
Mon Oct 30 03:18:56 PDT 2023


================
@@ -1395,6 +1395,26 @@ transform::GetTypeOp::apply(transform::TransformRewriter &rewriter,
   return DiagnosedSilenceableFailure::success();
 }
 
+//===----------------------------------------------------------------------===//
+// HoistLoopInvariantSubsetsOp
+//===----------------------------------------------------------------------===//
+
+DiagnosedSilenceableFailure transform::HoistLoopInvariantSubsetsOp::applyToOne(
+    transform::TransformRewriter &rewriter, Operation *target,
+    transform::ApplyToEachResultList &results,
+    transform::TransformState &state) {
+  target->walk([&](LoopLikeOpInterface loopLike) {
+    (void)hoistLoopInvariantSubsets(rewriter, loopLike);
----------------
matthias-springer wrote:

`hoistLoopInvariantSubsets` returns a `LoopLikeOpInterface` op. In case nothing was hoisted, the same op is returned. That does not necessarily mean that something went wrong, it could just be that there was nothing to hoist. (There is currently no failure that can happen.)

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


More information about the Mlir-commits mailing list