From: Max Kazantsev <max.kazantsev@azul.com>
Date: Wed, 11 Oct 2017 10:31:49 +0000 (+0000)
Subject: [NFC] Fix variables used only for assert in GVN
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0b9ad079a097fb8cc18bfe8a5600991d9f56a524;p=llvm

[NFC] Fix variables used only for assert in GVN

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315448 91177308-0d34-0410-b5e6-96231b3b80d8
---

diff --git a/lib/Transforms/Scalar/GVN.cpp b/lib/Transforms/Scalar/GVN.cpp
index 135b33d84be..3b689b03d47 100644
--- a/lib/Transforms/Scalar/GVN.cpp
+++ b/lib/Transforms/Scalar/GVN.cpp
@@ -2398,14 +2398,14 @@ GVN::fillImplicitControlFlowInfo(ReversePostOrderTraversal<Function *> &RPOT) {
     // 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;