diff options
author | Evan Cheng <evan.cheng@apple.com> | 2012-12-06 19:13:27 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2012-12-06 19:13:27 +0000 |
commit | 9ec512d768cda982ef69c43a356864edbe60b8ee (patch) | |
tree | 1329dfb5d4e0e492cdbb1804c52c9434580471df /llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | |
parent | bba0a95373f98975def49ab93d0ad6071b8bf767 (diff) | |
download | bcm5719-llvm-9ec512d768cda982ef69c43a356864edbe60b8ee.tar.gz bcm5719-llvm-9ec512d768cda982ef69c43a356864edbe60b8ee.zip |
Replace r169459 with something safer. Rather than having computeMaskedBits to
understand target implementation of any_extend / extload, just generate
zero_extend in place of any_extend for liveouts when the target knows the
zero_extend will be implicit (e.g. ARM ldrb / ldrh) or folded (e.g. x86 movz).
rdar://12771555
llvm-svn: 169536
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 631449ca79a..7dd57d54201 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -1930,8 +1930,6 @@ void SelectionDAG::ComputeMaskedBits(SDValue Op, APInt &KnownZero, KnownZero |= APInt::getHighBitsSet(BitWidth, BitWidth - MemBits); } else if (const MDNode *Ranges = LD->getRanges()) { computeMaskedBitsLoad(*Ranges, KnownZero); - } else if (ISD::isEXTLoad(Op.getNode())) { - TLI.computeMaskedBitsForAnyExtend(Op, KnownZero, KnownOne, *this, Depth); } return; } @@ -1974,7 +1972,13 @@ void SelectionDAG::ComputeMaskedBits(SDValue Op, APInt &KnownZero, return; } case ISD::ANY_EXTEND: { - TLI.computeMaskedBitsForAnyExtend(Op, KnownZero, KnownOne, *this, Depth); + EVT InVT = Op.getOperand(0).getValueType(); + unsigned InBits = InVT.getScalarType().getSizeInBits(); + KnownZero = KnownZero.trunc(InBits); + KnownOne = KnownOne.trunc(InBits); + ComputeMaskedBits(Op.getOperand(0), KnownZero, KnownOne, Depth+1); + KnownZero = KnownZero.zext(BitWidth); + KnownOne = KnownOne.zext(BitWidth); return; } case ISD::TRUNCATE: { |