diff options
author | Chris Lattner <sabre@nondot.org> | 2006-03-05 19:52:57 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-03-05 19:52:57 +0000 |
commit | c726a5c31fee139f2ea9ddf7760c8a591bd8a73f (patch) | |
tree | 4b40b5373f1b3ba1fc4ba58d5cd217c413306b2d /llvm/lib/Target/TargetLowering.cpp | |
parent | c610e62e46e9c6e0c9714fc9d58f40d14900ebd2 (diff) | |
download | bcm5719-llvm-c726a5c31fee139f2ea9ddf7760c8a591bd8a73f.tar.gz bcm5719-llvm-c726a5c31fee139f2ea9ddf7760c8a591bd8a73f.zip |
Do not fold (add (shl x, c1), (shl c2, c1)) -> (shl (add x, c2), c1),
we want to canonicalize the other way.
llvm-svn: 26547
Diffstat (limited to 'llvm/lib/Target/TargetLowering.cpp')
-rw-r--r-- | llvm/lib/Target/TargetLowering.cpp | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/llvm/lib/Target/TargetLowering.cpp b/llvm/lib/Target/TargetLowering.cpp index 27e9b04aaa6..7a4d269f799 100644 --- a/llvm/lib/Target/TargetLowering.cpp +++ b/llvm/lib/Target/TargetLowering.cpp @@ -580,24 +580,6 @@ bool TargetLowering::SimplifyDemandedBits(SDOperand Op, uint64_t DemandedMask, 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: |