RE: Register pressure and inlining

"Murugesh" <murugesh@acmet.com>
Mon, 10 Nov 2008 15:15:13 +0530

          From comp.compilers

Related articles
Register pressure and inlining linuxkaffee_@_gmx.net (Stephan Ceram) (2008-11-08)
RE: Register pressure and inlining murugesh@acmet.com (Murugesh) (2008-11-10)
RE: Register pressure and inlining murugesh@acmet.com (Murugesh) (2008-11-10)
Re: Register pressure and inlining liangkun1983@gmail.com (Alex L.K) (2008-11-12)
Re: Register pressure and inlining armelasselin@hotmail.com (Armel) (2008-11-12)
Re: Register pressure and inlining bear@sonic.net (Ray Dillinger) (2008-11-12)
Re: Register pressure and inlining cdg@nullstone.com (Christopher Glaeser) (2008-11-12)
Re: Register pressure and inlining wimbleweather@verizon.net (Bob Morgan) (2008-12-17)
| List of all articles for this month |

From: "Murugesh" <murugesh@acmet.com>
Newsgroups: comp.compilers
Date: Mon, 10 Nov 2008 15:15:13 +0530
Organization: Compilers Central
References: 08-11-036
Keywords: registers, optimize
Posted-Date: 11 Nov 2008 07:16:02 EST

Please consider the following case where spill code is introduced in a
caller function, after inlining:


1) Available registers are R1 and R2
2) The registers R1 and R2 can be used across function calls
3) Therefore each function preserves the R1 and R2 in the prologue
      and restores in the epilogue.


Caller:
------


(snip)


Store R1
Store R2


Define R1
Define R2
Use R1
Use R2


Callee ()


Use R1
Use R2


Restore R1
Restore R2


(snip end)


I think, in this case, the prologue and epilogue instructions can not
be considered as spill instructions (?).


Apart from the prologue and epilogue, there is no spill code in
the function Caller.


Callee:
------


Store R1
Store R2


Define R1
Define R2
Use R1
Use R2


Restore R1
Restore R2
Return


Apart from the prologue and epilogue, there is no spill code in
the function Callee.


Inlined:
-------


(snip)


Store R1
Store R2


Define R1
Define R2
Use R1
Use R2


Store R1 ;;<== A
Store R2 ;;<== A


Define R1
Define R2
Use R1
Use R2


Restore R1 ;;<== A
Restore R2 ;;<== A


Use R1
Use R2


Restore R1
Restore R2


(snip end)


The instructions marked 'A' above are spill codes.
After inline optimization, spill codes are generated in
the function Caller.




Regards,
Murugesh Pitchaiah,
Software Engineer,
ACME Technologies Pvt Ltd
http://www.acmet.com/


Post a followup to this message

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