[llvm-commits] CVS: llvm/lib/Target/TargetLowering.cpp
Chris Lattner
lattner at cs.uiuc.edu
Sun Mar 5 11:53:09 PST 2006
Changes in directory llvm/lib/Target:
TargetLowering.cpp updated: 1.43 -> 1.44
---
Log message:
Do not fold (add (shl x, c1), (shl c2, c1)) -> (shl (add x, c2), c1),
we want to canonicalize the other way.
---
Diffs of the changes: (+0 -18)
TargetLowering.cpp | 18 ------------------
1 files changed, 18 deletions(-)
Index: llvm/lib/Target/TargetLowering.cpp
diff -u llvm/lib/Target/TargetLowering.cpp:1.43 llvm/lib/Target/TargetLowering.cpp:1.44
--- llvm/lib/Target/TargetLowering.cpp:1.43 Fri Mar 3 00:58:59 2006
+++ llvm/lib/Target/TargetLowering.cpp Sun Mar 5 13:52:57 2006
@@ -580,24 +580,6 @@
CountTrailingZeros_64(~KnownZero2));
KnownZero = (1ULL << KnownZeroOut) - 1;
KnownOne = 0;
-
- SDOperand SH = Op.getOperand(0);
- // fold (add (shl x, c1), (shl c2, c1)) -> (shl (add x, c2), c1)
- if (KnownZero && SH.getOpcode() == ISD::SHL && SH.Val->hasOneUse() &&
- Op.Val->hasOneUse()) {
- if (ConstantSDNode *SA = dyn_cast<ConstantSDNode>(SH.getOperand(1))) {
- MVT::ValueType VT = Op.getValueType();
- unsigned ShiftAmt = SA->getValue();
- uint64_t AddAmt = AA->getValue();
- uint64_t AddShr = AddAmt >> ShiftAmt;
- if (AddAmt == (AddShr << ShiftAmt)) {
- SDOperand ADD = TLO.DAG.getNode(ISD::ADD, VT, SH.getOperand(0),
- TLO.DAG.getConstant(AddShr, VT));
- SDOperand SHL = TLO.DAG.getNode(ISD::SHL, VT, ADD,SH.getOperand(1));
- return TLO.CombineTo(Op, SHL);
- }
- }
- }
}
break;
case ISD::SUB:
More information about the llvm-commits
mailing list