[llvm] [AArch64][InstCombine] xor(cmpne) -> cmpeq (PR #207007)
Matthew Devereau via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 2 08:43:22 PDT 2026
================
@@ -2142,10 +2142,43 @@ 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 = cast<Instruction>(*II.user_begin());
+ if (!match(User, m_c_Xor(m_Specific(&II), m_Specific(II.getOperand(0)))))
+ return std::nullopt;
+
+ Intrinsic::ID IID;
+ switch ((II.getIntrinsicID())) {
----------------
MDevereau wrote:
Okay, I thought you were asking why I was querying for the intrinsic ID when we've already been through the switch in `AArch64TTIImpl::instCombineIntrinsic`
https://github.com/llvm/llvm-project/pull/207007
More information about the llvm-commits
mailing list