summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2017-03-03 16:35:57 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2017-03-03 16:35:57 +0000
commitcf12b5e1a69380013b97d7ab489b0c829237cdd2 (patch)
tree6a95361a021ad766e7d42699be90c3d0ac96ba67 /llvm/lib/CodeGen
parent4edb9fd3c8398fa5dd04ecca55dc1ad3829501b1 (diff)
downloadbcm5719-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.cpp2
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.
OpenPOWER on IntegriCloud