diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2008-11-30 04:59:26 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2008-11-30 04:59:26 +0000 |
commit | bd0f57821a7326716db85236ba93bd1c9dc44d28 (patch) | |
tree | d63cb9693238ac794f96325e9222e5f18e12e2f7 /llvm/lib/CodeGen | |
parent | 361c0e5f9c2b0bfe6506b4a40c0e856916b587a7 (diff) | |
download | bcm5719-llvm-bd0f57821a7326716db85236ba93bd1c9dc44d28.tar.gz bcm5719-llvm-bd0f57821a7326716db85236ba93bd1c9dc44d28.zip |
APIntify a test which is potentially unsafe otherwise, and fix the
nearby FIXME.
I'm not sure what the right way to fix the Cell test was; if the
approach I used isn't okay, please let me know.
llvm-svn: 60277
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp index 01977908be6..4d8b9be44fb 100644 --- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -1583,12 +1583,19 @@ TargetLowering::SimplifySetCC(MVT VT, SDValue N0, SDValue N1, // by changing cc. // SETUGT X, SINTMAX -> SETLT X, 0 - if (Cond == ISD::SETUGT && OperandBitSize != 1 && - C1 == (~0ULL >> (65-OperandBitSize))) + if (Cond == ISD::SETUGT && + C1 == APInt::getSignedMaxValue(OperandBitSize)) return DAG.getSetCC(VT, N0, DAG.getConstant(0, N1.getValueType()), ISD::SETLT); - // FIXME: Implement the rest of these. + // SETULT X, SINTMIN -> SETGT X, -1 + if (Cond == ISD::SETULT && + C1 == APInt::getSignedMinValue(OperandBitSize)) { + SDValue ConstMinusOne = + DAG.getConstant(APInt::getAllOnesValue(OperandBitSize), + N1.getValueType()); + return DAG.getSetCC(VT, N0, ConstMinusOne, ISD::SETGT); + } // Fold bit comparisons when we can. if ((Cond == ISD::SETEQ || Cond == ISD::SETNE) && |