[llvm] [AMDGPU]: Rewrite mbcnt_lo/mbcnt_hi to work item ID where applicable (PR #160496)

Juan Manuel Martinez CaamaƱo via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 14 08:56:23 PDT 2025


================
@@ -2113,6 +2119,181 @@ INITIALIZE_PASS_DEPENDENCY(UniformityInfoWrapperPass)
 INITIALIZE_PASS_END(AMDGPUCodeGenPrepare, DEBUG_TYPE, "AMDGPU IR optimizations",
                     false, false)
 
+bool AMDGPUCodeGenPrepareImpl::visitMbcntLo(IntrinsicInst &I) {
----------------
jmmartinez wrote:

It's ok to mark the method as `const` since `this` is not changing. To signal/prevent IR changes we set (or not) `const` on the input parameters (in this case, `InstrinsicInst &I`).

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


More information about the llvm-commits mailing list