#280 Lazy Assign/Cast/other unary

open
None
5
2009-10-07
2009-10-01
No

sdcc should try to do these as late as possible. This can shorten live ranges and thus reduce register pressure, etc.

E.g. in the following minimal example:

void bar(int);

void foo(int x)
{
int y = x;
bar(0);
bar(y);
}

sdcc should move the asssignment beyond the first call to bar().

This optimization should probably be done directly after the computation of live ranges, before register assignment.

Philippp

Philipp

Discussion

  • Philipp Klaus Krause

    For some cases (e.g. an assignment to a global is the last use of a temporary) we might want to do eager assignments instead.

    Philipp

     
  • Philipp Klaus Krause

    • assigned_to: nobody --> spth
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks