summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-07-23 21:08:12 +0000
committerDan Gohman <gohman@apple.com>2010-07-23 21:08:12 +0000
commit55e244698a30840c4938790868d2c168569f04f4 (patch)
tree6da15b2d84b52a0a4cada7cfec548b996bd4a567 /llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
parent28f167699acf28bf6996ea55e89200940bccbf2b (diff)
downloadbcm5719-llvm-55e244698a30840c4938790868d2c168569f04f4.tar.gz
bcm5719-llvm-55e244698a30840c4938790868d2c168569f04f4.zip
Use the proper type for shift counts. This fixes a bootstrap error.
llvm-svn: 109265
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index 389f2ea5ff1..12185a3d4c3 100644
--- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
@@ -1380,9 +1380,12 @@ bool TargetLowering::SimplifyDemandedBits(SDValue Op,
BitWidth - InnerVT.getSizeInBits()) &
DemandedMask) == 0 &&
isTypeDesirableForOp(ISD::SHL, InnerVT)) {
+ EVT ShTy = getShiftAmountTy();
+ if (!APInt(BitWidth, ShAmt).isIntN(ShTy.getSizeInBits()))
+ ShTy = InnerVT;
SDValue NarrowShl =
TLO.DAG.getNode(ISD::SHL, dl, InnerVT, InnerOp,
- TLO.DAG.getConstant(ShAmt, InnerVT));
+ TLO.DAG.getConstant(ShAmt, ShTy));
return
TLO.CombineTo(Op,
TLO.DAG.getNode(ISD::ANY_EXTEND, dl, Op.getValueType(),
OpenPOWER on IntegriCloud