This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
ppc df->si improvement
- To: dje at watson dot ibm dot com, Geoffrey Keating <geoffk at cygnus dot com>
- Subject: ppc df->si improvement
- From: Richard Henderson <rth at cygnus dot com>
- Date: Thu, 7 Oct 1999 12:48:30 -0700
- Cc: gcc-patches at gcc dot gnu dot org
While investigating a bug in some flow work I'm doing, I
noticed an improvement that can be made to the ppc md.
The construct yall use for df->si conversion uses a set of a
(subreg:SI (reg:DI foo) 0). The life_analysis code does not
know how to keep track of partial kills of multi-word registers,
so register foo is never definitively set, and so it's lifetime
extends to the beginning of the function.
I see from the ISA manual that the upper 32-bits of the DImode
register are in fact undefined, so a set of a subreg does
indeed seem the proper thing. But you'll get better results
from the register allocator if you let the compiler know that
the whole register is dead at that point.
This can be done by emitting a clobber.
Ok?
r~
* rs6000.md (fix_truncdfsi2_internal+1): Emit a clobber
before the fctiwz insn.
Index: rs6000.md
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/config/rs6000/rs6000.md,v
retrieving revision 1.72
diff -c -p -d -r1.72 rs6000.md
*** rs6000.md 1999/09/07 05:49:00 1.72
--- rs6000.md 1999/10/07 19:34:45
***************
*** 4421,4427 ****
(clobber (match_operand 3 "gpc_reg_operand" ""))
(clobber (reg:DI 76))]
"TARGET_HARD_FLOAT"
! [(set (subreg:SI (match_dup 2) 0)
(fix:SI (match_operand:DF 1 "gpc_reg_operand" "")))
(set (match_dup 3)
(unspec [(const_int 0)] 11))
--- 4421,4428 ----
(clobber (match_operand 3 "gpc_reg_operand" ""))
(clobber (reg:DI 76))]
"TARGET_HARD_FLOAT"
! [(clobber (match_dup 2))
! (set (subreg:SI (match_dup 2) 0)
(fix:SI (match_operand:DF 1 "gpc_reg_operand" "")))
(set (match_dup 3)
(unspec [(const_int 0)] 11))