[llvm] 1a7061c - [InstCombine] Remove redundant logical select fold (NFCI)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 24 07:28:56 PDT 2023


Author: Nikita Popov
Date: 2023-10-24T16:28:23+02:00
New Revision: 1a7061c1ad9f4218d0f52b3210e7b025091908db

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

LOG: [InstCombine] Remove redundant logical select fold (NFCI)

This has been subsumed by simplifyWithOpReplaced().

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp b/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
index 216949c7f91b91a..9bd49f76d4bd5b7 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
@@ -3055,14 +3055,6 @@ Instruction *InstCombinerImpl::foldSelectOfBools(SelectInst &SI) {
   if (match(CondVal, m_Select(m_Value(A), m_Value(B), m_Zero())) &&
       match(TrueVal, m_Specific(B)) && match(FalseVal, m_Zero()))
     return replaceOperand(SI, 0, A);
-  // select a, (select ~a, true, b), false -> select a, b, false
-  if (match(TrueVal, m_c_LogicalOr(m_Not(m_Specific(CondVal)), m_Value(B))) &&
-      match(FalseVal, m_Zero()))
-    return replaceOperand(SI, 1, B);
-  // select a, true, (select ~a, b, false) -> select a, true, b
-  if (match(FalseVal, m_c_LogicalAnd(m_Not(m_Specific(CondVal)), m_Value(B))) &&
-      match(TrueVal, m_One()))
-    return replaceOperand(SI, 2, B);
 
   // ~(A & B) & (A | B) --> A ^ B
   if (match(&SI, m_c_LogicalAnd(m_Not(m_LogicalAnd(m_Value(A), m_Value(B))),


        


More information about the llvm-commits mailing list