From a783224b25d7f6a2225877566ee9586534eb4627 Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Thu, 21 Jun 2007 01:59:05 +0000 Subject: [PATCH] Eliminate a redundant check. This speeds up optimization of 253.perlbmk from 13.5 seconds to 10.9 seconds. llvm-svn: 37683 --- lib/Transforms/Scalar/GVNPRE.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/Transforms/Scalar/GVNPRE.cpp b/lib/Transforms/Scalar/GVNPRE.cpp index ef70f679bcf..b1b096e3504 100644 --- a/lib/Transforms/Scalar/GVNPRE.cpp +++ b/lib/Transforms/Scalar/GVNPRE.cpp @@ -887,13 +887,9 @@ bool GVNPRE::buildsets_anticin(BasicBlock* BB, // However, for opaques, such as constants within PHI nodes, it is // possible that they have not yet received a number. Make sure they do // so now. - uint32_t valNum = 0; - if (isa(*I) || isa(*I)) - valNum = VN.lookup(*I); - else - valNum = VN.lookup_or_add(*I); - if (find_leader(anticIn, valNum) == 0) - val_insert(anticIn, *I); + if (!isa(*I) && !isa(*I)) + VN.lookup_or_add(*I); + val_insert(anticIn, *I); } clean(anticIn);