This series makes end_sequence return the insn sequence that
it ends, so that callers don't need to call get_insns separately.
It also updates many callers to take advantage of the new return value.

Although this kind of refactoring/API change can in general make
backports harder, I think in this case it would be enough to backport
the first patch along with the first backport that needs it.
We did something similar for force_lowpart_subreg.

See the covering note in patch 1 for more discussion about the pros
and cons of the interface change.

The first patch is a prerequisite for a genemit series that I'm
hoping to post tomorrow.

Bootstrapped & regression-tested on aarch64-linux-gnu & x86_64-linux-gnu.
Also tested against "all" config.gcc cases using config/config-list.mk.
OK to install?

Richard


Richard Sandiford (4):
  Make end_sequence return the insn sequence
  Automatic replacement of get_insns/end_sequence pairs
  Automatic replacement of end_sequence/return pairs
  Manual tweak of some end_sequence callers

 gcc/asan.cc                               | 17 ++----
 gcc/auto-inc-dec.cc                       |  3 +-
 gcc/avoid-store-forwarding.cc             |  3 +-
 gcc/bb-reorder.cc                         |  3 +-
 gcc/builtins.cc                           | 27 ++++------
 gcc/calls.cc                              |  6 +--
 gcc/cfgexpand.cc                          |  6 +--
 gcc/cfgloopanal.cc                        |  6 +--
 gcc/cfgrtl.cc                             |  9 ++--
 gcc/config/aarch64/aarch64-speculation.cc | 11 ++--
 gcc/config/aarch64/aarch64.cc             | 39 +++++---------
 gcc/config/alpha/alpha.cc                 | 12 ++---
 gcc/config/arc/arc.cc                     |  3 +-
 gcc/config/arm/aarch-common.cc            |  3 +-
 gcc/config/arm/arm-builtins.cc            |  3 +-
 gcc/config/arm/arm.cc                     | 34 +++---------
 gcc/config/avr/avr-passes.cc              |  8 +--
 gcc/config/avr/avr.cc                     | 12 ++---
 gcc/config/bfin/bfin.cc                   |  3 +-
 gcc/config/c6x/c6x.cc                     |  3 +-
 gcc/config/cris/cris.cc                   |  3 +-
 gcc/config/cris/cris.md                   |  3 +-
 gcc/config/csky/csky.cc                   |  3 +-
 gcc/config/epiphany/resolve-sw-modes.cc   |  3 +-
 gcc/config/fr30/fr30.cc                   |  3 +-
 gcc/config/frv/frv.cc                     | 12 ++---
 gcc/config/frv/frv.md                     | 15 ++----
 gcc/config/gcn/gcn.cc                     | 18 +++----
 gcc/config/i386/i386-expand.cc            | 45 ++++++----------
 gcc/config/i386/i386-features.cc          | 12 ++---
 gcc/config/i386/i386.cc                   | 18 +++----
 gcc/config/ia64/ia64.cc                   | 15 ++----
 gcc/config/loongarch/loongarch.cc         |  4 +-
 gcc/config/m32r/m32r.cc                   |  3 +-
 gcc/config/m32r/m32r.md                   |  6 +--
 gcc/config/m68k/m68k.cc                   |  9 ++--
 gcc/config/m68k/m68k.md                   | 12 ++---
 gcc/config/microblaze/microblaze.cc       |  3 +-
 gcc/config/mips/mips.cc                   | 19 +++----
 gcc/config/nvptx/nvptx.cc                 | 39 +++++---------
 gcc/config/or1k/or1k.cc                   |  3 +-
 gcc/config/pa/pa.cc                       |  3 +-
 gcc/config/pru/pru.cc                     |  6 +--
 gcc/config/riscv/riscv-shorten-memrefs.cc |  3 +-
 gcc/config/riscv/riscv-vsetvl.cc          |  6 +--
 gcc/config/riscv/riscv.cc                 | 10 ++--
 gcc/config/rl78/rl78.cc                   |  3 +-
 gcc/config/rs6000/rs6000.cc               |  3 +-
 gcc/config/s390/s390.cc                   | 21 +++-----
 gcc/config/sh/sh_treg_combine.cc          |  5 +-
 gcc/config/sparc/sparc.cc                 | 15 ++----
 gcc/config/stormy16/stormy16.cc           |  3 +-
 gcc/config/xtensa/xtensa.cc               | 15 ++----
 gcc/dse.cc                                |  9 ++--
 gcc/emit-rtl.cc                           | 23 ++++-----
 gcc/except.cc                             | 21 +++-----
 gcc/expmed.cc                             |  6 +--
 gcc/expr.cc                               | 57 +++++++-------------
 gcc/function.cc                           | 57 +++++++-------------
 gcc/gcse.cc                               |  3 +-
 gcc/gentarget-def.cc                      |  4 +-
 gcc/ifcvt.cc                              |  9 ++--
 gcc/init-regs.cc                          |  3 +-
 gcc/internal-fn.cc                        | 12 ++---
 gcc/ira-emit.cc                           |  6 +--
 gcc/ira.cc                                |  3 +-
 gcc/loop-doloop.cc                        |  3 +-
 gcc/loop-unroll.cc                        | 21 +++-----
 gcc/lower-subreg.cc                       |  7 +--
 gcc/lra-constraints.cc                    | 54 +++++++------------
 gcc/lra-remat.cc                          |  3 +-
 gcc/mode-switching.cc                     |  6 +--
 gcc/optabs.cc                             | 63 ++++++++---------------
 gcc/ree.cc                                |  3 +-
 gcc/reg-stack.cc                          |  3 +-
 gcc/reload1.cc                            |  3 +-
 gcc/rtl.h                                 |  2 +-
 gcc/sel-sched-ir.cc                       |  3 +-
 gcc/shrink-wrap.cc                        | 18 +++----
 gcc/tree-outof-ssa.cc                     |  8 +--
 gcc/tree-ssa-loop-ivopts.cc               |  3 +-
 81 files changed, 316 insertions(+), 649 deletions(-)

-- 
2.43.0

Reply via email to