From: Owen Anderson Date: Tue, 10 Jul 2007 00:27:22 +0000 (+0000) Subject: Move some key maps from std::map to DenseMap. This improves the time to optimize... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=81c2a6ecbb3408b1d99f426d194a051f6284a936;p=oota-llvm.git Move some key maps from std::map to DenseMap. This improves the time to optimize Anton's testcase from 17.5s to 15.7s. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@38480 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/GVNPRE.cpp b/lib/Transforms/Scalar/GVNPRE.cpp index 007c6777195..96870e3fdf2 100644 --- a/lib/Transforms/Scalar/GVNPRE.cpp +++ b/lib/Transforms/Scalar/GVNPRE.cpp @@ -556,6 +556,10 @@ class ValueNumberedSet { BitVector numbers; public: ValueNumberedSet() { numbers.resize(1); } + ValueNumberedSet(const ValueNumberedSet& other) { + numbers = other.numbers; + contents = other.contents; + } typedef SmallPtrSet::iterator iterator; @@ -614,9 +618,9 @@ namespace { ValueTable VN; std::vector createdExpressions; - std::map availableOut; - std::map anticipatedIn; - std::map generatedPhis; + DenseMap availableOut; + DenseMap anticipatedIn; + DenseMap generatedPhis; // This transformation requires dominator postdominator info virtual void getAnalysisUsage(AnalysisUsage &AU) const { @@ -1175,7 +1179,7 @@ bool GVNPRE::elimination() { isa(BI) || isa(BI) || isa(BI) || isa(BI)) { - if (availableOut[BB].test(VN.lookup(BI)) && ! availableOut[BB].count(BI)) { + if (availableOut[BB].test(VN.lookup(BI)) && !availableOut[BB].count(BI)) { Value *leader = find_leader(availableOut[BB], VN.lookup(BI)); if (Instruction* Instr = dyn_cast(leader)) if (Instr->getParent() != 0 && Instr != BI) {