diff options
author | Kazu Hirata <kazu@google.com> | 2024-10-14 06:55:30 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-14 06:55:30 -0700 |
commit | ef436f3f60c14935d244d73f11d008f272d123e1 (patch) | |
tree | 7351bf2f6fe443a5d0563cf7cdfc5d921db9404b | |
parent | 23c834092eb4d52a606144960a253391de10e2ef (diff) | |
download | llvm-ef436f3f60c14935d244d73f11d008f272d123e1.zip llvm-ef436f3f60c14935d244d73f11d008f272d123e1.tar.gz llvm-ef436f3f60c14935d244d73f11d008f272d123e1.tar.bz2 |
[mlir] Avoid repeated hash lookups (NFC) (#112158)
-rw-r--r-- | mlir/lib/Transforms/SROA.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mlir/lib/Transforms/SROA.cpp b/mlir/lib/Transforms/SROA.cpp index aca252b..db8be38 100644 --- a/mlir/lib/Transforms/SROA.cpp +++ b/mlir/lib/Transforms/SROA.cpp @@ -100,10 +100,11 @@ computeDestructuringInfo(DestructurableMemorySlot &slot, mlir::getForwardSlice(slot.ptr, &forwardSlice); for (Operation *user : forwardSlice) { // If the next operation has no blocking uses, everything is fine. - if (!info.userToBlockingUses.contains(user)) + auto it = info.userToBlockingUses.find(user); + if (it == info.userToBlockingUses.end()) continue; - SmallPtrSet<OpOperand *, 4> &blockingUses = info.userToBlockingUses[user]; + SmallPtrSet<OpOperand *, 4> &blockingUses = it->second; auto promotable = dyn_cast<PromotableOpInterface>(user); // An operation that has blocking uses must be promoted. If it is not |