diff options
author | Kazu Hirata <kazu@google.com> | 2023-01-22 12:48:51 -0800 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2023-01-22 12:48:51 -0800 |
commit | caa99a01f5dd2f865df318a2f93abc811273a25d (patch) | |
tree | 1c848ea5a64f404c933aec6b396eed33a43bf885 /llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp | |
parent | 0b5cb41dd07cc7cde9330d6098ebd74387f3df7f (diff) | |
download | llvm-caa99a01f5dd2f865df318a2f93abc811273a25d.zip llvm-caa99a01f5dd2f865df318a2f93abc811273a25d.tar.gz llvm-caa99a01f5dd2f865df318a2f93abc811273a25d.tar.bz2 |
Use llvm::popcount instead of llvm::countPopulation(NFC)
Diffstat (limited to 'llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp')
-rw-r--r-- | llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp b/llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp index d881b0b..2b5ca33 100644 --- a/llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp +++ b/llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp @@ -323,7 +323,7 @@ static unsigned getOpcodeWidth(const MachineInstr &MI, const SIInstrInfo &TII) { if (TII.isMIMG(MI)) { uint64_t DMaskImm = TII.getNamedOperand(MI, AMDGPU::OpName::dmask)->getImm(); - return countPopulation(DMaskImm); + return llvm::popcount(DMaskImm); } if (TII.isMTBUF(Opc)) { return AMDGPU::getMTBUFElements(Opc); @@ -1784,7 +1784,7 @@ unsigned SILoadStoreOptimizer::getNewOpcode(const CombineInfo &CI, return AMDGPU::FLAT_STORE_DWORDX4; } case MIMG: - assert((countPopulation(CI.DMask | Paired.DMask) == Width) && + assert(((unsigned)llvm::popcount(CI.DMask | Paired.DMask) == Width) && "No overlaps"); return AMDGPU::getMaskedMIMGOp(CI.I->getOpcode(), Width); } @@ -1793,8 +1793,9 @@ unsigned SILoadStoreOptimizer::getNewOpcode(const CombineInfo &CI, std::pair<unsigned, unsigned> SILoadStoreOptimizer::getSubRegIdxs(const CombineInfo &CI, const CombineInfo &Paired) { - assert((CI.InstClass != MIMG || (countPopulation(CI.DMask | Paired.DMask) == - CI.Width + Paired.Width)) && + assert((CI.InstClass != MIMG || + ((unsigned)llvm::popcount(CI.DMask | Paired.DMask) == + CI.Width + Paired.Width)) && "No overlaps"); unsigned Idx0; |