9 #ifndef MLIR_TRANSFORMS_LOOPINVARIANTCODEMOTIONUTILS_H
10 #define MLIR_TRANSFORMS_LOOPINVARIANTCODEMOTIONUTILS_H
14 #include "llvm/ADT/SmallVector.h"
18 class LoopLikeOpInterface;
66 ArrayRef<Region *> regions,
67 function_ref<
bool(Value, Region *)> isDefinedOutsideRegion,
68 function_ref<
bool(Operation *, Region *)> shouldMoveOutOfRegion,
69 function_ref<
void(Operation *, Region *)> moveOutOfRegion);
113 LoopLikeOpInterface loopLike);
Include the generated interface declarations.
llvm::function_ref< Fn > function_ref
LoopLikeOpInterface hoistLoopInvariantSubsets(RewriterBase &rewriter, LoopLikeOpInterface loopLike)
Hoist loop-invariant tensor subsets (subset extraction and subset insertion ops) from loop-like ops.
size_t moveLoopInvariantCode(ArrayRef< Region * > regions, function_ref< bool(Value, Region *)> isDefinedOutsideRegion, function_ref< bool(Operation *, Region *)> shouldMoveOutOfRegion, function_ref< void(Operation *, Region *)> moveOutOfRegion)
Given a list of regions, perform loop-invariant code motion.