summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDaniel Berlin <dberlin@dberlin.org>2017-01-02 18:22:38 +0000
committerDaniel Berlin <dberlin@dberlin.org>2017-01-02 18:22:38 +0000
commit25f05b0ab781ae766ab6e6c38ba90efb1d96f3ad (patch)
treeeb1d3b0b37d56ed35f07adc7bb8b139e1a21907b /llvm/lib
parent95e2629216c5807cb7b09eba3828cb2284b3bfb1 (diff)
downloadbcm5719-llvm-25f05b0ab781ae766ab6e6c38ba90efb1d96f3ad.tar.gz
bcm5719-llvm-25f05b0ab781ae766ab6e6c38ba90efb1d96f3ad.zip
NewGVN: Fix some formatting and comment issues
llvm-svn: 290820
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Scalar/NewGVN.cpp26
1 files changed, 8 insertions, 18 deletions
diff --git a/llvm/lib/Transforms/Scalar/NewGVN.cpp b/llvm/lib/Transforms/Scalar/NewGVN.cpp
index dee61b77412..3a10a9f0991 100644
--- a/llvm/lib/Transforms/Scalar/NewGVN.cpp
+++ b/llvm/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<Instruction>(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<MemoryUse>(MA)) {
if (E && isa<StoreExpression>(E) && EClass->Members.size() != 1) {
auto *DefAccess = cast<StoreExpression>(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<Value *, 4> MembersLeft;
- for (Value * Member : CC->Members) {
+ for (Value *Member : CC->Members) {
if (Member->getType()->isVoidTy()) {
MembersLeft.insert(Member);
continue;
OpenPOWER on IntegriCloud