[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:18:49 PST 2020


arsenm added a comment.

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


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