[Bug ipa/90401] Missed propagation of by-ref constant argument to callee function

2019-06-13 Thread fxue at os dot amperecomputing.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90401

Feng Xue  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #4 from Feng Xue  ---
Fixed

[Bug ipa/90401] Missed propagation of by-ref constant argument to callee function

2019-06-13 Thread fxue at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90401

--- Comment #3 from fxue at gcc dot gnu.org ---
Author: fxue
Date: Fri Jun 14 02:34:48 2019
New Revision: 272282

URL: https://gcc.gnu.org/viewcvs?rev=272282=gcc=rev
Log:
PR ipa/90401

gcc/ChangeLog:

* ipa-prop.c (add_to_agg_contents_list): New function.
(clobber_by_agg_contents_list_p): Likewise.
(extract_mem_content): Likewise.
(get_place_in_agg_contents_list): Delete.
(determine_known_aggregate_parts): Renamed from
determine_locally_known_aggregate_parts.  New parameter
aa_walk_budget_p.

gcc/testsuite/ChangeLog:

* gcc.dg/ipa/ipcp-agg-10.c: New test.

Added:
trunk/gcc/testsuite/gcc.dg/ipa/ipcp-agg-10.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/ipa-prop.c
trunk/gcc/testsuite/ChangeLog

[Bug ipa/90401] Missed propagation of by-ref constant argument to callee function

2019-05-09 Thread fxue at os dot amperecomputing.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90401

--- Comment #2 from Feng Xue  ---
(In reply to Richard Biener from comment #1)
> Huh.  IPA-CP dump difference:
> 
> @@ -26,6 +26,8 @@
>   Unknown VR
>  callsite  int caller(int, int&)/2 -> int callee(int&)/1 : 
> param 0: UNKNOWN
> + Aggregate passed by reference:
> +   offset: 0, cst: 1
>   value: 0x0, mask: 0xfffc
>   VR  ~[0, 0]
>Jump functions of caller  int callee(int&)/1:

This jump function is for the 2nd call. For the 1st call, IPA-CP can not deduce
that. So there is no enough benefit to convince IPA-CP to clone the "callee()".

> 
> I guess somehow IPA-CP walks stmts for defs instead of virtual operands?

Yes, it is. IPA-CP only walks stmts in callsite basic block.

[Bug ipa/90401] Missed propagation of by-ref constant argument to callee function

2019-05-09 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90401

Richard Biener  changed:

   What|Removed |Added

   Keywords||missed-optimization
 CC||jamborm at gcc dot gnu.org
Version|unknown |10.0

--- Comment #1 from Richard Biener  ---
Huh.  IPA-CP dump difference:

@@ -26,6 +26,8 @@
  Unknown VR
 callsite  int caller(int, int&)/2 -> int callee(int&)/1 : 
param 0: UNKNOWN
+ Aggregate passed by reference:
+   offset: 0, cst: 1
  value: 0x0, mask: 0xfffc
  VR  ~[0, 0]
   Jump functions of caller  int callee(int&)/1:

I guess somehow IPA-CP walks stmts for defs instead of virtual operands?