Make val_replace fail early, which reduces the time to optimize 403.gcc to 14.8s.

llvm-svn: 40064
This commit is contained in:
Owen Anderson 2007-07-19 19:57:13 +00:00
parent dd96b98bf6
commit f9e6542969
1 changed files with 2 additions and 0 deletions

View File

@ -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)