From 359208032b7d0736307b375c36f5c5ab4461ac87 Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Tue, 5 Jun 2007 17:31:23 +0000 Subject: [PATCH] Fix a small bug, some 80 cols violations, and add some more debugging output. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37436 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/GVNPRE.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/Transforms/Scalar/GVNPRE.cpp b/lib/Transforms/Scalar/GVNPRE.cpp index 2bedd1cdea5..b34239d6a61 100644 --- a/lib/Transforms/Scalar/GVNPRE.cpp +++ b/lib/Transforms/Scalar/GVNPRE.cpp @@ -354,6 +354,10 @@ bool GVNPRE::runOnFunction(Function &F) { currTemps, currAvail, availableOut); } + DOUT << "Maximal Set: "; + dump_unique(VN, maximalSet); + DOUT << "\n"; + PostDominatorTree &PDT = getAnalysis(); // Second Phase of BuildSets - calculate ANTIC_IN @@ -384,10 +388,12 @@ bool GVNPRE::runOnFunction(Function &F) { std::set old (anticIn.begin(), anticIn.end()); if (BB->getTerminator()->getNumSuccessors() == 1) { - if (visited.find(BB) == visited.end()) + if (visited.find(BB->getTerminator()->getSuccessor(0)) == + visited.end()) phi_translate_set(VN, maximalSet, maximalSet, BB, anticOut); else - phi_translate_set(VN, maximalSet, anticipatedIn[BB->getTerminator()->getSuccessor(0)], BB, anticOut); + phi_translate_set(VN, maximalSet, + anticipatedIn[BB->getTerminator()->getSuccessor(0)], BB, anticOut); } else if (BB->getTerminator()->getNumSuccessors() > 1) { BasicBlock* first = BB->getTerminator()->getSuccessor(0); anticOut.insert(anticipatedIn[first].begin(), -- 2.34.1