[llvm] 59bc99a - InstCombine: Fix return after else

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed May 6 08:53:44 PDT 2020


Author: Matt Arsenault
Date: 2020-05-06T11:53:26-04:00
New Revision: 59bc99a08a69217b6a6de5df7ef99b0be7e3e1f4

URL: https://github.com/llvm/llvm-project/commit/59bc99a08a69217b6a6de5df7ef99b0be7e3e1f4
DIFF: https://github.com/llvm/llvm-project/commit/59bc99a08a69217b6a6de5df7ef99b0be7e3e1f4.diff

LOG: InstCombine: Fix return after else

Added: 
    

Modified: 
    llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
index 276f377f34d8..281ae6c88513 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
@@ -419,11 +419,11 @@ Instruction *InstCombiner::visitAllocaInst(AllocaInst &AI) {
           eraseInstFromFunction(*Copy);
           ++NumGlobalCopies;
           return NewI;
-        } else {
-          PointerReplacer PtrReplacer(*this);
-          PtrReplacer.replacePointer(AI, Cast);
-          ++NumGlobalCopies;
         }
+
+        PointerReplacer PtrReplacer(*this);
+        PtrReplacer.replacePointer(AI, Cast);
+        ++NumGlobalCopies;
       }
     }
   }


        


More information about the llvm-commits mailing list