[llvm] r315448 - [NFC] Fix variables used only for assert in GVN

Max Kazantsev via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 11 03:31:49 PDT 2017


Author: mkazantsev
Date: Wed Oct 11 03:31:49 2017
New Revision: 315448

URL: http://llvm.org/viewvc/llvm-project?rev=315448&view=rev
Log:
[NFC] Fix variables used only for assert in GVN

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

Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVN.cpp?rev=315448&r1=315447&r2=315448&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Wed Oct 11 03:31:49 2017
@@ -2398,14 +2398,14 @@ GVN::fillImplicitControlFlowInfo(Reverse
     // must be removed once isGuaranteedToTransferExecutionToSuccessor is fixed.
     if (isGuaranteedToTransferExecutionToSuccessor(I))
       return false;
-    if (auto *LI = dyn_cast<LoadInst>(I)) {
-      assert(LI->isVolatile() && "Non-volatile load should transfer execution"
-                                 " to successor!");
+    if (isa<LoadInst>(I)) {
+      assert(cast<LoadInst>(I)->isVolatile() &&
+             "Non-volatile load should transfer execution to successor!");
       return false;
     }
-    if (auto *SI = dyn_cast<StoreInst>(I)) {
-      assert(SI->isVolatile() && "Non-volatile store should transfer execution"
-                                 " to successor!");
+    if (isa<StoreInst>(I)) {
+      assert(cast<StoreInst>(I)->isVolatile() &&
+             "Non-volatile store should transfer execution to successor!");
       return false;
     }
     return true;




More information about the llvm-commits mailing list