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

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 9 04:15:55 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)) {
----------------
nikic wrote:

Sorry for the delay, here are the results: https://llvm-compile-time-tracker.com/compare.php?from=03ffb82c9e0d363c97ca37ede46719236616c88e&to=79752c9ee833172600523f038a6f83d64f657f9d&stat=instructions:u

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


More information about the llvm-commits mailing list