1//===- LoopExtensionOps.cpp - Loop extension for the Transform dialect ----===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#include "mlir/Dialect/Transform/LoopExtension/LoopExtensionOps.h"
10
11#include "mlir/Transforms/LoopInvariantCodeMotionUtils.h"
12
13using namespace mlir;
14
15#define GET_OP_CLASSES
16#include "mlir/Dialect/Transform/LoopExtension/LoopExtensionOps.cpp.inc"
17
18//===----------------------------------------------------------------------===//
19// HoistLoopInvariantSubsetsOp
20//===----------------------------------------------------------------------===//
21
22DiagnosedSilenceableFailure transform::HoistLoopInvariantSubsetsOp::applyToOne(
23 transform::TransformRewriter &rewriter, LoopLikeOpInterface loopLikeOp,
24 transform::ApplyToEachResultList &results,
25 transform::TransformState &state) {
26 hoistLoopInvariantSubsets(rewriter, loopLike: loopLikeOp);
27 return DiagnosedSilenceableFailure::success();
28}
29
30void transform::HoistLoopInvariantSubsetsOp::getEffects(
31 SmallVectorImpl<MemoryEffects::EffectInstance> &effects) {
32 transform::onlyReadsHandle(handles: getTargetMutable(), effects);
33 transform::modifiesPayload(effects);
34}
35

source code of mlir/lib/Dialect/Transform/LoopExtension/LoopExtensionOps.cpp