thomasrolinger / chapel

a Productive Parallel Programming Language
https://chapel-lang.org
Other
0 stars 1 forks source link

Detect Recursion in Call Path and Invalidate #40

Closed thomasrolinger closed 2 years ago

thomasrolinger commented 2 years ago

Right now, I am fairly certain that our dynamic call path analysis will get stuck in an infinite loop if there is recursion involving the function that contains the forall.

To avoid this, we can do a quick pass over the call graph using a Depth First Search (DFS) to detect cycles. If we find a cycle, it means there is recursion. At this point, we stop the search and invalidate all forall loops in the function that were optimized.

thomasrolinger commented 2 years ago

This is completed: https://github.com/thomasrolinger/chapel/commit/8027773e3bef5886b555ea6164f1db75b5a8e885