[libc-commits] [libc] [libc] Rework the RPC interface to accept runtime wave sizes (PR #80914)

Joseph Huber via libc-commits libc-commits at lists.llvm.org
Thu Feb 8 06:50:00 PST 2024


jhuber6 wrote:

> > > The intrinsic won't actually fold out in any useful place today (only happens extremely late in the backend). You're better of linking in a wavesize constant variable
> > 
> > 
> > I did some basic tests at various optimization levels and didn't find a case where this changed resource usage via `-Rpass-analysis=kernel-resource-usage`. Looking at https://godbolt.org/z/T468dT1PY it at least seems capable of optimizing through very shallow branches, and this is pretty much just a single constant read and multiplication.
> 
> It is not folded out at the IR level, where all the useful optimizations happen. This is leaving dead code until we have very little attempt to do anything about it

The usage here simply unconditionally writes to a variable. The absolute worst case scenario here is a single extra register to hold the value instead of using it as a constant. However this doesn't seem to be the case even at `O1` compared to the old version that used a template parameter so I'm not overly concerned compared to the complexity of the ROCm device libraries for this.

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


More information about the libc-commits mailing list