[llvm] [X86] Fix XOR folding in EmitCmp (PR #210546)
via llvm-commits
llvm-commits at lists.llvm.org
Sat Jul 18 13:43:46 PDT 2026
================
@@ -24077,13 +24077,21 @@ static SDValue EmitCmp(SDValue Op0, SDValue Op1, X86::CondCode X86CC,
// If we already have an XOR of the ops, use that to check for equality.
// Else use SUB instead of CMP to enable CSE between SUB and CMP.
unsigned X86Opc = X86ISD::SUB;
+ SDNode *IsdNode = nullptr;
if ((X86CC == X86::COND_E || X86CC == X86::COND_NE) &&
- (DAG.doesNodeExist(ISD::XOR, DAG.getVTList({CmpVT}), {Op0, Op1}) ||
- DAG.doesNodeExist(ISD::XOR, DAG.getVTList({CmpVT}), {Op1, Op0})))
+ ((IsdNode = DAG.getNodeIfExists(ISD::XOR, DAG.getVTList({CmpVT}),
+ {Op0, Op1})) ||
+ (IsdNode =
+ DAG.getNodeIfExists(ISD::XOR, DAG.getVTList({CmpVT}), {Op1, Op0}))))
----------------
AZero13 wrote:
Why format the thi line?
https://github.com/llvm/llvm-project/pull/210546
More information about the llvm-commits
mailing list