[PATCH] D122200: [AMDGPU] Split waterfall loop exec manipulation

Ruiling, Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 23 19:20:53 PDT 2022


ruiling added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIOptimizeVGPRLiveRange.cpp:570
   // after the loop. So we know that the old reg is not live throughout the
   // whole block anymore.
+  for (auto *Block : Blocks)
----------------
critson wrote:
> ruiling wrote:
> > Please help update the comment a little bit to reflect the new code. It is better to place an assert that Blocks.size() <=2 here. The reason is if we have more blocks, we can not clear the AliveBlocks bit in this simple way.
> I have updated the comment.
> Sorry, I still don't understand the Block.size() limit -- surely this works for any length waterfall loop if all the blocks are chained together linearly? 
I find that I was thinking about a situation not applicable here. The way that OldVarInfo was updated should still work. The problem here is we need to update NewVarInfo such that it may be alive in some block if there are more than two blocks. For example, if we have three blocks, the value defined in the first block and used in the third block should be alive in the second block. Seem handleVirtRegUse can help this. Please double check.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122200



More information about the llvm-commits mailing list