[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Chris Lattner
lattner at cs.uiuc.edu
Wed Apr 26 22:01:20 PDT 2006
Changes in directory llvm/lib/CodeGen/SelectionDAG:
SelectionDAG.cpp updated: 1.302 -> 1.303
---
Log message:
Fix Regression/CodeGen/Generic/2006-04-26-SetCCAnd.ll and
PR748: http://llvm.cs.uiuc.edu/PR748 .
---
Diffs of the changes: (+29 -1)
SelectionDAG.cpp | 30 +++++++++++++++++++++++++++++-
1 files changed, 29 insertions(+), 1 deletion(-)
Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.302 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.303
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.302 Sat Apr 22 13:53:45 2006
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Thu Apr 27 00:01:07 2006
@@ -232,7 +232,22 @@
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 @@
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)) {
More information about the llvm-commits
mailing list