[llvm] [AArch64][InstCombine] Fold zext of all-active SVE cmpne-zero (PR #207720)

Matthew Devereau via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 9 07:00:16 PDT 2026


================
@@ -2173,13 +2173,44 @@ static std::optional<Instruction *> instCombineXorSVECmpNE(InstCombiner &IC,
   return &II;
 }
 
+// zext(cmpne(ptrue, %v, 0))
+// -> umin(ptrue, %v, 1)
+static std::optional<Instruction *> instCombineZExtSVECmpNE(InstCombiner &IC,
+                                                            IntrinsicInst &II) {
+  if (!isAllActivePredicate(II.getOperand(0)) || !II.hasOneUse())
----------------
MDevereau wrote:

I've gone back to using the aarch64 intrinsic. I've dropped the oneuse requirement while beefing up the multiple use test case.

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


More information about the llvm-commits mailing list