diff --git a/i/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp --- a/i/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -22797,6 +22797,12 @@ std::swap(Op0, Op1); } + // Prefer >= 0 over > -1. + if (SetCCOpcode == ISD::SETGT && ISD::isBuildVectorAllOnes(Op1.getNode())) { + SetCCOpcode = ISD::SETGE; + Op1 = DAG.getConstant(0, dl, Op1.getValueType()); + } + return DAG.getSetCC(dl, VT, Op0, Op1, SetCCOpcode); }