[llvm] [InstCombine] Reduce nested logical operator if poison is implied (PR #86823)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 27 10:21:25 PDT 2024


================
@@ -2985,6 +2985,13 @@ Instruction *InstCombinerImpl::foldSelectOfBools(SelectInst &SI) {
       return BinaryOperator::CreateOr(CondVal, FalseVal);
     }
 
+    if (match(CondVal, m_OneUse(m_Select(m_Value(A), m_One(), m_Value(B)))) &&
+        impliesPoison(FalseVal, B)) {
----------------
dtcxzyw wrote:

Can you check the compile time impact?

https://github.com/llvm/llvm-project/pull/86823


More information about the llvm-commits mailing list