[Bug ipa/114317] Missing optimization for multiple condition statements

2024-03-12 Thread hubicka at ucw dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114317

--- Comment #2 from Jan Hubicka  ---
> (it would need to elide the stores of course).

We do have way to elide stores, since we can optimize out write-only
values.  What we do not have readilly available is the value written to
a reference (ipa-refs only connects variables/functions to statements
that write/load/take address).  

I think the plan is to add summary template for references, like we have
for callgraph edges and symbols.  Then we can keep track of values and
do optimizations like this.  It is on my todo for quite some time ;)

[Bug ipa/114317] Missing optimization for multiple condition statements

2024-03-12 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114317

Richard Biener  changed:

   What|Removed |Added

   Last reconfirmed||2024-03-12
  Component|tree-optimization   |ipa
 Status|UNCONFIRMED |NEW
 CC||hubicka at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Richard Biener  ---
Confirmed.  I think this is known and there's possibly a duplicate.  IPA
reference doesn't consider writing the same value as in the initializer
as a way to turn the variable read-only (it would need to elide the stores
of course).