[llvm] r290825 - [NewGVN] Fold single-use variable inside the assertion.

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 2 11:03:16 PST 2017


Author: davide
Date: Mon Jan  2 13:03:16 2017
New Revision: 290825

URL: http://llvm.org/viewvc/llvm-project?rev=290825&view=rev
Log:
[NewGVN] Fold single-use variable inside the assertion.

It placates some bots which complain because they compile the
assertion out and think the variable is unused.

Modified:
    llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp?rev=290825&r1=290824&r2=290825&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/NewGVN.cpp Mon Jan  2 13:03:16 2017
@@ -1422,14 +1422,12 @@ void NewGVN::verifyMemoryCongruency() {
       continue;
     if (auto *FirstMUD = dyn_cast<MemoryUseOrDef>(KV.first)) {
       auto *SecondMUD = dyn_cast<MemoryUseOrDef>(KV.second);
-      if (FirstMUD && SecondMUD) {
-        auto *FirstInst = FirstMUD->getMemoryInst();
-        auto *SecondInst = SecondMUD->getMemoryInst();
+      if (FirstMUD && SecondMUD)
         assert(
-            ValueToClass.lookup(FirstInst) == ValueToClass.lookup(SecondInst) &&
+            ValueToClass.lookup(FirstMUD->getMemoryInst()) ==
+                ValueToClass.lookup(SecondMUD->getMemoryInst()) &&
             "The instructions for these memory operations should have been in "
             "the same congruence class");
-      }
     } else if (auto *FirstMP = dyn_cast<MemoryPhi>(KV.first)) {
 
       // We can only sanely verify that MemoryDefs in the operand list all have




More information about the llvm-commits mailing list