aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2008-03-18 22:29:51 +0000
committerBill Wendling <isanbard@gmail.com>2008-03-18 22:29:51 +0000
commit2974e49019b05ee4bec175a8d9cc736a512e3254 (patch)
tree977638f169299d813a8f642cdb966981d0077c23 /lib/CodeGen/SelectionDAG/DAGCombiner.cpp
parentd3bf1aef3f1bfba362b71e72f416100a82d5b5db (diff)
Temporarily revert r48491. It's breaking test/CodeGen/X86/xorl.ll.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48510 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/DAGCombiner.cpp26
1 files changed, 0 insertions, 26 deletions
diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 737d9661fd..acc00fd58b 100644
--- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -2374,32 +2374,6 @@ SDOperand DAGCombiner::visitSRA(SDNode *N) {
DAG.getValueType(EVT));
}
- // fold sra (shl X, m), result_size - n
- // -> (sign_extend (trunc (shl X, result_size - n - m))) for
- // result_size - n != m. If truncate is free for the target sext(shl) is
- // likely to result in better code.
- if (N0.getOpcode() == ISD::SHL) {
- // Get the two constanst of the shifts, CN0 = m, CN = n.
- const ConstantSDNode *N01C = dyn_cast<ConstantSDNode>(N0.getOperand(1));
- if (N01C && N1C) {
- // Determine if the truncate type's bitsize would correspond to
- // an integer type for this target.
- unsigned VTValSize = MVT::getSizeInBits(VT);
- MVT::ValueType TruncVT = MVT::getIntegerType(VTValSize - N1C->getValue());
- unsigned ShiftAmt = N1C->getValue() - N01C->getValue();
-
- // If the shift wouldn't be a noop, the truncated type is an actual type,
- // and the truncate is free, then proceed with the transform.
- if (ShiftAmt != 0 &&
- !MVT::isExtendedVT(TruncVT) && TLI.isTruncateFree(VT, TruncVT)) {
- SDOperand Amt = DAG.getConstant(ShiftAmt, TLI.getShiftAmountTy());
- SDOperand Shift = DAG.getNode(ISD::SRL, VT, N0.getOperand(0), Amt);
- SDOperand Trunc = DAG.getNode(ISD::TRUNCATE, TruncVT, Shift);
- return DAG.getNode(ISD::SIGN_EXTEND, N->getValueType(0), Trunc);
- }
- }
- }
-
// fold (sra (sra x, c1), c2) -> (sra x, c1+c2)
if (N1C && N0.getOpcode() == ISD::SRA) {
if (ConstantSDNode *C1 = dyn_cast<ConstantSDNode>(N0.getOperand(1))) {