[llvm] [LLVM][InstCombine] Add simplification of SVE compare intrinsics. (PR #211249)

Paul Walker via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 28 09:00:36 PDT 2026


================
@@ -2004,11 +2131,21 @@ simplifySVEIntrinsic(InstCombiner &IC, IntrinsicInst &II,
     }
   }
 
+  if (!IInfo.hasMatchingIROpode())
+    return std::nullopt;
+
+  //
   // Operation specific simplifications.
-  if (IInfo.hasMatchingIROpode() &&
-      Instruction::isBinaryOp(IInfo.getMatchingIROpode()))
+  //
+
+  unsigned Opc = IInfo.getMatchingIROpode();
+
+  if (Instruction::isBinaryOp(Opc))
     return simplifySVEIntrinsicBinOp(IC, II, IInfo);
 
+  if (Opc == Instruction::FCmp || Opc == Instruction::ICmp)
----------------
paulwalker-arm wrote:

The assert is guarding against incorrect usage.  The specialised simplify functions are not supposed to be called blindly, that's why simplifySVEIntrinsic exists.

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


More information about the llvm-commits mailing list