diff options
Diffstat (limited to 'mlir/lib/Transforms/Utils')
| -rw-r--r-- | mlir/lib/Transforms/Utils/Utils.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/mlir/lib/Transforms/Utils/Utils.cpp b/mlir/lib/Transforms/Utils/Utils.cpp index 41689be52fc..519885b3a50 100644 --- a/mlir/lib/Transforms/Utils/Utils.cpp +++ b/mlir/lib/Transforms/Utils/Utils.cpp @@ -91,6 +91,11 @@ bool mlir::replaceAllMemRefUsesWith(const Value *oldMemRef, Value *newMemRef, !postDomInfo->postDominates(postDomInstFilter, opInst)) continue; + // Skip dealloc's - no replacement is necessary, and a replacement doesn't + // hurt dealloc's. + if (opInst->isa<DeallocOp>()) + continue; + // Check if the memref was used in a non-deferencing context. It is fine for // the memref to be used in a non-deferencing way outside of the region // where this replacement is happening. |

