diff options
author | Craig Topper <craig.topper@gmail.com> | 2017-05-12 17:20:30 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2017-05-12 17:20:30 +0000 |
commit | 8df66c602a3186d4c4dd680693930c1b8d5ff4fe (patch) | |
tree | 55059f7ad4fc6052ebd901af6bf7e4346308b217 /llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp | |
parent | 999f74ad59d4f393014a051035b33383eb71c57a (diff) | |
download | bcm5719-llvm-8df66c602a3186d4c4dd680693930c1b8d5ff4fe.tar.gz bcm5719-llvm-8df66c602a3186d4c4dd680693930c1b8d5ff4fe.zip |
[KnownBits] Add bit counting methods to KnownBits struct and use them where possible
This patch adds min/max population count, leading/trailing zero/one bit counting methods.
The min methods return answers based on bits that are known without considering unknown bits. The max methods give answers taking into account the largest count that unknown bits could give.
Differential Revision: https://reviews.llvm.org/D32931
llvm-svn: 302925
Diffstat (limited to 'llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp')
-rw-r--r-- | llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp b/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp index f3bcfbb25bb..f80652b8737 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp @@ -2305,7 +2305,7 @@ static bool isU24(SDValue Op, SelectionDAG &DAG) { EVT VT = Op.getValueType(); DAG.computeKnownBits(Op, Known); - return (VT.getSizeInBits() - Known.Zero.countLeadingOnes()) <= 24; + return (VT.getSizeInBits() - Known.countMinLeadingZeros()) <= 24; } static bool isI24(SDValue Op, SelectionDAG &DAG) { |