diff options
-rw-r--r-- | lib/Transforms/Scalar/GVNPRE.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/Transforms/Scalar/GVNPRE.cpp b/lib/Transforms/Scalar/GVNPRE.cpp index ef70f679bc..b1b096e350 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<BinaryOperator>(*I) || isa<CmpInst>(*I)) - valNum = VN.lookup(*I); - else - valNum = VN.lookup_or_add(*I); - if (find_leader(anticIn, valNum) == 0) - val_insert(anticIn, *I); + if (!isa<BinaryOperator>(*I) && !isa<CmpInst>(*I)) + VN.lookup_or_add(*I); + val_insert(anticIn, *I); } clean(anticIn); |