diff options
author | Owen Anderson <resistor@mac.com> | 2007-07-19 19:57:13 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2007-07-19 19:57:13 +0000 |
commit | b83e56f6b6bd5f172ae77c0615bcb1fdbf9fe6c7 (patch) | |
tree | 25d260a0e441dedc9eb67a35f04b64fd8ac32f6f /lib/Transforms | |
parent | 3b1c0994a0df33c89d0fa2c49ee8d6e4806de0ed (diff) | |
download | external_llvm-b83e56f6b6bd5f172ae77c0615bcb1fdbf9fe6c7.zip external_llvm-b83e56f6b6bd5f172ae77c0615bcb1fdbf9fe6c7.tar.gz external_llvm-b83e56f6b6bd5f172ae77c0615bcb1fdbf9fe6c7.tar.bz2 |
Make val_replace fail early, which reduces the time to optimize 403.gcc to 14.8s.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40064 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/Scalar/GVNPRE.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/GVNPRE.cpp b/lib/Transforms/Scalar/GVNPRE.cpp index 69e5f73..9c7c8c2 100644 --- a/lib/Transforms/Scalar/GVNPRE.cpp +++ b/lib/Transforms/Scalar/GVNPRE.cpp @@ -757,6 +757,8 @@ void GVNPRE::val_insert(ValueNumberedSet& s, Value* v) { /// val_replace - Insert a value into a set, replacing any values already in /// the set that have the same value number void GVNPRE::val_replace(ValueNumberedSet& s, Value* v) { + if (s.count(v)) return; + uint32_t num = VN.lookup(v); Value* leader = find_leader(s, num); if (leader != 0) |