[PATCH] D72997: [AMDGPU] SIRemoveShortExecBranches should not remove branches exiting loops

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 20 14:28:09 PST 2020


arsenm added a comment.

In D72997#1830227 <https://reviews.llvm.org/D72997#1830227>, @arsenm wrote:

> In D72997#1829191 <https://reviews.llvm.org/D72997#1829191>, @cdevadas wrote:
>
> > You are right, the s_cbranch_execz shouldn't be removed from this loop exit BB.
> >
> > But depending on the MachineLoopInfo to fix it is not good in general. There are irreducible control flows and the check may fail.
> >
> > There is already a special check in function mustRetainExeczBranch, looking for loop code if the opcode is S_CBRANCH_VCCNZ & S_CBRANCH_VCCZ.
> >  We should include S_CBRANCH_SCC0 & S_CBRANCH_SCC1 here. I hope this guarantees to be working for such cases.
> >
> > If everyone agrees, I can create a patch and fix it.
>
>
> This is probably sufficient


Also needs to catch execz/execnz/ Maybe this should juts check isBranch?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D72997





More information about the llvm-commits mailing list