[llvm] [VPlan] Ignore incoming values with constant false mask. (PR #89384)

via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 21 14:07:03 PDT 2024


================
@@ -67,14 +67,17 @@ struct specific_intval {
         CI = dyn_cast_or_null<ConstantInt>(
             C->getSplatValue(/*AllowPoison=*/false));
 
-    return CI && APInt::isSameValue(CI->getValue(), Val);
+    return CI && APInt::isSameValue(CI->getValue(), Val) &&
+           (BitWidth == 0 || CI->getBitWidth() == BitWidth);
   }
 };
 
-inline specific_intval m_SpecificInt(uint64_t V) {
-  return specific_intval(APInt(64, V));
+inline specific_intval<0> m_SpecificInt(uint64_t V) {
+  return specific_intval<0>(APInt(64, V));
 }
 
+inline specific_intval<1> m_False() { return specific_intval<1>(APInt(64, 0)); }
----------------
ayalz wrote:

Better assert the bitwidth is 1 when one tries to match False or True, rather than mismatch?

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


More information about the llvm-commits mailing list