]> granicus.if.org Git - llvm/commitdiff
NewGVN: Reverse sense of this test to make it clearer
authorDaniel Berlin <dberlin@dberlin.org>
Sat, 11 Feb 2017 15:20:15 +0000 (15:20 +0000)
committerDaniel Berlin <dberlin@dberlin.org>
Sat, 11 Feb 2017 15:20:15 +0000 (15:20 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294851 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/NewGVN.cpp

index 2d8f22962a963a608452263bcd3ea739c5c9d949..47627937cfae489ee5d128de07c50fd2ffa9afd8 100644 (file)
@@ -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