summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorDaniel Berlin <dberlin@dberlin.org>2017-02-11 15:20:15 +0000
committerDaniel Berlin <dberlin@dberlin.org>2017-02-11 15:20:15 +0000
commit22a4a01ffa093b6cdf471c2305c1908fb8c97c66 (patch)
tree2f67ae4b01f9b30b31a50c1d3923ade3a6d02ec7 /llvm
parent1529bb93c9f2e1b10f1520706610b0b45b0f21f8 (diff)
downloadbcm5719-llvm-22a4a01ffa093b6cdf471c2305c1908fb8c97c66.tar.gz
bcm5719-llvm-22a4a01ffa093b6cdf471c2305c1908fb8c97c66.zip
NewGVN: Reverse sense of this test to make it clearer
llvm-svn: 294851
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/Transforms/Scalar/NewGVN.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Scalar/NewGVN.cpp b/llvm/lib/Transforms/Scalar/NewGVN.cpp
index 2d8f22962a9..47627937cfa 100644
--- a/llvm/lib/Transforms/Scalar/NewGVN.cpp
+++ b/llvm/lib/Transforms/Scalar/NewGVN.cpp
@@ -1450,11 +1450,13 @@ void NewGVN::initializeCongruenceClasses(Function &F) {
MemoryAccessToClass[MP] = InitialClass;
for (auto &I : B) {
- // Don't insert void terminators into the class
- if (!isa<TerminatorInst>(I) || !I.getType()->isVoidTy()) {
- InitialValues.insert(&I);
- ValueToClass[&I] = InitialClass;
- }
+ // Don't insert void terminators into the class. We don't value number
+ // them, and they just end up sitting in INITIAL.
+ if (isa<TerminatorInst>(I) && I.getType()->isVoidTy())
+ continue;
+ InitialValues.insert(&I);
+ ValueToClass[&I] = InitialClass;
+
// All memory accesses are equivalent to live on entry to start. They must
// be initialized to something so that initial changes are noticed. For
// the maximal answer, we initialize them all to be the same as
OpenPOWER on IntegriCloud