[PATCH] D28351: AMDGPU: Remove spurious out branches after a kill

Nicolai Hähnle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 13 06:15:06 PST 2017


nhaehnle added a comment.

The approach is unfortunately not correct in general as far as I can tell. Say you have

  SI_KILL_TERMINATOR ...
  S_BRANCH BB#other

BB#next:

To be honest, it looks to me like this is a bug (or at least a serious brittleness) in the code anyway, and we're probably getting lucky because the block ordering code lays blocks out in a way that works well for us. What I mean is that AFAIU, this will first become:

  V_CMPX
  S_CBRANCH_EXECNZ BB#next
  S_BRANCH BB#other

skip_block:

  EXP
  S_ENDPGM

BB#next:

... and then your change would remove the branch to BB#other.


https://reviews.llvm.org/D28351





More information about the llvm-commits mailing list