diff options
author | Ruiling Song <ruiling.song@amd.com> | 2022-04-12 11:25:33 +0800 |
---|---|---|
committer | Ruiling Song <ruiling.song@amd.com> | 2022-04-14 13:30:56 +0800 |
commit | 1e01f95057a702658a88879223586fde0122f038 (patch) | |
tree | 066537953114bc05566a017264ebd0a5dd4d6cee /clang/lib/Frontend/ModuleDependencyCollector.cpp | |
parent | 7c87d75d74f3c2943b286b239ec6ff96fc5109c7 (diff) | |
download | llvm-1e01f95057a702658a88879223586fde0122f038.zip llvm-1e01f95057a702658a88879223586fde0122f038.tar.gz llvm-1e01f95057a702658a88879223586fde0122f038.tar.bz2 |
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
Diffstat (limited to 'clang/lib/Frontend/ModuleDependencyCollector.cpp')
0 files changed, 0 insertions, 0 deletions