From fd8b6e17e1554dd56921592a7ef371931449b55d Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Mon, 3 Feb 2025 13:10:33 +0000 Subject: [PATCH 1/2] [X86] Use explicit X86::CondCode argument in EmitTest/EmitCmp calls. NFC. Helps identify the enum code during debugging. --- llvm/lib/Target/X86/X86ISelLowering.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 8f904209d8a3a..3d657c9a77fa7 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -22975,7 +22975,7 @@ static bool isProfitableToUseFlagOp(SDValue Op) { /// Emit nodes that will be selected as "test Op0,Op0", or something /// equivalent. -static SDValue EmitTest(SDValue Op, unsigned X86CC, const SDLoc &dl, +static SDValue EmitTest(SDValue Op, X86::CondCode X86CC, const SDLoc &dl, SelectionDAG &DAG, const X86Subtarget &Subtarget) { // CF and OF aren't always set the way we want. Determine which // of these we need. @@ -23085,7 +23085,7 @@ static SDValue EmitTest(SDValue Op, unsigned X86CC, const SDLoc &dl, /// Emit nodes that will be selected as "cmp Op0,Op1", or something /// equivalent. -static SDValue EmitCmp(SDValue Op0, SDValue Op1, unsigned X86CC, +static SDValue EmitCmp(SDValue Op0, SDValue Op1, X86::CondCode X86CC, const SDLoc &dl, SelectionDAG &DAG, const X86Subtarget &Subtarget) { if (isNullConstant(Op1)) From d7fbd5cdc83a0446dc1e23fd685102d3471bd853 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Mon, 3 Feb 2025 13:59:05 +0000 Subject: [PATCH 2/2] Update isX86CCSigned as well --- llvm/lib/Target/X86/X86ISelLowering.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 3d657c9a77fa7..4925561f504f9 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -2944,7 +2944,7 @@ bool X86::isOffsetSuitableForCodeModel(int64_t Offset, CodeModel::Model CM, } /// Return true if the condition is an signed comparison operation. -static bool isX86CCSigned(unsigned X86CC) { +static bool isX86CCSigned(X86::CondCode X86CC) { switch (X86CC) { default: llvm_unreachable("Invalid integer condition!");