[PATCH] D145323: AMDGPU: Fix LiveVariables verifier error for values defined before SI_END_CF

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 8 17:15:09 PST 2023


arsenm added inline comments.


================
Comment at: llvm/test/CodeGen/AMDGPU/lower-control-flow-live-variables-update.mir:248
+    %6:vgpr_32 = PHI %7, %bb.2, %1, %bb.0
+    %8:sreg_64 = S_MOV_B64 1
+    SI_END_CF killed %4, implicit-def $exec, implicit-def dead $scc, implicit $exec
----------------
ruiling wrote:
> arsenm wrote:
> > ruiling wrote:
> > > Can we teach the previous pass to insert the instruction after prologue instruction?  like through `SkipPHIsAndLabels()`.
> > I think the prolog logic gets too complicated and we would need to scan through the entire block. Terminator placement is universally understood 
> I don't see why we need to scan through the entire block?
We currently treat the prolog as instructions that modify exec. The problem here is spills get inserted which don’t modify exec. In case a prolog appears anywhere, we would need to scan the whole block. The prolog concept is really frail as it is. We’d be better off removing it given that we sometimes need to insert more instructions in the prolog 


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

https://reviews.llvm.org/D145323



More information about the llvm-commits mailing list