[llvm] 14e356d - [TypePromotion] Remove redundant if. NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 26 11:50:16 PDT 2021


Author: Craig Topper
Date: 2021-07-26T11:47:25-07:00
New Revision: 14e356d121cd3f49a1f78f67a5b2e605c7d063f6

URL: https://github.com/llvm/llvm-project/commit/14e356d121cd3f49a1f78f67a5b2e605c7d063f6
DIFF: https://github.com/llvm/llvm-project/commit/14e356d121cd3f49a1f78f67a5b2e605c7d063f6.diff

LOG: [TypePromotion] Remove redundant if. NFC

The same condition was checked in the previous if. Maybe this was
a bad merge resolution?

Added: 
    

Modified: 
    llvm/lib/CodeGen/TypePromotion.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/TypePromotion.cpp b/llvm/lib/CodeGen/TypePromotion.cpp
index cc459a348b64..2ce6ea1d4212 100644
--- a/llvm/lib/CodeGen/TypePromotion.cpp
+++ b/llvm/lib/CodeGen/TypePromotion.cpp
@@ -920,9 +920,6 @@ bool TypePromotion::TryToPromote(Value *V, unsigned PromotedWidth) {
   if (ToPromote < 2 || (Blocks.size() == 1 && (NonFreeArgs > SafeWrap.size())))
     return false;
 
-  if (ToPromote < 2)
-    return false;
-
   IRPromoter Promoter(*Ctx, cast<IntegerType>(OrigTy), PromotedWidth,
                       CurrentVisited, Sources, Sinks, SafeWrap);
   Promoter.Mutate();


        


More information about the llvm-commits mailing list