[Bug tree-optimization/55629] Missed value numbering to a constant

2021-08-10 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55629

Andrew Pinski  changed:

   What|Removed |Added

   Severity|normal  |enhancement

[Bug tree-optimization/55629] Missed value numbering to a constant

2019-03-04 Thread steven at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55629

Steven Bosscher  changed:

   What|Removed |Added

   Last reconfirmed|2012-12-09 00:00:00 |2019-3-4

--- Comment #2 from Steven Bosscher  ---
Trunk today with -O2:
foo(int):
cmpl$1, %edi
sbbl%eax, %eax
notl%eax
cmpl$1, %edi
sbbl%edx, %edx
leal6(%rdx,%rax), %eax
ret

and with -O2:
foo(int):
movl$5, %eax
ret

[Bug tree-optimization/55629] Missed value numbering to a constant

2012-12-10 Thread rguenth at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55629



--- Comment #1 from Richard Biener rguenth at gcc dot gnu.org 2012-12-10 
08:50:12 UTC ---

I know that there is a duplicate of this bug, at least for a simpler

testcase ... but I can't find it right now.



The issue is that SCCVN does not do PHI-translation, that is,



  bb 2:

  if (c_3(D) != 0)

goto bb 3;

  else

goto bb 4;



  bb 3:

  a_4 = 3;

  b_5 = 2;

  goto bb 5;



  bb 4:

  a_6 = 2;

  b_7 = 3;



  bb 5:

  # a_1 = PHI 3(3), 2(4)

  # b_2 = PHI 2(3), 3(4)

  _8 = a_1 + b_2;



SCCVN would need to lookup a_1 and b_2 on both incoming edges when it tries

to simplify a_1 + b_2, match up the results and if equal register the

simplification.



I'm not sure that handling this case (which would certainly be possible)

is worth the cost it has on all expressions that do _not_ simplify that way.

(of course we can see whether the value-numbers for a_1/b_2 do have

has_constants set).



Time for a value-number missed-optimization meta bug, there are quite some

special cases that we do not handle.


[Bug tree-optimization/55629] Missed value numbering to a constant

2012-12-09 Thread steven at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55629



Steven Bosscher steven at gcc dot gnu.org changed:



   What|Removed |Added



   Keywords||missed-optimization

 Status|UNCONFIRMED |NEW

   Last reconfirmed||2012-12-09

 CC||matz at gcc dot gnu.org,

   ||rguenth at gcc dot gnu.org

  Known to work||4.4.7, 4.6.3, 4.8.0

 Ever Confirmed|0   |1