summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Berlin <dberlin@dberlin.org>2017-04-18 20:15:47 +0000
committerDaniel Berlin <dberlin@dberlin.org>2017-04-18 20:15:47 +0000
commit9d0042b47caf6c9104df4f517f18f8f87d9334ae (patch)
tree6b74dd6964f41025983ad41e3d8bb1934dbc22b4
parent877923a87f52931bcefc98dedf1d10383a31b7d5 (diff)
downloadbcm5719-llvm-9d0042b47caf6c9104df4f517f18f8f87d9334ae.tar.gz
bcm5719-llvm-9d0042b47caf6c9104df4f517f18f8f87d9334ae.zip
NewGVN: Fix memory congruence verification. The return true should be a return false. Merge the appropriate if statements so it doesn't happen again.
llvm-svn: 300584
-rw-r--r--llvm/lib/Transforms/Scalar/NewGVN.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/lib/Transforms/Scalar/NewGVN.cpp b/llvm/lib/Transforms/Scalar/NewGVN.cpp
index c1dc43ab0b2..a014ddd9ba0 100644
--- a/llvm/lib/Transforms/Scalar/NewGVN.cpp
+++ b/llvm/lib/Transforms/Scalar/NewGVN.cpp
@@ -138,7 +138,8 @@ PHIExpression::~PHIExpression() = default;
// It also wants to hand us SCC's that are unrelated to the phi node we ask
// about, and have us process them there or risk redoing work.
// Graph traits over a filter iterator also doesn't work that well here.
-// This SCC finder is specialized to walk use-def chains, and only follows instructions,
+// This SCC finder is specialized to walk use-def chains, and only follows
+// instructions,
// not generic values (arguments, etc).
struct TarjanSCC {
@@ -170,8 +171,10 @@ private:
Root[I] = std::min(Root.lookup(I), Root.lookup(Op));
}
}
- // See if we really were the root of a component, by seeing if we still have our DFSNumber.
- // If we do, we are the root of the component, and we have completed a component. If we do not,
+ // See if we really were the root of a component, by seeing if we still have
+ // our DFSNumber.
+ // If we do, we are the root of the component, and we have completed a
+ // component. If we do not,
// we are not the root of a component, and belong on the component stack.
if (Root.lookup(I) == OurDFS) {
unsigned ComponentID = Components.size();
@@ -2519,14 +2522,11 @@ void NewGVN::verifyMemoryCongruency() const {
auto ReachableAccessPred =
[&](const std::pair<const MemoryAccess *, CongruenceClass *> Pair) {
bool Result = ReachableBlocks.count(Pair.first->getBlock());
- if (!Result)
+ if (!Result || MSSA->isLiveOnEntryDef(Pair.first) ||
+ MemoryToDFSNum(Pair.first) == 0)
return false;
- if (MSSA->isLiveOnEntryDef(Pair.first))
- return true;
if (auto *MemDef = dyn_cast<MemoryDef>(Pair.first))
return !isInstructionTriviallyDead(MemDef->getMemoryInst());
- if (MemoryToDFSNum(Pair.first) == 0)
- return false;
return true;
};
OpenPOWER on IntegriCloud