[Mlir-commits] [mlir] [MLIR][SideEffects] Added 'Init' Memory Effect which defines an Idempotent MemWrite effect and modified LICM pass (PR #153281)
Mo Bagherbeik
llvmlistbot at llvm.org
Wed Aug 13 14:11:29 PDT 2025
================
@@ -110,7 +110,7 @@ size_t mlir::moveLoopInvariantCode(LoopLikeOpInterface loopLike) {
return loopLike.isDefinedOutsideOfLoop(value);
},
[&](Operation *op, Region *) {
- return isMemoryEffectFree(op) && isSpeculatable(op);
+ return isMemoryEffectMovable(op) && isSpeculatable(op);
----------------
mbagherbeikTT wrote:
It is relatively expensive. It's similar to isMemoryEffectFree() when checking an op with HasRecursiveMemoryEffects. The difference is, when checking each op, isMemoryEffectMovable() goes up to the op's parent region before recursing down. There are ways to reduce redundant recursions down to already checked regions at the cost of maintaining some extra data during the pass.
https://github.com/llvm/llvm-project/pull/153281
More information about the Mlir-commits
mailing list