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

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 21 02:07:27 PST 2022


foad added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SILowerControlFlow.cpp:516
+    if (SplitBB != &MBB) {
+      for (unsigned i = 0, e = MRI->getNumVirtRegs(); i != e; ++i) {
+        Register Reg = Register::index2VirtReg(i);
----------------
Would it make sense to move this code into splitAt, i.e. have it update LV just like it updates LIS?


================
Comment at: llvm/lib/Target/AMDGPU/SILowerControlFlow.cpp:522
+          VI.AliveBlocks.set(SplitBB->getNumber());
+        else if (LV->isPHIJoin(Reg)) {
+          // Pass through live phis
----------------
This is a shame. isPHIJoin hasn't been used since rGfac770b865f59cbe615241dad153ad20d5138b9e 9 years ago and I was hoping to remove it.


================
Comment at: llvm/lib/Target/AMDGPU/SILowerControlFlow.cpp:526
+            if (Kill->getParent() == SplitBB)
+              VI.AliveBlocks.set(MBB.getNumber());
+        }
----------------
Why do you only need to do this for phi join regs? Couldn't any random register have its last use in SplitBB?


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

https://reviews.llvm.org/D117796



More information about the llvm-commits mailing list