diff options
author | Dan Gohman <gohman@apple.com> | 2010-07-23 21:08:12 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-07-23 21:08:12 +0000 |
commit | 55e244698a30840c4938790868d2c168569f04f4 (patch) | |
tree | 6da15b2d84b52a0a4cada7cfec548b996bd4a567 /llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | |
parent | 28f167699acf28bf6996ea55e89200940bccbf2b (diff) | |
download | bcm5719-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.cpp | 5 |
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(), |