Skip to content

Commit 25f05b0

Browse files
committed
NewGVN: Fix some formatting and comment issues
llvm-svn: 290820
1 parent 95e2629 commit 25f05b0

File tree

1 file changed

+8
-18
lines changed

1 file changed

+8
-18
lines changed

llvm/lib/Transforms/Scalar/NewGVN.cpp

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -780,12 +780,8 @@ const Expression *NewGVN::performSymbolicCallEvaluation(Instruction *I,
780780
// Update the memory access equivalence table to say that From is equal to To,
781781
// and return true if this is different from what already existed in the table.
782782
bool NewGVN::setMemoryAccessEquivTo(MemoryAccess *From, MemoryAccess *To) {
783-
DEBUG(dbgs() << "Setting " << *From << " equivalent to ");
784-
if (!To)
785-
DEBUG(dbgs() << "itself");
786-
else
787-
DEBUG(dbgs() << *To);
788-
DEBUG(dbgs() << "\n");
783+
DEBUG(dbgs() << "Setting " << *From << " equivalent to "
784+
<< (To ? "itself" : *To) << "\n");
789785
auto LookupResult = MemoryAccessEquiv.find(From);
790786
bool Changed = false;
791787
// If it's already in the table, see if the value changed.
@@ -1092,16 +1088,11 @@ void NewGVN::performCongruenceFinding(Value *V, const Expression *E) {
10921088
if (auto *I = dyn_cast<Instruction>(V)) {
10931089
if (MemoryAccess *MA = MSSA->getMemoryAccess(I)) {
10941090
// If this is a MemoryDef, we need to update the equivalence table. If
1095-
// we
1096-
// determined the expression is congruent to a different memory state,
1097-
// use that different memory state. If we determined it didn't, we
1098-
// update
1099-
// that as well. Note that currently, we do not guarantee the
1100-
// "different" memory state dominates us. The goal is to make things
1101-
// that are congruent look congruent, not ensure we can eliminate one in
1102-
// favor of the other.
1091+
// we determined the expression is congruent to a different memory
1092+
// state, use that different memory state. If we determined it didn't,
1093+
// we update that as well.
11031094
// Right now, the only way they can be equivalent is for store
1104-
// expresions.
1095+
// expressions.
11051096
if (!isa<MemoryUse>(MA)) {
11061097
if (E && isa<StoreExpression>(E) && EClass->Members.size() != 1) {
11071098
auto *DefAccess = cast<StoreExpression>(E)->getDefiningAccess();
@@ -1391,7 +1382,7 @@ void NewGVN::valueNumberInstruction(Instruction *I) {
13911382
} else {
13921383
// Handle terminators that return values. All of them produce values we
13931384
// don't currently understand.
1394-
if (!I->getType()->isVoidTy()){
1385+
if (!I->getType()->isVoidTy()) {
13951386
auto *Symbolized = createUnknownExpression(I);
13961387
performCongruenceFinding(I, Symbolized);
13971388
}
@@ -1588,7 +1579,6 @@ bool NewGVN::runGVN(Function &F, DominatorTree *_DT, AssumptionCache *_AC,
15881579
}
15891580
}
15901581

1591-
// FIXME: Move this to expensive checks when we are satisfied with NewGVN
15921582
#ifndef NDEBUG
15931583
verifyMemoryCongruency();
15941584
#endif
@@ -2070,7 +2060,7 @@ bool NewGVN::eliminateInstructions(Function &F) {
20702060

20712061
// Cleanup the congruence class.
20722062
SmallPtrSet<Value *, 4> MembersLeft;
2073-
for (Value * Member : CC->Members) {
2063+
for (Value *Member : CC->Members) {
20742064
if (Member->getType()->isVoidTy()) {
20752065
MembersLeft.insert(Member);
20762066
continue;

0 commit comments

Comments
 (0)