-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 04/22/11 14:19, Easwaran Raman wrote:
> Hi,
>  This patch improves RTL DSE by not assuming that calls read all
> memory locations. With this patch, calls are assumed to read any
> non-frame memory and any stack variables that can potentially escape.
> This patch partly addresses PR rtl-optimization/44194. Bootstraps and
> no test regressions. OK for trunk?
> 
> Thanks,
> Easwaran
> 
> 2011-04-22  Easwaran Raman  <era...@google.com>
> 
> PR rtl-optimization/44194
>       * dse.c (header files): Include tree-flow.h.
>       (group_info): Add fields.
>       (globals): Add a new variable kill_on_calls.
>       (get_group_info): Initialize added fields.
>       (dse_step0): Initialize kill_on_calls.
>       (can_escape): New function.
>       (record_store): Pass EXPR corresponding to MEM to
>       set_usage_bits.
>       (dse_step2_nospill): Set kill_on_calls based on
>       group->escaped_*.
>       (scan_reads_nospill): Handle call instructions.
>       (find_insn_before_first_wild_read): Remove the function.
>       (dse_step3_scan): Remove call to find_insn_before_first_wild_read.
>       (dse_step5_nospill): Do not kill everything on call.
> 
> testsuite/ChangeLog:
> 
> 2011-04-22  Easwaran Raman  <era...@google.com>
> 
> PR rtl-optimization/44194
>       * gcc.dg/pr44194-1.c: New test.
On a bookkeeping note, it doesn't appear that you ever release the
bitmaps for gi->escaped_{p,n} or kill_on_calls.  This should probably be
done in dse_step7.

I'm going to assume that you and Richi have agreed upon the form of
can_escape.

AFAICT, even after your patch we still have a wild read recorded for
most CALL_INSNs (see this code in scan_insn which was not modified):




      else
        /* Every other call, including pure functions, may read memory.  */
        add_wild_read (bb_info);

It appears that you effectively ignore the wild_read in
scan_reads_nospill by special casing CALL_INSNs.  Correct?  Is so, does
it make still sense to call add_wild_read in scan_insn?


ISTM that wild reads are still possible due to a few other constructs
such as asms, address canonicalization failure, etc, so why is the
removal of the wild read support in dse_step5_nospill correct?

Just to be clear, I generally like the change, but there's some details
that I think need to be better understood before installing.

jeff


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJNtalUAAoJEBRtltQi2kC7evMH/0UyasIBTcZM7MSeCDGvefdR
byd5/XaaH1FtdRS64ne1bGbjB/h96AJbXYfc3QECtKugfmwgSbJeaN/BD8T4WY/L
2z1MkeSwcpswnxufjTR6G5WezuUsxagB4/xoSqk7NRfJdsM3eBR9n+ehTwlfsU5q
bTvQ/Uat0x027ddyrifD6vIOIIqFwMba9CvvN7vV0O+yzuxjzxNfe4IEcyMg2RIZ
j6xK+Bv7pge9pHC8ERKOFO17CPdK2JBe4ovtFL8s1sadBkjO2044uRszcl8E/9rj
MUGHExtFEIypzzi0wBqWyy3fz5QRCBuN/Xj6ptk4Cw7dkuBTZPWjySWrXV5kEs4=
=omzC
-----END PGP SIGNATURE-----

Reply via email to