Skip to content

Commit

Permalink
[MLIR][Bufferizer][NFC] Simplify some codes. (llvm#77254)
Browse files Browse the repository at this point in the history
NFC. clean up.
  • Loading branch information
javedabsar1 authored Jan 8, 2024
1 parent 442f67c commit 0ba868d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void BufferViewFlowAnalysis::rename(Value from, Value to) {
dependencies[to] = dependencies[from];
dependencies.erase(from);

for (auto &[key, value] : dependencies) {
for (auto &[_, value] : dependencies) {
if (value.contains(from)) {
value.insert(to);
value.erase(from);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,9 @@ neededValuesDominateInsertionPoint(const DominanceInfo &domInfo,
static bool insertionPointDominatesUses(const DominanceInfo &domInfo,
Operation *insertionPoint,
Operation *emptyTensorOp) {
for (Operation *user : emptyTensorOp->getUsers())
if (!domInfo.dominates(insertionPoint, user))
return false;
return true;
return llvm::all_of(emptyTensorOp->getUsers(), [&](Operation *user) {
return domInfo.dominates(insertionPoint, user);
});
}

/// Find a valid insertion point for a replacement of `emptyTensorOp`, assuming
Expand Down

0 comments on commit 0ba868d

Please sign in to comment.