[PATCH] D77198: Introduce fix-irreducible pass

Sameer Sahasrabuddhe via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 1 01:36:56 PDT 2020


sameerds created this revision.
Herald added subscribers: llvm-commits, kerbowa, hiraditya, tpr, mgorny, nhaehnle, jvesely, arsenm.
Herald added a project: LLVM.
sameerds added reviewers: arsenm, nhaehnle, tpr.
Herald added a subscriber: wdng.

An irreducible SCC is one which has multiple "header" blocks, i.e., blocks
with control-flow edges incident from outside the SCC. This pass converts an
irreducible SCC into a natural loop by introducing a single new header
block and redirecting all the edges on the original headers to this
new block.

This is a useful workaround for a limitation in the structurizer
which, which produces incorrect control flow in the presence of
irreducible regions. The AMDGPU backend provides an option to
enable this pass before the structurizer, which may eventually be
enabled by default.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D77198

Files:
  llvm/include/llvm/Analysis/LoopInfo.h
  llvm/include/llvm/InitializePasses.h
  llvm/include/llvm/LinkAllPasses.h
  llvm/include/llvm/Transforms/Utils.h
  llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
  llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
  llvm/lib/Transforms/Utils/CMakeLists.txt
  llvm/lib/Transforms/Utils/FixIrreducible.cpp
  llvm/lib/Transforms/Utils/UnifyLoopExits.cpp
  llvm/lib/Transforms/Utils/Utils.cpp
  llvm/test/Transforms/FixIrreducible/basic.ll
  llvm/test/Transforms/FixIrreducible/nested.ll
  llvm/test/Transforms/FixIrreducible/switch.ll
  llvm/test/Transforms/StructurizeCFG/workarounds/needs-fix-reducible.ll
  llvm/test/Transforms/StructurizeCFG/workarounds/needs-fr-ule.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77198.254106.patch
Type: text/x-patch
Size: 53383 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200401/a88e66f7/attachment.bin>


More information about the llvm-commits mailing list