[llvm] [InstCombine] Fix poison propagation in select of bitwise fold (PR #89701)

via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 22 22:54:59 PDT 2024


================
@@ -2596,6 +2602,13 @@ m_Not(const ValTy &V) {
   return m_c_Xor(m_AllOnes(), V);
 }
 
+template <typename ValTy>
+inline BinaryOp_match<cst_pred_ty<is_all_ones, false>, ValTy, Instruction::Xor,
+                      true>
+m_NotForbidPoison(const ValTy &V) {
+  return m_c_Xor(m_AllOnesForbidPoison(), V);
+}
----------------
goldsteinn wrote:

Err I was confusing, not the `m_NotForbidPoison`, but for the `AllowPoison` template arg in the `cstval_pred_ty` unittests.

Either way though.

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


More information about the llvm-commits mailing list