From dcdec3c8b2c148210737beddd5a02d58f659f487 Mon Sep 17 00:00:00 2001 From: Daniel Berlin Date: Mon, 2 Jan 2017 18:22:38 +0000 Subject: [PATCH] NewGVN: Fix some formatting and comment issues git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290820 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/NewGVN.cpp | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/lib/Transforms/Scalar/NewGVN.cpp b/lib/Transforms/Scalar/NewGVN.cpp index dee61b77412..3a10a9f0991 100644 --- a/lib/Transforms/Scalar/NewGVN.cpp +++ b/lib/Transforms/Scalar/NewGVN.cpp @@ -780,12 +780,8 @@ const Expression *NewGVN::performSymbolicCallEvaluation(Instruction *I, // Update the memory access equivalence table to say that From is equal to To, // and return true if this is different from what already existed in the table. bool NewGVN::setMemoryAccessEquivTo(MemoryAccess *From, MemoryAccess *To) { - DEBUG(dbgs() << "Setting " << *From << " equivalent to "); - if (!To) - DEBUG(dbgs() << "itself"); - else - DEBUG(dbgs() << *To); - DEBUG(dbgs() << "\n"); + DEBUG(dbgs() << "Setting " << *From << " equivalent to " + << (To ? "itself" : *To) << "\n"); auto LookupResult = MemoryAccessEquiv.find(From); bool Changed = false; // If it's already in the table, see if the value changed. @@ -1092,16 +1088,11 @@ void NewGVN::performCongruenceFinding(Value *V, const Expression *E) { if (auto *I = dyn_cast(V)) { if (MemoryAccess *MA = MSSA->getMemoryAccess(I)) { // If this is a MemoryDef, we need to update the equivalence table. If - // we - // determined the expression is congruent to a different memory state, - // use that different memory state. If we determined it didn't, we - // update - // that as well. Note that currently, we do not guarantee the - // "different" memory state dominates us. The goal is to make things - // that are congruent look congruent, not ensure we can eliminate one in - // favor of the other. + // we determined the expression is congruent to a different memory + // state, use that different memory state. If we determined it didn't, + // we update that as well. // Right now, the only way they can be equivalent is for store - // expresions. + // expressions. if (!isa(MA)) { if (E && isa(E) && EClass->Members.size() != 1) { auto *DefAccess = cast(E)->getDefiningAccess(); @@ -1391,7 +1382,7 @@ void NewGVN::valueNumberInstruction(Instruction *I) { } else { // Handle terminators that return values. All of them produce values we // don't currently understand. - if (!I->getType()->isVoidTy()){ + if (!I->getType()->isVoidTy()) { auto *Symbolized = createUnknownExpression(I); performCongruenceFinding(I, Symbolized); } @@ -1588,7 +1579,6 @@ bool NewGVN::runGVN(Function &F, DominatorTree *_DT, AssumptionCache *_AC, } } -// FIXME: Move this to expensive checks when we are satisfied with NewGVN #ifndef NDEBUG verifyMemoryCongruency(); #endif @@ -2070,7 +2060,7 @@ bool NewGVN::eliminateInstructions(Function &F) { // Cleanup the congruence class. SmallPtrSet MembersLeft; - for (Value * Member : CC->Members) { + for (Value *Member : CC->Members) { if (Member->getType()->isVoidTy()) { MembersLeft.insert(Member); continue;