InstCombine: Fix return after else
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 5 May 2020 15:47:43 +0000 (11:47 -0400)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Wed, 6 May 2020 15:53:26 +0000 (11:53 -0400)
llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp

index 276f377..281ae6c 100644 (file)
@@ -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;
       }
     }
   }