[llvm] [VPlan] Introduce CSE pass (PR #151872)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 20 02:59:39 PDT 2025


================
@@ -792,8 +792,8 @@ class VPIRFlags {
   }
 
   CmpInst::Predicate getPredicate() const {
-    assert(OpType == OperationType::Cmp &&
-           "recipe doesn't have a compare predicate");
+    if (OpType != OperationType::Cmp)
+      return CmpInst::BAD_ICMP_PREDICATE;
----------------
fhahn wrote:

For consistency, it would be better to add a hasPredicate helper.

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


More information about the llvm-commits mailing list