public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Interest in integer auto-upcasting pass for normalization and optimization?
@ 2009-05-09 20:20 Albert Cohen
  2009-05-09 22:28 ` Richard Guenther
  2009-05-11 10:18 ` Daniel Jacobowitz
  0 siblings, 2 replies; 8+ messages in thread
From: Albert Cohen @ 2009-05-09 20:20 UTC (permalink / raw)
  To: GCC; +Cc: Albert Cohen

Sebastian Pop and I have been discussing the option of designing a new 
pass, based on vrp, to normalize integer types towards a canonical 
supertype typically a machine word, equivalent to signed long, or to 
truncate to a smaller-size word when it makes sense. This would be a 
very simple pass (on top of not-so-simple vrp), but arguably a quite 
regression-prone one as well (due to aliases/escape and common C 
standard violations).

The pass could be parameterized with three different objectives, 
depending on where it is scheduled in the pass manager.

(1) canonicalize to the supertype aggressively, to facilitate the 
application of further passes like autovect which require very precise 
understanding of the type conversions;
(2) compress the types to increase vectorization factor and reduce 
register pressure (assuming the target supports sub-word register 
allocation with register aliases);
(3) optimize the types to minimize the dynamic number of casts that 
result in actual ASM instructions.

Graphite and the vectorizer would clearly benefit from such a pass, at 
least if it implemented objective (1).

I wonder if some of this is already implemented somewhere, or if someone 
played with it in the past, or is interesting in contributing.

Nothing is planned yet on our side, and temporary fixes exist in the 
short term (as far as Graphite and the vectorizer are concerned), but it 
would potentially be of great help.

Feedback welcome,
Albert

^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: Interest in integer auto-upcasting pass for normalization and  optimization?
@ 2009-05-11 12:05 Joern Rennecke
  2009-05-15 16:55 ` Bernd Schmidt
  0 siblings, 1 reply; 8+ messages in thread
From: Joern Rennecke @ 2009-05-11 12:05 UTC (permalink / raw)
  To: gcc

----- Forwarded message from amylaar@spamcop.net -----
     Date: Mon, 11 May 2009 05:07:52 -0400
     From: Joern Rennecke <amylaar@spamcop.net>
Reply-To: Joern Rennecke <amylaar@spamcop.net>
  Subject: Re: Interest in integer auto-upcasting pass for  
normalization and optimization?
       To: Daniel Jacobowitz <drow@false.org>
       Cc: Albert Cohen <Albert.Cohen@inria.fr>, Richard Guenther  
<richard.guenther@gmail.com>, Nathan Froyd <froydnj@codesourcery.com>

> On Sat, May 09, 2009 at 10:07:38PM +0200, Albert Cohen wrote:
>> I wonder if some of this is already implemented somewhere, or if   
>> someone  played with it in the past, or is interesting in   
>> contributing.

Daniel Jacobowitz:
> This sounds a bit similar to Nathan Froyd's recent work:

Note that this is PR 29944.

For ARCompact, doloop loops in particular were interesting to
optimize, which is why I have a patch to loop-doloop.c in
svn://gcc.gnu.org/svn/gcc/branches/arc-4_4-branch :

2009-02-24  J"orn Rennecke  <joern.rennecke@arc.com>

          * loop-doloop.c (doloop_valid_p): Rename to:
          (validize_doloop).  Try to fix up loops with conditons for infinite
          looping by enclosing them in an outer loop.
          Changed caller.
          (add_test): Add new parameter edgep.  Changed caller.






----- End forwarded message -----

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-05-15 12:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-09 20:20 Interest in integer auto-upcasting pass for normalization and optimization? Albert Cohen
2009-05-09 22:28 ` Richard Guenther
2009-05-10  1:39   ` Richard Guenther
2009-05-11  9:21     ` Albert Cohen
2009-05-11 10:18 ` Daniel Jacobowitz
2009-05-11 12:05 Joern Rennecke
2009-05-15 16:55 ` Bernd Schmidt
2009-05-15 18:05   ` Joern Rennecke

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).