[PATCH] D96945: [InstCombine] Add simplification of two logical and/ors

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 27 03:32:47 PST 2021


lebedev.ri added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp:2642-2649
+    // select (select a, true, b), true, b -> select a, true, b
+    if (match(CondVal, m_Select(m_Value(A), m_One(), m_Value(B))) &&
+        match(TrueVal, m_One()) && match(FalseVal, m_Specific(B)))
+      return replaceOperand(SI, 0, A);
+    // select (select a, b, false), b, false -> select a, b, false
+    if (match(CondVal, m_Select(m_Value(A), m_Value(B), m_Zero())) &&
+        match(TrueVal, m_Specific(B)) && match(FalseVal, m_Zero()))
----------------
Why does this only deal with `select` form in the cond operand, unlike the two folds above?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96945/new/

https://reviews.llvm.org/D96945



More information about the llvm-commits mailing list