Basic block combine pass
Combine basic blocks terminated by instruction that we have since
proven not to throw. This change is intended to relieve some of the
computational load for llvm by reducing the number of basic blocks
it has to contend with.
Also:
Add stats to show how successful check elimination is.
Restore mechanism to disable some expensive optimization passes when
compiling large methods.
Change-Id: I7fae22160988cbefb90ea9fb1cc26d7364e8d229
diff --git a/src/safe_map.h b/src/safe_map.h
index 62a0415..4001aaf 100644
--- a/src/safe_map.h
+++ b/src/safe_map.h
@@ -75,7 +75,11 @@
// of this container is a pointer, any overwritten pointer will be lost and if this container
// was the owner, you have a leak.
void Overwrite(const K& k, const V& v) {
- map_.insert(std::make_pair(k, v));
+ std::pair<iterator, bool> result = map_.insert(std::make_pair(k, v));
+ if (!result.second) {
+ // Already there - update the value for the existing key
+ result.first->second = v;
+ }
}
bool Equals(const Self& rhs) const {