diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2017-03-03 16:35:57 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2017-03-03 16:35:57 +0000 |
commit | cf12b5e1a69380013b97d7ab489b0c829237cdd2 (patch) | |
tree | 6a95361a021ad766e7d42699be90c3d0ac96ba67 /llvm/lib/CodeGen | |
parent | 4edb9fd3c8398fa5dd04ecca55dc1ad3829501b1 (diff) | |
download | bcm5719-llvm-cf12b5e1a69380013b97d7ab489b0c829237cdd2.tar.gz bcm5719-llvm-cf12b5e1a69380013b97d7ab489b0c829237cdd2.zip |
Use APInt::getOneBitSet instead of APInt::getBitsSet for sign bit mask creation
Avoids all the unnecessary extra bitrange creation/shift stages.
llvm-svn: 296879
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp index 3785f402c3e..b1bfd47eb02 100644 --- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -1099,7 +1099,7 @@ bool TargetLowering::SimplifyDemandedBits(SDValue Op, EVT InVT = Op.getOperand(0).getValueType(); unsigned InBits = InVT.getScalarSizeInBits(); APInt InMask = APInt::getLowBitsSet(BitWidth, InBits); - APInt InSignBit = APInt::getBitsSet(BitWidth, InBits - 1, InBits); + APInt InSignBit = APInt::getOneBitSet(BitWidth, InBits - 1); APInt NewBits = ~InMask & NewMask; // If none of the top bits are demanded, convert this into an any_extend. |