[llvm] [AMDGPU] Marking super-reg as implicit-def in first spill instruction (PR #114773)

Pravin Jagtap via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 6 01:46:06 PST 2024


pravinjagtap wrote:

If we look at test [agpr-spill-to-vgpr](https://github.com/llvm/llvm-project/pull/114773/commits/7d02a1b753ca8c89b53b1affdd70127da7192172#diff-8c6f26e55101a98ffd1f7cbb87ce4cc73f99f9038fbd6bf44dd07c158d46854b), while expanding the tuple, we mark the tuple `implicit-def` and `implicit` (both) in the first spill instruction, but, we only mark it `implicit-def` (and not implicit) when we are spilling to stack through vgpr (please look at test `agpr-spill-to-vgpr-to-stack` i.e next test point). 
Is that intentional or we missed marking it `implicit` for the the second case i.e `agpr-spill-to-vgpr-to-stack` ?

As a consequence, we can see that machine cp will delete the copy in second case and not in the first case. Please take a loot at [av-spill-expansion-with-machine-cp.mir](https://github.com/llvm/llvm-project/pull/114773/commits/7d02a1b753ca8c89b53b1affdd70127da7192172#diff-3c3c57bdc32280a8ce5c314b9cefc293ea34c75a556c7817ab8c54fbab01db12)

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


More information about the llvm-commits mailing list