Avoid duplicated map lookups. No functionality change intended.
llvm-svn: 273030
diff --git a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
index 21c0c9d..fe15d17 100644
--- a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
+++ b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
@@ -2616,9 +2616,8 @@
// We may have base pointers which are now live that weren't before. We need
// to update the PointerToBase structure to reflect this.
for (auto V : Updated)
- if (!Info.PointerToBase.count(V)) {
+ if (Info.PointerToBase.insert(std::make_pair(V, V)).second) {
assert(Bases.count(V) && "can't find base for unexpected live value");
- Info.PointerToBase[V] = V;
continue;
}