[clang] [llvm] [HLSL] Add wave prefix count bits function (PR #178059)

Tex Riddell via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 26 16:54:19 PST 2026


https://github.com/tex3d commented:

I think we should treat the DXIL op `WavePrefixBitCount` as completely separate from the other `WavePrefix` op that uses `WaveOpKind`. The fact that they share the same OpCodeClass in DXC's DXIL definition was a mistake - there's a [comment about this](https://github.com/microsoft/DirectXShaderCompiler/blob/df50f51f8fcbb19cfefa3d7135256af6c55dd9c3/utils/hct/hctdb.py#L3568-L3570) in hctdb.py. They don't have a compatible signature.

That should get rid of the hard-coded `136` in the def and use of `getPrefixOpIntrinsic` in `CGHLSLBuiltins.cpp`.

Note that the test generates a bad DXIL op too.

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


More information about the llvm-commits mailing list