[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Nate Begeman
natebegeman at mac.com
Thu Apr 14 01:57:03 PDT 2005
Changes in directory llvm/lib/CodeGen/SelectionDAG:
SelectionDAG.cpp updated: 1.82 -> 1.83
---
Log message:
Add a couple missing transforms in getSetCC that were triggering assertions
in the PPC Pattern ISel
---
Diffs of the changes: (+8 -1)
SelectionDAG.cpp | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletion(-)
Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.82 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.83
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.82 Wed Apr 13 16:23:31 2005
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Thu Apr 14 03:56:52 2005
@@ -436,11 +436,18 @@
N2C = cast<ConstantSDNode>(N2.Val);
}
+ if ((Cond == ISD::SETLT || Cond == ISD::SETULT) && C2 == MinVal)
+ return getConstant(0, VT); // X < MIN --> false
+
+ // Canonicalize setgt X, Min --> setne X, Min
+ if ((Cond == ISD::SETGT || Cond == ISD::SETUGT) && C2 == MinVal)
+ return getSetCC(ISD::SETNE, VT, N1, N2);
+
// If we have setult X, 1, turn it into seteq X, 0
if ((Cond == ISD::SETLT || Cond == ISD::SETULT) && C2 == MinVal+1)
return getSetCC(ISD::SETEQ, VT, N1,
getConstant(MinVal, N1.getValueType()));
- // If we have setult X, 1, turn it into seteq X, 0
+ // If we have setugt X, Max-1, turn it into seteq X, Max
else if ((Cond == ISD::SETGT || Cond == ISD::SETUGT) && C2 == MaxVal-1)
return getSetCC(ISD::SETEQ, VT, N1,
getConstant(MaxVal, N1.getValueType()));
More information about the llvm-commits
mailing list