[llvm] [VPlan] Simplify (X && Y) || (X && !Y) -> X. (PR #89386)

via llvm-commits llvm-commits at lists.llvm.org
Mon May 13 10:41:03 PDT 2024


================
@@ -69,10 +69,8 @@ template <unsigned BitWidth = 0> struct specific_intval {
             C->getSplatValue(/*AllowPoison=*/false));
     if (!CI)
       return false;
-
-    assert((BitWidth == 0 || CI->getBitWidth() == BitWidth) &&
-           "Trying the match constant with unexpected bitwidth.");
-    return APInt::isSameValue(CI->getValue(), Val);
+    return (BitWidth == 0 || CI->getBitWidth() == BitWidth) &&
+           APInt::isSameValue(CI->getValue(), Val);
----------------
ayalz wrote:

Is this change still needed, now that Logical Ands are matched whose operands must be single bits, rather than Selects?

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


More information about the llvm-commits mailing list