This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Profiling on S390
- From: "Ulrich Weigand" <Ulrich dot Weigand at de dot ibm dot com>
- To: Jan Hubicka <jh at suse dot cz>
- Cc: rth at redhat dot com, gcc at gcc dot gnu dot org, aj at suse dot de
- Date: Tue, 22 Apr 2003 22:43:37 +0200
- Subject: Re: Profiling on S390
- Sensitivity:
Jan Hubicka wrote:
>It looks very unsafe for me - GCC assumes at many places that CC is not
>live accross boundaries.
This is annoying. Is there any fundamental reason for this restriction?
Allowing CC to stay live across bb boundaries would enable further
optimizations, e.g. avoid one comparison instruction in code like this:
if (x > 5)
...
else if (x == 5)
...
>What happens is that profiler insert adddi on
>the begining of BB clobberring the flags.
Can't the profiler use special code to save/restore CC?
>But in general gcc will
>happily reverse the conditional when reordering basic blocks and do
>other transformations that can break such construct.
Can you elaborate why reversing the conditional would break this
construct?
>What would be the best sollution?
The quick fix would be to fall back on CLCL in all cases, like
below. I'll see if I can think of something better ...
Index: s390.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/s390/s390.c,v
retrieving revision 1.70.2.7
diff -c -p -r1.70.2.7 s390.c
*** s390.c 10 Apr 2003 16:41:31 -0000 1.70.2.7
--- s390.c 22 Apr 2003 20:41:22 -0000
*************** s390_expand_cmpstr (target, op0, op1, le
*** 2794,2800 ****
emit_move_insn (target, const0_rtx);
}
! else if (TARGET_MVCLE)
{
enum machine_mode double_mode = TARGET_64BIT ? TImode : DImode;
enum machine_mode single_mode = TARGET_64BIT ? DImode : SImode;
--- 2794,2800 ----
emit_move_insn (target, const0_rtx);
}
! else if (1 || TARGET_MVCLE)
{
enum machine_mode double_mode = TARGET_64BIT ? TImode : DImode;
enum machine_mode single_mode = TARGET_64BIT ? DImode : SImode;
Mit freundlichen Gruessen / Best Regards
Ulrich Weigand
--
Dr. Ulrich Weigand
Linux for S/390 Design & Development
IBM Deutschland Entwicklung GmbH, Schoenaicher Str. 220, 71032 Boeblingen
Phone: +49-7031/16-3727 --- Email: Ulrich dot Weigand at de dot ibm dot com