Handle functions returning arrays/structs in subroutine_from_function pass#2408
Handle functions returning arrays/structs in subroutine_from_function pass#2408czgdp1807 merged 9 commits intolfortran:mainfrom
subroutine_from_function pass#2408Conversation
c3da07a to
90b34f4
Compare
|
This is ready for review. However, please do not merge this. I will apply the same changes to LPython and then merge both PRs together. |
This PR is a refactoring PR. We discussed to do this in our meetings. It doesn't fix anything just decouples functions returning arrays from |
|
If it is just refactoring, then it's fine. |
| "array_op", | ||
| "symbolic", | ||
| "intrinsic_function", | ||
| "subroutine_from_function", |
There was a problem hiding this comment.
I can see two subroutine_from_function passes here. I assume you need to need to run it after intrinsic_function, since some implementations return an array?
Why do you need to run the first one --- is there a requirement that it must run before array_op?
There was a problem hiding this comment.
Yes. We need to convert all the functions returning arrays into subroutines and their function calls before sending to array_op pass where only array operations are dealt with.
There was a problem hiding this comment.
Why not calling intrinsic_function before array_op?
certik
left a comment
There was a problem hiding this comment.
I think this is good enough to merge, so I am going to approve it.
I left a comment.
|
Well, LPython has some bugs so I am working on fixing it there. Will send a PR there soon. I am working on it as much as I can. We need this because this has uncovered a lot of bugs. |
36ca0a4 to
7eea397
Compare
…rraySize node in Array types
… when physical type is FixedSizeArray
…function ASR pass
7eea397 to
03757fc
Compare
Corresponding LPython PR - lcompilers/lpython#2325