[llvm] afc6b09 - [InstCombine] getMaskedTypeForICmpPair - remove dead code. NFCI.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 30 11:23:28 PDT 2021


Author: Simon Pilgrim
Date: 2021-07-30T19:23:05+01:00
New Revision: afc6b09deefb6451dcb5a212f5f9db120047768b

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

LOG: [InstCombine] getMaskedTypeForICmpPair - remove dead code. NFCI.

Ok should be true at this point, so the early-out is dead - replace with an assert.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
index 120852c44474..9be483651bd4 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
@@ -367,9 +367,9 @@ getMaskedTypeForICmpPair(Value *&A, Value *&B, Value *&C,
     } else {
       return None;
     }
+
+    assert(Ok && "Failed to find AND on the right side of the RHS icmp.");
   }
-  if (!Ok)
-    return None;
 
   if (L11 == A) {
     B = L12;


        


More information about the llvm-commits mailing list