#233 Optimize tail calls on Z80

closed
None
5
2008-02-17
2008-02-14
No

When the last statement in a void function is a function call the

call somewhere
ret

could be optimized to

jp somewhere

The attached patch does the optimization in the peephole optimizer.

Philipp

Discussion

  • Philipp Klaus Krause

    Logged In: YES
    user_id=564030
    Originator: YES

    The patch is against sdcc 2.7.4 #5008. I have run the regression tests and found no problems.

    Philipp

     
  • Philipp Klaus Krause

    Logged In: YES
    user_id=564030
    Originator: YES

    I've added another peephole to make this work for functions that use ix to read their arguments, too.

    I have run the regression tests and found no problems.

    Philipp

    File Added: sdcc-ret-jp.patch

     
  • Philipp Klaus Krause

    Peepholes to optimize tail calls on z80

     
  • Borut Ražem

    Borut Ražem - 2008-02-17
    • assigned_to: nobody --> borutr
    • status: open --> closed
     
  • Borut Ražem

    Borut Ražem - 2008-02-17

    Logged In: YES
    user_id=568035
    Originator: NO

    Patch applied in svn revision #5014.

    Borut

     

Log in to post a comment.

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

Sign up for the SourceForge newsletter:





No, thanks