[PATCH] D117057: [AMDGPU] Annotate functions with inline asm using agprs

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 11 18:00:27 PST 2022


rampitec added a comment.

In D117057#3236020 <https://reviews.llvm.org/D117057#3236020>, @arsenm wrote:

> In D117057#3235661 <https://reviews.llvm.org/D117057#3235661>, @rampitec wrote:
>
>> In D117057#3235626 <https://reviews.llvm.org/D117057#3235626>, @rampitec wrote:
>>
>>> I guess I can run this code in the `AMDGPUDAGToDAGISel::runOnMachineFunction` or even `SIMachineFunctionInfo` constructor and skip the attribution.
>>
>> The downside is that I have to scan all instructions for that, and AMDGPUAnnotateKernelFeatures already does that. Where are you planning to move its code?
>
> AMDGPUAttributor. If this were to be an attribute, which is pretty ugly, it should be the inverse. Why can't you just select to AGPRs, and later we can adjust the register classes if necessary?

Because it means changing instructions, which is untrivial in some cases. I'd better select it right.

Anyhow, I have moved the code, it takes a yet another scan over the instructions which has to happen somewhere anyway. If we have a better scan place in the future it will be easy to do, attribute or not.

An attribute may have an additional benefit to allow allocation shift to happen in functions as well, but I am not sure how practically interesting is it to use a wave wide instruction in a function.

That said, I will still need a parent of this change to work properly because otherwise we still have misrepresented RC for inline asm.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D117057/new/

https://reviews.llvm.org/D117057



More information about the llvm-commits mailing list