diff options
author | Jakub Jelinek <jakub@redhat.com> | 2024-03-14 09:57:13 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2024-03-14 09:57:13 +0100 |
commit | 8f6e0814b4bfd0a399055e9214562aebfcd902ad (patch) | |
tree | b4f04d891892d741601aa673e01efbecbe26fa3f /libcpp | |
parent | 618e34d56cc38e9c3ae95a413228068e53ed76bb (diff) | |
download | gcc-8f6e0814b4bfd0a399055e9214562aebfcd902ad.zip gcc-8f6e0814b4bfd0a399055e9214562aebfcd902ad.tar.gz gcc-8f6e0814b4bfd0a399055e9214562aebfcd902ad.tar.bz2 |
gimple-iterator: Some gsi_safe_insert_*before fixes
When trying to use the gsi_safe_insert*before APIs in bitint lowering,
I've discovered 3 issues and the following patch addresses those:
1) both split_block and split_edge update CDI_DOMINATORS if they are
available, but because edge_before_returns_twice_call first splits
and then adds an extra EDGE_ABNORMAL edge and then removes another
one, the immediate dominators of both the new bb and the bb with
returns_twice call need to change
2) the new EDGE_ABNORMAL edge had uninitialized probability; this patch
copies the probability from the edge that is going to be removed
and similarly copies other flags (EDGE_EXECUTABLE, EDGE_DFS_BACK,
EDGE_IRREDUCIBLE_LOOP etc.)
3) if edge_before_returns_twice_call splits a block, then the bb with
returns_twice call changes, so the gimple_stmt_iterator for it is
no longer accurate, it points to the right statement, but gsi_bb
and gsi_seq are no longer correct; the patch updates it
2024-03-14 Jakub Jelinek <jakub@redhat.com>
* gimple-iterator.cc (edge_before_returns_twice_call): Copy all
flags and probability from ad_edge to e edge. If CDI_DOMINATORS
are computed, recompute immediate dominator of other_edge->src
and other_edge->dest.
(gsi_safe_insert_before, gsi_safe_insert_seq_before): Update *iter
for the returns_twice call case to the gsi_for_stmt (stmt) to deal
with update it for bb splitting.
Diffstat (limited to 'libcpp')
0 files changed, 0 insertions, 0 deletions