[all-commits] [llvm/llvm-project] db3316: [AMDGPU] Add islands to StructurizeCFG

Robert Imschweiler via All-commits all-commits at lists.llvm.org
Thu Jun 4 12:49:02 PDT 2026


  Branch: refs/heads/users/ro-i/structurize-islands
  Home:   https://github.com/llvm/llvm-project
  Commit: db33161469f5619de468ec95f75d721fccbafd2d
      https://github.com/llvm/llvm-project/commit/db33161469f5619de468ec95f75d721fccbafd2d
  Author: Robert Imschweiler <robert.imschweiler at amd.com>
  Date:   2026-06-04 (Thu, 04 Jun 2026)

  Changed paths:
    M llvm/lib/Transforms/Scalar/StructurizeCFG.cpp
    M llvm/test/CodeGen/AMDGPU/callbr-intrinsics.ll
    M llvm/test/CodeGen/AMDGPU/callbr.ll
    M llvm/test/CodeGen/AMDGPU/infinite-loop.ll
    M llvm/test/CodeGen/AMDGPU/si-annotate-nested-control-flows.ll
    M llvm/test/CodeGen/AMDGPU/si-unify-exit-multiple-unreachables.ll
    M llvm/test/Transforms/StructurizeCFG/callbr.ll

  Log Message:
  -----------
  [AMDGPU] Add islands to StructurizeCFG

Handle an "island", i.e. a block whose terminator is not rewritable
(e.g., a callbr) in this context and considered immutable from this
pass's perspective.

The island is left untouched; its edges are split into forwarders that
converge at a new Flow block (ExitFlow). The callbr's runtime target
choice is recovered as a per-target i1 "sel" phi and re-dispatched by a
structured ladder of 2-way branches:

                 callbr
               /   |   \
           fwd_0 fwd_1 fwd_2      forwarders (intermediate target blocks)
               \   |   /
            ExitFlow (Flow_0) -- sel_0? --> real_0
                  |  else
                Flow_1 --------- sel_1? --> real_1
                  |  else
             real_2
           or Flow_2 (if real_1 == real_2) ------> real_2   (shared last target)



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list