@@ -780,12 +780,8 @@ const Expression *NewGVN::performSymbolicCallEvaluation(Instruction *I,
780
780
// Update the memory access equivalence table to say that From is equal to To,
781
781
// and return true if this is different from what already existed in the table.
782
782
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 " );
789
785
auto LookupResult = MemoryAccessEquiv.find (From);
790
786
bool Changed = false ;
791
787
// If it's already in the table, see if the value changed.
@@ -1092,16 +1088,11 @@ void NewGVN::performCongruenceFinding(Value *V, const Expression *E) {
1092
1088
if (auto *I = dyn_cast<Instruction>(V)) {
1093
1089
if (MemoryAccess *MA = MSSA->getMemoryAccess (I)) {
1094
1090
// 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.
1103
1094
// Right now, the only way they can be equivalent is for store
1104
- // expresions .
1095
+ // expressions .
1105
1096
if (!isa<MemoryUse>(MA)) {
1106
1097
if (E && isa<StoreExpression>(E) && EClass->Members .size () != 1 ) {
1107
1098
auto *DefAccess = cast<StoreExpression>(E)->getDefiningAccess ();
@@ -1391,7 +1382,7 @@ void NewGVN::valueNumberInstruction(Instruction *I) {
1391
1382
} else {
1392
1383
// Handle terminators that return values. All of them produce values we
1393
1384
// don't currently understand.
1394
- if (!I->getType ()->isVoidTy ()){
1385
+ if (!I->getType ()->isVoidTy ()) {
1395
1386
auto *Symbolized = createUnknownExpression (I);
1396
1387
performCongruenceFinding (I, Symbolized);
1397
1388
}
@@ -1588,7 +1579,6 @@ bool NewGVN::runGVN(Function &F, DominatorTree *_DT, AssumptionCache *_AC,
1588
1579
}
1589
1580
}
1590
1581
1591
- // FIXME: Move this to expensive checks when we are satisfied with NewGVN
1592
1582
#ifndef NDEBUG
1593
1583
verifyMemoryCongruency ();
1594
1584
#endif
@@ -2070,7 +2060,7 @@ bool NewGVN::eliminateInstructions(Function &F) {
2070
2060
2071
2061
// Cleanup the congruence class.
2072
2062
SmallPtrSet<Value *, 4 > MembersLeft;
2073
- for (Value * Member : CC->Members ) {
2063
+ for (Value *Member : CC->Members ) {
2074
2064
if (Member->getType ()->isVoidTy ()) {
2075
2065
MembersLeft.insert (Member);
2076
2066
continue ;
0 commit comments