Opened 2 years ago

Last modified 2 years ago

#14067 new task

Static Argument Transformation for tail-recursive functions

Reported by: nomeata Owned by: mpickering
Priority: normal Milestone:
Component: Compiler Version: 8.0.1
Keywords: JoinPoints Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description (last modified by nomeata)

In #13966 it was determined that having a variant of the Static Argument Transformation (StaticArgumentTransformation) pass that would specifically work on recursive join points, would be beneficial. This ticket tracks this task.

Consider

joinrec $j x y = case y of
                  A -> $j x y'
                  B -> e2 x
                  C -> e3
in $j foo bar

Here the first argument to $j is "static"; that is, the same in every call. So we can transform like this

joinrec $j y = case y of
                  A -> $j y'
                  B -> e2 foo
                  C -> e3
in $j bar

Note that x isn't passed around in every iteration any more.

Change History (3)

comment:1 Changed 2 years ago by nomeata

Owner: set to mpickering

comment:2 Changed 2 years ago by nomeata

Description: modified (diff)

comment:3 Changed 2 years ago by nomeata

Keywords: JoinPoints added

Also see: #14068 Turn tail-recursive functions into recursive joinpoints

Note: See TracTickets for help on using tickets.