[PATCH] D117796: AMDGPU: Fix LiveVariables error after lowering SI_END_CF

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 9 09:01:58 PST 2022


arsenm added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SILowerControlFlow.cpp:531
+        if (VI.AliveBlocks.test(MBB.getNumber()))
+          VI.AliveBlocks.set(SplitBB->getNumber());
+        else {
----------------
ruiling wrote:
> arsenm wrote:
> > ruiling wrote:
> > > Is it possible that a value defined in MBB (and kept in MBB after split) and killed in successor block, now becomes alive in SplitBB?
> > That's covered by updating the Killed set, replaceKillInstruction
> It is something like below after split:
> ```
> MBB:
>   %a = PHI ... // this will be lowered into COPY after phi-elim
>  ...
> SplitBB:
>   ...
> Succ:
>   use(%a)
> ```
> 
> %a is not the source of SI_END_CF, here we need to insert SplitBB into AliveBlocks of %a.
> 
The lowered SI_END_CF is not inserted at its original position in the block. It is moved to the top of the block, moving it before the phis which were lowered


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

https://reviews.llvm.org/D117796



More information about the llvm-commits mailing list