summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-04-27 05:01:07 +0000
committerChris Lattner <sabre@nondot.org>2006-04-27 05:01:07 +0000
commit393d96a56c62d65445da00f616c3f63c042cbcb8 (patch)
treece8f2c5245d6ee723d914193cf26e785c1a20922 /llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
parentfb1ab103376c9d383521f439722fbc5665de191c (diff)
downloadbcm5719-llvm-393d96a56c62d65445da00f616c3f63c042cbcb8.tar.gz
bcm5719-llvm-393d96a56c62d65445da00f616c3f63c042cbcb8.zip
Fix Regression/CodeGen/Generic/2006-04-26-SetCCAnd.ll and
PR748. llvm-svn: 27987
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp30
1 files changed, 29 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index c26632a41e8..4809db47756 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -232,7 +232,22 @@ ISD::CondCode ISD::getSetCCAndOperation(ISD::CondCode Op1, ISD::CondCode Op2,
return ISD::SETCC_INVALID;
// Combine all of the condition bits.
- return ISD::CondCode(Op1 & Op2);
+ ISD::CondCode Result = ISD::CondCode(Op1 & Op2);
+
+ // Canonicalize illegal integer setcc's.
+ if (isInteger) {
+ switch (Result) {
+ default: break;
+ case ISD::SETUO: // e.g. SETUGT & SETULT
+ Result = ISD::SETFALSE;
+ break;
+ case ISD::SETUEQ: // e.g. SETUGE & SETULE
+ Result = ISD::SETEQ;
+ break;
+ }
+ }
+
+ return Result;
}
const TargetMachine &SelectionDAG::getTarget() const {
@@ -849,6 +864,19 @@ SDOperand SelectionDAG::SimplifySetCC(MVT::ValueType VT, SDOperand N1,
case ISD::SETFALSE2: return getConstant(0, VT);
case ISD::SETTRUE:
case ISD::SETTRUE2: return getConstant(1, VT);
+
+ case ISD::SETOEQ:
+ case ISD::SETOGT:
+ case ISD::SETOGE:
+ case ISD::SETOLT:
+ case ISD::SETOLE:
+ case ISD::SETONE:
+ case ISD::SETO:
+ case ISD::SETUO:
+ case ISD::SETUEQ:
+ case ISD::SETUNE:
+ assert(!MVT::isInteger(N1.getValueType()) && "Illegal setcc for integer!");
+ break;
}
if (ConstantSDNode *N2C = dyn_cast<ConstantSDNode>(N2.Val)) {
OpenPOWER on IntegriCloud