[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Nate Begeman
natebegeman at mac.com
Tue Aug 23 17:21:39 PDT 2005
Changes in directory llvm/lib/CodeGen/SelectionDAG:
SelectionDAG.cpp updated: 1.157 -> 1.158
---
Log message:
Fix optimization of select_cc seteq X, 0, 1, 0 -> srl (ctlz X), log2 X size
---
Diffs of the changes: (+3 -3)
SelectionDAG.cpp | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.157 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.158
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.157 Tue Aug 23 00:41:12 2005
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Tue Aug 23 19:21:28 2005
@@ -854,9 +854,9 @@
}
// Check to see if this is the equivalent of seteq X, 0.
- // select_cc seteq X, 0, 1, 0 -> setcc X, 0, seteq -> srl (ctlz X), size(X)-1
+ // select_cc eq X, 0, 1, 0 -> setcc X, 0, eq -> srl (ctlz X), log2(size(X))
if (N2C && N2C->isNullValue() && N4C && N4C->isNullValue() &&
- N3C && (N3C->getValue() == 1)) {
+ N3C && (N3C->getValue() == 1ULL) && CC == ISD::SETEQ) {
MVT::ValueType XType = N1.getValueType();
if (TLI.getOperationAction(ISD::SETCC, TLI.getSetCCResultTy()) ==
TargetLowering::Legal) {
@@ -865,7 +865,7 @@
if (TLI.getOperationAction(ISD::CTLZ, XType) == TargetLowering::Legal) {
SDOperand Ctlz = getNode(ISD::CTLZ, XType, N1);
return getNode(ISD::SRL, XType, Ctlz,
- getConstant(MVT::getSizeInBits(XType)-1,
+ getConstant(Log2_32(MVT::getSizeInBits(XType)),
TLI.getShiftAmountTy()));
}
}
More information about the llvm-commits
mailing list