diff options
author | Ilya Leoshkevich <iii@linux.ibm.com> | 2019-09-30 14:56:33 +0000 |
---|---|---|
committer | Ilya Leoshkevich <iii@gcc.gnu.org> | 2019-09-30 14:56:33 +0000 |
commit | 20fa157e674d0175f8c2717683462cdaded4d5be (patch) | |
tree | 352896fb14df54a2a599b18e2707299ae6055830 /gcc/emit-rtl.c | |
parent | 9343bf99b5e36fa11b723aafa282fd5900a5e525 (diff) | |
download | gcc-20fa157e674d0175f8c2717683462cdaded4d5be.zip gcc-20fa157e674d0175f8c2717683462cdaded4d5be.tar.gz gcc-20fa157e674d0175f8c2717683462cdaded4d5be.tar.bz2 |
Introduce rtx_alloca, alloca_raw_REG and alloca_rtx_fmt_*
When one passes short-lived fake rtxes to backends in order to test
their capabilities, it might be beneficial to allocate these rtxes on
stack in order to reduce the load on GC.
Provide macro counterparts of some of the gen_* functions for that
purpose.
gcc/ChangeLog:
2019-09-30 Ilya Leoshkevich <iii@linux.ibm.com>
* emit-rtl.c (init_raw_REG): New function.
(gen_raw_REG): Use init_raw_REG.
* gengenrtl.c (gendef): Emit init_* functions and alloca_*
macros.
* rtl.c (rtx_alloc_stat_v): Use rtx_init.
* rtl.h (rtx_init): New function.
(rtx_alloca): New function.
(init_raw_REG): New function.
(alloca_raw_REG): New macro.
From-SVN: r276303
Diffstat (limited to 'gcc/emit-rtl.c')
-rw-r--r-- | gcc/emit-rtl.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index a667cda..783fdb9 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -466,6 +466,17 @@ set_mode_and_regno (rtx x, machine_mode mode, unsigned int regno) set_regno_raw (x, regno, nregs); } +/* Initialize a fresh REG rtx with mode MODE and register REGNO. */ + +rtx +init_raw_REG (rtx x, machine_mode mode, unsigned int regno) +{ + set_mode_and_regno (x, mode, regno); + REG_ATTRS (x) = NULL; + ORIGINAL_REGNO (x) = regno; + return x; +} + /* Generate a new REG rtx. Make sure ORIGINAL_REGNO is set properly, and don't attempt to share with the various global pieces of rtl (such as frame_pointer_rtx). */ @@ -474,9 +485,7 @@ rtx gen_raw_REG (machine_mode mode, unsigned int regno) { rtx x = rtx_alloc (REG MEM_STAT_INFO); - set_mode_and_regno (x, mode, regno); - REG_ATTRS (x) = NULL; - ORIGINAL_REGNO (x) = regno; + init_raw_REG (x, mode, regno); return x; } |