llvm-project/llvm/test/Transforms/StructurizeCFG
Ruiling Song 1e01f95057 LowerSwitch: Avoid inserting NewDefault block
The NewDefault was used to simplify the updating of PHI nodes, but it
causes some inefficiency for target that will run structurizer later. For
example, for a simple two-case switch, the extra NewDefault is causing
unstructured CFG like:

        O
       / \
      O   O
     / \ / \
    C1  ND C2
     \  |  /
      \ | /
        D

The change is to avoid the ND(NewDefault) block, that is we will get a
structured CFG for above example like:

        O
       / \
      /   \
     O     O
    / \   / \
   C1  \ /  C2
    \-> D <-/

The IR change introduced by this patch should be trivial to other targets,
so I am doing this unconditionally.

Fall-through among the cases will also cause unstructured CFG, but it need
more work and will be addressed in a separate change.

Reviewed by: arsenm

Differential Revision: https://reviews.llvm.org/D123607
2022-04-14 13:30:56 +08:00
..
AMDGPU [StructurizeCFG] Clean up some boolean not instructions 2022-02-01 09:35:37 +00:00
workarounds
branch-on-argument.ll
bug36015.ll [StructurizeCFG] Clean up some boolean not instructions 2022-02-01 09:35:37 +00:00
interleaved-loop-order.ll LowerSwitch: Avoid inserting NewDefault block 2022-04-14 13:30:56 +08:00
invert-condition.ll [StructurizeCFG] Fix boolean not bug 2022-02-22 17:36:20 +00:00
invert-constantexpr.ll [StructurizeCFG] Clean up some boolean not instructions 2022-02-01 09:35:37 +00:00
loop-continue-phi.ll
loop-multiple-exits.ll
nested-loop-order.ll
nested-loop-subregion.ll
no-branch-to-entry.ll
one-loop-multiple-backedges.ll [StructurizeCFG] Clean up some boolean not instructions 2022-02-01 09:35:37 +00:00
post-order-traversal-bug.ll [StructurizeCFG] Clean up some boolean not instructions 2022-02-01 09:35:37 +00:00
rebuild-ssa-infinite-loop-inseltpoison.ll
rebuild-ssa-infinite-loop.ll
switch.ll