diff options
author | Craig Topper <craig.topper@intel.com> | 2017-09-20 23:48:56 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@intel.com> | 2017-09-20 23:48:56 +0000 |
commit | eb0f71f2328a04ebafa0791700ca682647157ca4 (patch) | |
tree | c80bb09bc1530da46f0d01074ddc030af5391b7c /llvm/lib/CodeGen | |
parent | 79cd5d0080b8173b80c7161a420b800b51f93e86 (diff) | |
download | bcm5719-llvm-eb0f71f2328a04ebafa0791700ca682647157ca4.tar.gz bcm5719-llvm-eb0f71f2328a04ebafa0791700ca682647157ca4.zip |
[SelectionDAG] Use APInt::getActivebits instead of Bitwidth - leading zeros.
llvm-svn: 313839
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 8652df7bbd7..3f658fa0376 100644 --- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -408,7 +408,7 @@ bool TargetLowering::ShrinkDemandedOp(SDValue Op, unsigned BitWidth, // Search for the smallest integer type with free casts to and from // Op's type. For expedience, just check power-of-2 integer types. const TargetLowering &TLI = DAG.getTargetLoweringInfo(); - unsigned DemandedSize = BitWidth - Demanded.countLeadingZeros(); + unsigned DemandedSize = Demanded.getActiveBits(); unsigned SmallVTBits = DemandedSize; if (!isPowerOf2_32(SmallVTBits)) SmallVTBits = NextPowerOf2(SmallVTBits); |