MLIR  16.0.0git
Macros | Functions
LoopInvariantCodeMotionUtils.cpp File Reference
#include "mlir/Transforms/LoopInvariantCodeMotionUtils.h"
#include "mlir/IR/Operation.h"
#include "mlir/Interfaces/LoopLikeInterface.h"
#include "mlir/Interfaces/SideEffectInterfaces.h"
#include "llvm/Support/Debug.h"
#include <queue>
+ Include dependency graph for LoopInvariantCodeMotionUtils.cpp:

Go to the source code of this file.


#define DEBUG_TYPE   "licm"


static bool canBeHoisted (Operation *op, function_ref< bool(Value)> definedOutside)
 Checks whether the given op can be hoisted by checking that. More...

Macro Definition Documentation


#define DEBUG_TYPE   "licm"

Definition at line 20 of file LoopInvariantCodeMotionUtils.cpp.

Function Documentation

◆ canBeHoisted()

static bool canBeHoisted ( Operation op,
function_ref< bool(Value)>  definedOutside 

Checks whether the given op can be hoisted by checking that.

  • the op and none of its contained operations depend on values inside of the loop (by means of calling definedOutside).
  • the op has no side-effects.

Definition at line 28 of file LoopInvariantCodeMotionUtils.cpp.

References mlir::WalkResult::advance(), mlir::Operation::hasTrait(), mlir::WalkResult::interrupt(), mlir::Operation::isAncestor(), and mlir::Operation::walk().

Referenced by mlir::moveLoopInvariantCode().