diff --git a/lib/Transforms/IPO/MergeFunctions.cpp b/lib/Transforms/IPO/MergeFunctions.cpp index 2039b740a38..e2dd48458b4 100644 --- a/lib/Transforms/IPO/MergeFunctions.cpp +++ b/lib/Transforms/IPO/MergeFunctions.cpp @@ -112,23 +112,10 @@ public: Func = NULL; } - bool &getOrInsertCachedComparison(const ComparableFunction &Other, - bool &inserted) const { - typedef DenseMap::iterator iterator; - std::pair p = - CompareResultCache.insert(std::make_pair(Other.getFunc(), false)); - inserted = p.second; - return p.first->second; - } - private: explicit ComparableFunction(unsigned Hash) : Func(NULL), Hash(Hash), TD(NULL) {} - // DenseMap::grow() triggers a recomparison of all keys in the map, which is - // wildly expensive. This cache tries to preserve known results. - mutable DenseMap CompareResultCache; - AssertingVH Func; unsigned Hash; TargetData *TD; @@ -675,16 +662,8 @@ bool DenseMapInfo::isEqual(const ComparableFunction &LHS, assert(LHS.getTD() == RHS.getTD() && "Comparing functions for different targets"); - bool inserted; - bool &result1 = LHS.getOrInsertCachedComparison(RHS, inserted); - if (!inserted) - return result1; - bool &result2 = RHS.getOrInsertCachedComparison(LHS, inserted); - if (!inserted) - return result1 = result2; - - return result1 = result2 = FunctionComparator(LHS.getTD(), LHS.getFunc(), - RHS.getFunc()).compare(); + return FunctionComparator(LHS.getTD(), LHS.getFunc(), + RHS.getFunc()).compare(); } // Replace direct callers of Old with New.