[PATCH] D131181: [AMDGPU] Fix si-annotate-control-flow for visited else branch

Yaxun Liu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 5 06:09:39 PDT 2022


yaxunl added a comment.

In D131181#3701856 <https://reviews.llvm.org/D131181#3701856>, @ruiling wrote:

> I don't think this is the right fix for the failure test. The attached test uncover some issues in passes running before annotate-cf. The test escaped structurization because there are multiple function exit blocks. This is because unify-function-exit did not unify UnreachableBlock that is uniformly reachable from entry(here: %cond.false). Then structurizecfg simply skip the whole function which is wrong. Two possible directions I can see are: a.) make the unify-divergent-exit also unify UnreachableBlock even it is uniformly reachable, this sounds more like a quick fix. b.) teach StructurizeCFG also work on function with multiple (more specifically uniformly reachable) exits.

I doubt that would help. In the lit test si-annotate-cf-else-visited.ll, the issue before this fix is that the if.else BB misses if intrinsic. This is because the depth-first BB traversal follows the order entry -> if.then -> if.end6.sink.split -> if.end6 -> cond.false ->if.else. When it visits if.else, since if.end6 has been visited, it does not insert if intrinsic. Unifying cond.false and cond.false.i8 does not change the traversal order between if.end6 and if.else. The issue is still there.


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

https://reviews.llvm.org/D131181



More information about the llvm-commits mailing list