This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: ipa-pure-const tweeks
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 7 Jun 2010 13:32:58 -0700
- Subject: Re: ipa-pure-const tweeks
- References: <20100607092353.GD17358@kam.mff.cuni.cz>
On Mon, Jun 7, 2010 at 2:23 AM, Jan Hubicka <hubicka@ucw.cz> wrote:
> Hi,
> this patch cleans up logic in handling ECF flags and merging results to be
> hopefully less fragile. Similarly to ipa-reference, it also ?make IPA pass to
> use callgraph and ipa-ref instead of checking indirect calls, loads and stores
> at local analysis time. ?Point of this is that other passes might in mentime
> turn indirect calls into direct or varables readonly.
>
> The patch also imporoves ipa-reference of handling of noreturn functions and adds
> a testcase for more stubble pure/const discovery cases as well as to verify
> that we are able to remove redundant calls to looping pures (at least when
> their return value is used. Funilly enough we keep them around when return value
> is unused, I will fill enhancement request for that).
>
> Bootstrapped/regtested x86_64-linux, will commit it later today.
>
> Honza
>
> ? ? ? ?* cgraph.c (cgraph_edge_cannot_lead_to_return): Also check
> ? ? ? ?if caller is noreturn.
> ? ? ? ?* ipa-reference.c (analyze_function): Use ipa_ref_cannot_lead_to_return
> ? ? ? ?* ipa-ref.h (ipa_ref_cannot_lead_to_return): New function.
> ? ? ? ?* ipa-pure-const.c (check_decl): Add IPA parameter.
> ? ? ? ?(state_from_flags): New function.
> ? ? ? ?(better_state, worse_state): New functions.
> ? ? ? ?(check_call): When in IPA mode, do not care about callees.
> ? ? ? ?(check_load, check_store): Update.
> ? ? ? ?(check_ipa_load, check_ipa_store): New.
> ? ? ? ?(check_stmt): When in IPA mode, use IPA checkers.
> ? ? ? ?(analyze_function): Use state_from_flags.
> ? ? ? ?(propagate): Check indirect edges and references.
>
> ? ? ? ?* gcc.dg/ipa/pure-const-1.c: New testcase.
This caused:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44453
--
H.J.