[llvm] [AArch64][InstCombine] xor(cmpne) -> cmpeq (PR #207007)

Matthew Devereau via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 2 04:13:14 PDT 2026


================
@@ -2142,10 +2142,45 @@ static std::optional<Instruction *> instCombineSVEDupX(InstCombiner &IC,
   return IC.replaceInstUsesWith(II, Splat);
 }
 
+static std::optional<Instruction *> instCombineXorSVECmpNE(InstCombiner &IC,
+                                                           IntrinsicInst &II) {
+  if (!match(II.getOperand(2), m_Zero()) || !II.hasOneUse())
+    return std::nullopt;
+
+  auto *User = dyn_cast<Instruction>(*II.user_begin());
+  if (!User ||
----------------
MDevereau wrote:

In this case I don't think it can ever be null. I was being defensive in the case of constant expressions etc but it is overly cautious here.

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


More information about the llvm-commits mailing list