[llvm] [SPIRV]Implementing PopCount for 16 and 64 bits (PR #191283)

via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 9 14:38:52 PDT 2026


=?utf-8?q?João?= Saffran <joaosaffranllvm at gmail.com>,Joao Saffran
 <joaosaffranllvm at gmail.com>,Joao Saffran <joaosaffranllvm at gmail.com>,Joao
 Saffran <joaosaffranllvm at gmail.com>,Joao Saffran <joaosaffranllvm at gmail.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/191283 at github.com>


================
@@ -1020,7 +1048,7 @@ bool SPIRVInstructionSelector::spvSelect(Register ResVReg,
     return selectIToF(ResVReg, ResType, I, false, SPIRV::OpConvertUToF);
 
   case TargetOpcode::G_CTPOP:
-    return selectUnOp(ResVReg, ResType, I, SPIRV::OpBitCount);
+    return selectPopCount(ResVReg, ResType, I, SPIRV::OpBitCount);
----------------
joaosaffran wrote:

I am not familiar enough with OpenCL to be sure. The goal of this PR is make sure we get rid of this https://vulkan.lunarg.com/doc/view/1.4.313.1/windows/antora/spec/latest/appendices/spirvenv.html#VUID-StandaloneSpirv-Base-04781 validation issue. I would appreciate @s-perron's input, or the input of anyone who is more familiar with spirv, into this topic

https://github.com/llvm/llvm-project/pull/191283


More information about the llvm-commits mailing list