This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Constant registers
- To: John Wehle <john at feith dot com>
- Subject: Re: Constant registers
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Thu, 10 Aug 2000 11:31:14 -0600
- cc: gcc at gcc dot gnu dot org
- Reply-To: law at cygnus dot com
In message <200008092222.SAA19880@jwlab.FEITH.COM>you write:
> I'm seeing on the alpha sequences such as:
>
> (insn 298 295 299 (set (reg:SI 154)
> (const_int 983040 [0xf0000])) 197 {reload_inqi_help-8} (nil)
> (expr_list:REG_EQUAL (const_int 983040 [0xf0000])
> (nil)))
>
> (insn 299 298 301 (set (reg:DI 155)
> (plus:DI (subreg:DI (reg:SI 154) 0)
> (const_int 16959 [0x423f]))) 4 {*lda} (nil)
> (expr_list:REG_EQUAL (const_int 999999 [0xf423f])
> (nil)))
>
> (insn 301 299 302 (set (subreg:DI (reg:SI 153) 0)
> (reg:DI 155)) 204 {reload_inqi_help-1} (nil)
> (nil))
>
> (insn 302 301 304 (set (reg:DI 156)
> (sign_extend:DI (reg:SI 153))) 1 {*lda-3} (nil)
> (nil))
>
> where (reg:DI 156) is only set once in the function and is
> never clobbered. It's useful for VRP to know that such a
> register is constant so I'm looking to put together a
> routine (mark_constant_registers) which sets RTX_UNCHANGING_P.
>
> 1) Any obvious problems with doing so?
I can't think of any.
> 2) Is this useful information for other passes?
Yes. For example, reload might use such information for rematerializing
values.
> 3) Should mark_constant_register be called from reg_scan
> & life_analysis, or should I just call it prior to VRP?
Not sure off the top of my head.
You may be able to get the same results by creating a REG_EQUAL note.
jeff