[PATCH] D72997: [AMDGPU] SIRemoveShortExecBranches should not remove branches exiting loops
Christudasan Devadasan via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 20 04:07:57 PST 2020
cdevadas added a comment.
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.
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