Re: register variables in C.

ressler@cs.cornell.edu (Gene Ressler)
Sat, 2 May 1992 03:02:40 GMT

          From comp.compilers

Related articles
[6 earlier articles]
Re: register variables in C. jeff@dsp.sps.mot.com (1992-04-30)
Re: register variables in C. Brian.Scearce@Eng.Sun.COM (1992-04-30)
Re: register variables in C. pardo@cs.washington.edu (1992-05-01)
Re: register variables in C. metaware!miker@uunet.UU.NET (1992-05-01)
Re: register variables in C. preston@dawn.cs.rice.edu (1992-05-01)
Re: register variables in C. bliss@sp64.csrd.uiuc.edu (1992-05-01)
Re: register variables in C. ressler@cs.cornell.edu (1992-05-02)
Re: register variables in C. stephen@estragon.uchicago.edu (1992-05-04)
Re: register variables in C. macrakis@osf.org (1992-05-04)
Re: register variables in C. gnb@bby.oz.au (1992-05-04)
Re: register variables in C. cliffc@cs.rice.edu (1992-05-06)
| List of all articles for this month |

Newsgroups: comp.compilers
From: ressler@cs.cornell.edu (Gene Ressler)
Keywords: C, registers, optimize
Organization: Cornell Univ. CS Dept, Ithaca NY 14853
References: 92-04-125 92-05-018
Date: Sat, 2 May 1992 03:02:40 GMT

Is it not true that good register allocators treat live ranges (even of
the same variable) separately in the cost function? Even split live
ranges at e.g. loop boundaries?


In this context, it seems more appropriate to have programmers tag uses of
variables rather than declarations. With apologies for the syntax:


    for (i = 0; f(i); ++i) {
          a[ i:reg ] = .... < executes a million times >
    }


    < hairy code that needs a lot of regs's >


      z = i:noreg * 5; < executes once >


The meaning of i:reg is that the compiler should try to make the defs of i
for this use into a register. Conversely i:noreg means that if the
upstream defs are into a register, and other live ranges overlapping this
one need a register, the live range of i should be split and i spilled to
permit it.


Gene
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.