public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug tree-optimization/22586] GVN-PRE could do strength reduction [not found] <bug-22586-4@http.gcc.gnu.org/bugzilla/> @ 2012-03-04 0:00 ` pinskia at gcc dot gnu.org 2012-03-05 5:33 ` pinskia at gcc dot gnu.org 2012-06-28 1:29 ` wschmidt at gcc dot gnu.org 2 siblings, 0 replies; 5+ messages in thread From: pinskia at gcc dot gnu.org @ 2012-03-04 0:00 UTC (permalink / raw) To: gcc-bugs http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22586 Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed|2006-09-17 08:00:30 |2012-03-03 Depends on| |32120 --- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-03-03 23:59:23 UTC --- Related to PR 32120, actually I think PR 32120 is really asking for strength reduction just it was not called that in the bug report. ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug tree-optimization/22586] GVN-PRE could do strength reduction [not found] <bug-22586-4@http.gcc.gnu.org/bugzilla/> 2012-03-04 0:00 ` [Bug tree-optimization/22586] GVN-PRE could do strength reduction pinskia at gcc dot gnu.org @ 2012-03-05 5:33 ` pinskia at gcc dot gnu.org 2012-06-28 1:29 ` wschmidt at gcc dot gnu.org 2 siblings, 0 replies; 5+ messages in thread From: pinskia at gcc dot gnu.org @ 2012-03-05 5:33 UTC (permalink / raw) To: gcc-bugs http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22586 Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |37242 --- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-03-05 05:30:43 UTC --- (In reply to comment #3) > Related to PR 32120, actually I think PR 32120 is really asking for strength > reduction just it was not called that in the bug report. And it needs PR 37242 to fix the (long unsigned int) (i + 1)*4 and (long unsigned int) (i)*4 issue. ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug tree-optimization/22586] GVN-PRE could do strength reduction [not found] <bug-22586-4@http.gcc.gnu.org/bugzilla/> 2012-03-04 0:00 ` [Bug tree-optimization/22586] GVN-PRE could do strength reduction pinskia at gcc dot gnu.org 2012-03-05 5:33 ` pinskia at gcc dot gnu.org @ 2012-06-28 1:29 ` wschmidt at gcc dot gnu.org 2 siblings, 0 replies; 5+ messages in thread From: wschmidt at gcc dot gnu.org @ 2012-06-28 1:29 UTC (permalink / raw) To: gcc-bugs http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22586 William J. Schmidt <wschmidt at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |wschmidt at gcc dot gnu.org Resolution| |FIXED --- Comment #5 from William J. Schmidt <wschmidt at gcc dot gnu.org> 2012-06-28 01:27:43 UTC --- This specific case is handled by the new strength reduction pass. Some more complex scenarios will be added later. ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <bug-22586-280@http.gcc.gnu.org/bugzilla/>]
* [Bug tree-optimization/22586] GVN-PRE could do strength reduction [not found] <bug-22586-280@http.gcc.gnu.org/bugzilla/> @ 2008-02-23 5:27 ` pinskia at gcc dot gnu dot org 0 siblings, 0 replies; 5+ messages in thread From: pinskia at gcc dot gnu dot org @ 2008-02-23 5:27 UTC (permalink / raw) To: gcc-bugs ------- Comment #2 from pinskia at gcc dot gnu dot org 2008-02-23 05:27 ------- *** Bug 35308 has been marked as a duplicate of this bug. *** -- pinskia at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |xinliangli at gmail dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22586 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug tree-optimization/22586] New: GVN-PRE could do strength reduction @ 2005-07-21 12:11 steven at gcc dot gnu dot org 2005-07-21 16:18 ` [Bug tree-optimization/22586] " pinskia at gcc dot gnu dot org 0 siblings, 1 reply; 5+ messages in thread From: steven at gcc dot gnu dot org @ 2005-07-21 12:11 UTC (permalink / raw) To: gcc-bugs There doesn't appear to be any reason why GVN-PRE couldn't be extended to do strength reduction. If this is added, the strength reduction currently done in DOM and IVOPTS may be removed or simplified. The implementation in IVOPTS only works on loops, and the transformations done in DOM only works in a few special cases and only on a branch of the dominator tree (i.e. not a global pass). Also, GVN-PRE could replace the flag_unsafe_math_optimizations trick that used to be in expr.c and is now in tree-ssa-loop-im.c: /* If divisor is invariant, convert a/b to a*(1/b), allowing reciprocal to be hoisted out of loop, saving expensive divide. */ Adding this transformation as a special case of "strength reduction" to GVN-PRE would allow the transformation to be done on straight-line code as well (the code in expr.c used to do this, but we don't do the transformation anymore at the moment). Consider as an example: int foo (int a[], int b[], int i) { a[i] = b[i] + 2; i++; a[i] = b[i] + 2; i++; a[i] = b[i] + 2; i++; a[i] = b[i] + 2; i++; return i; } "GCC 4.1.0 20050721 (experimental)" produces the following .vars dump: foo (a, b, i) { int * temp.44; int * temp.43; int * temp.42; int * D.1608; <bb 0>: D.1608 = (int *) ((long unsigned int) i * 4); *(D.1608 + a) = *(D.1608 + b) + 2; temp.42 = (int *) ((long unsigned int) (i + 1) * 4); *(a + temp.42) = *(b + temp.42) + 2; temp.43 = (int *) ((long unsigned int) (i + 2) * 4); *(a + temp.43) = *(b + temp.43) + 2; temp.44 = (int *) ((long unsigned int) (i + 3) * 4); *(a + temp.44) = *(b + temp.44) + 2; return i + 4; } Note the redundant computations of "i*4". Indeed, we don't optimize these away on RTL either. -- Summary: GVN-PRE could do strength reduction Product: gcc Version: 4.1.0 Status: UNCONFIRMED Keywords: missed-optimization, TREE Severity: enhancement Priority: P3 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: steven at gcc dot gnu dot org CC: dberlin at gcc dot gnu dot org,gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22586 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug tree-optimization/22586] GVN-PRE could do strength reduction 2005-07-21 12:11 [Bug tree-optimization/22586] New: " steven at gcc dot gnu dot org @ 2005-07-21 16:18 ` pinskia at gcc dot gnu dot org 0 siblings, 0 replies; 5+ messages in thread From: pinskia at gcc dot gnu dot org @ 2005-07-21 16:18 UTC (permalink / raw) To: gcc-bugs ------- Additional Comments From pinskia at gcc dot gnu dot org 2005-07-21 16:15 ------- Confirmed. Note there is a pass at the tree level which already does the replace "a/b to a*(1/b)" at the rtl level. -- What |Removed |Added ---------------------------------------------------------------------------- CC| |pinskia at gcc dot gnu dot | |org Status|UNCONFIRMED |NEW Ever Confirmed| |1 Last reconfirmed|0000-00-00 00:00:00 |2005-07-21 16:15:29 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22586 ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-06-28 1:29 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <bug-22586-4@http.gcc.gnu.org/bugzilla/> 2012-03-04 0:00 ` [Bug tree-optimization/22586] GVN-PRE could do strength reduction pinskia at gcc dot gnu.org 2012-03-05 5:33 ` pinskia at gcc dot gnu.org 2012-06-28 1:29 ` wschmidt at gcc dot gnu.org [not found] <bug-22586-280@http.gcc.gnu.org/bugzilla/> 2008-02-23 5:27 ` pinskia at gcc dot gnu dot org 2005-07-21 12:11 [Bug tree-optimization/22586] New: " steven at gcc dot gnu dot org 2005-07-21 16:18 ` [Bug tree-optimization/22586] " pinskia at gcc dot gnu dot org
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).