diff options
Diffstat (limited to 'mlir/lib/Transforms/Utils/RegionUtils.cpp')
-rw-r--r-- | mlir/lib/Transforms/Utils/RegionUtils.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mlir/lib/Transforms/Utils/RegionUtils.cpp b/mlir/lib/Transforms/Utils/RegionUtils.cpp index 78bb609b..162091c 100644 --- a/mlir/lib/Transforms/Utils/RegionUtils.cpp +++ b/mlir/lib/Transforms/Utils/RegionUtils.cpp @@ -12,6 +12,7 @@ #include "mlir/IR/RegionGraphTraits.h" #include "mlir/IR/Value.h" #include "mlir/Interfaces/ControlFlowInterfaces.h" +#include "mlir/Interfaces/SideEffects.h" #include "llvm/ADT/DepthFirstIterator.h" #include "llvm/ADT/PostOrderIterator.h" @@ -196,9 +197,8 @@ static bool isOpIntrinsicallyLive(Operation *op) { if (!op->isKnownNonTerminator()) return true; // If the op has a side effect, we treat it as live. - if (!op->hasNoSideEffect()) - return true; - return false; + // TODO: Properly handle region side effects. + return !MemoryEffectOpInterface::hasNoEffect(op) || op->getNumRegions() != 0; } static void propagateLiveness(Region ®ion, LiveMap &liveMap); |