diff options
author | Maciej W. Rozycki <macro@orcam.me.uk> | 2025-03-30 15:24:50 +0100 |
---|---|---|
committer | Maciej W. Rozycki <macro@orcam.me.uk> | 2025-03-30 15:24:50 +0100 |
commit | 89f03fd59fbe151b2efee354c616862a9b194ed9 (patch) | |
tree | 9c9fb1e7632a622a8f652741728216f429702be7 /gcc | |
parent | 47a48c7f42b5ad908f087bf612615632319cf445 (diff) | |
download | gcc-89f03fd59fbe151b2efee354c616862a9b194ed9.zip gcc-89f03fd59fbe151b2efee354c616862a9b194ed9.tar.gz gcc-89f03fd59fbe151b2efee354c616862a9b194ed9.tar.bz2 |
IRA+LRA: Let the backend request to split basic blocks
The next change for Alpha will produce extra labels and branches in
reload, which in turn requires basic blocks to be split at completion.
We do this already for functions that can trap, so just extend the
arrangement with a flag for the backend to use whenever it finds it
necessary.
gcc/
* function.h (struct function): Add
`split_basic_blocks_after_reload' member.
* lra.cc (lra): Handle it.
* reload1.cc (reload): Likewise.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/function.h | 3 | ||||
-rw-r--r-- | gcc/lra.cc | 6 | ||||
-rw-r--r-- | gcc/reload1.cc | 6 |
3 files changed, 11 insertions, 4 deletions
diff --git a/gcc/function.h b/gcc/function.h index e8aa52f..2260d67 100644 --- a/gcc/function.h +++ b/gcc/function.h @@ -449,6 +449,9 @@ struct GTY(()) function { /* Set for artificial function created for [[assume (cond)]]. These should be GIMPLE optimized, but not expanded to RTL. */ unsigned int assume_function : 1; + + /* Nonzero if reload will have to split basic blocks. */ + unsigned int split_basic_blocks_after_reload : 1; }; /* Add the decl D to the local_decls list of FUN. */ @@ -2615,8 +2615,10 @@ lra (FILE *f, int verbose) inserted_p = fixup_abnormal_edges (); - /* We've possibly turned single trapping insn into multiple ones. */ - if (cfun->can_throw_non_call_exceptions) + /* Split basic blocks if we've possibly turned single trapping insn + into multiple ones or otherwise the backend requested to do so. */ + if (cfun->can_throw_non_call_exceptions + || cfun->split_basic_blocks_after_reload) { auto_sbitmap blocks (last_basic_block_for_fn (cfun)); bitmap_ones (blocks); diff --git a/gcc/reload1.cc b/gcc/reload1.cc index fe4fe58..64ec74e 100644 --- a/gcc/reload1.cc +++ b/gcc/reload1.cc @@ -1272,8 +1272,10 @@ reload (rtx_insn *first, int global) inserted = fixup_abnormal_edges (); - /* We've possibly turned single trapping insn into multiple ones. */ - if (cfun->can_throw_non_call_exceptions) + /* Split basic blocks if we've possibly turned single trapping insn + into multiple ones or otherwise the backend requested to do so. */ + if (cfun->can_throw_non_call_exceptions + || cfun->split_basic_blocks_after_reload) { auto_sbitmap blocks (last_basic_block_for_fn (cfun)); bitmap_ones (blocks); |