[PATCH] D46340: AMDGPU/SI: Handle infinite loop for the structurizer to work with CFG with infinite loops.

Changpeng Fang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 3 16:40:37 PDT 2018


cfang updated this revision to Diff 145114.
cfang added a comment.

Handle the case that the infinite loop is controlled by a conditional branch. In such case, the two edges of the branch
are both backedges.

We create a "TransitionBB" to hold the conditional branch. And at the place of the original conditional branch, 
we create a new conditional branch with the conditional always true, the the true edge connects to the TransitionBB, and the false edge to
the dummy return block.

Thanks to Nicolai for pointing out the case as well as the approach.


https://reviews.llvm.org/D46340

Files:
  lib/Target/AMDGPU/AMDGPUUnifyDivergentExitNodes.cpp
  test/CodeGen/AMDGPU/branch-relaxation.ll
  test/CodeGen/AMDGPU/cf-loop-on-constant.ll
  test/CodeGen/AMDGPU/infinite-loop.ll
  test/CodeGen/AMDGPU/nested-loop-conditions.ll
  test/CodeGen/AMDGPU/si-annotate-cf.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46340.145114.patch
Type: text/x-patch
Size: 10317 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180503/21e1f402/attachment.bin>


More information about the llvm-commits mailing list