Feedback on new flag for AMDGPU

Hello all,
at AMD we would like to add a new flag to Clang/LLVM able to print out the register usage of HIP kernels when compiling for AMDGPU.
There is already a draft for a patch here: ⚙ D95063 AMDGPU: Use optimization remarks for register usage.
We would like to avoid using -Rpass-analysis to activate this functionality, since it relies on an internal pass name, and does not convey what it will produce.
Instead of using Rpass-analysis we would like to rely on a custom flag with a more meaningful name that simply wraps this mechanism.
Since this new flag may be considered a redundant flag for Rpass-analysis, we are looking for feedbacks from the community on how to best implement this solution.

Thank you in advance.


I don’t think Community is the right tag / category to post this. Do you mind changing it to Code Generation → AMDGPU?


Thanks for the suggestion. I moved to Generation → AMDGPU but this new flag could impact the Clang frontend more than the Code Generation. Would it make more sense to move it to Clang?

This is really more of a clang question

how to best implement this solution.


I don’t understand why -Rpass-analysis=register-usage “does not convey what it will produce”.
The “internal pass name” thing is not true at all. The string (above “register-usage”) can be chosen freely unrelated to whatever pass emits this.