aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-03-05 19:52:57 +0000
committerChris Lattner <sabre@nondot.org>2006-03-05 19:52:57 +0000
commitc1d9f1de41b26769752224829987a6aa06fe4b87 (patch)
tree6c95743f71a929bdd174ced70f8c92515a5ec375
parent52676510577a5fdab082eb0c065ae151903d9dcf (diff)
downloadexternal_llvm-c1d9f1de41b26769752224829987a6aa06fe4b87.zip
external_llvm-c1d9f1de41b26769752224829987a6aa06fe4b87.tar.gz
external_llvm-c1d9f1de41b26769752224829987a6aa06fe4b87.tar.bz2
Do not fold (add (shl x, c1), (shl c2, c1)) -> (shl (add x, c2), c1),
we want to canonicalize the other way. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26547 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/SelectionDAG/TargetLowering.cpp18
1 files changed, 0 insertions, 18 deletions
diff --git a/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index 27e9b04..7a4d269 100644
--- a/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/lib/CodeGen/SelectionDAG/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: