You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Call basic_free_stack before return statement #2411
(lf) anutosh491@spbhat68:~/lpython/lpython$ lpython --enable-symengine --backend=c integration_tests/symbolics_08.py
pi
But with the llvm backend we face this issue
code generation error: asr_to_llvm: module failed verification. Error:
Call parameter type does not match function signature!
void** %r
void* call void @basic_const_pi(void** %r)
Call parameter type does not match function signature!
%2 = load void*, void** %z, align 8
void** call void @__module___main___func(void* %2)
But if you see the error message it is passing a double pointer as the first argument. Is this because r has an intent of type Out ?
cc @certik@Thirumalai-Shaktivel
@anutosh491 yes, correct. I reopened this issue since the comment #2411 (comment) is not fixed. You are on the right track, we first need to get the Out[S] arguments working.
Activity
certik commentedon Nov 9, 2023
Consider this example:
I recommend to fix it by calling the
subroutine_from_functionpass, which transforms the above into the following ASR code:And this code in turn should already work today, so nothing needs to be implemented in the Symbolic pass.
certik commentedon Nov 9, 2023
The first issue to fix is:
certik commentedon Nov 9, 2023
There are several independent issues that we need to fix:
basic_free_stackbefore return statement #2411 (comment)--dump-all-passesand--dump-all-passes-fortranfrom LFortran #2413subroutine_from_functionpass works as aboveanutosh491 commentedon Nov 11, 2023
Considering the above comment. I would say this
Should transform into something like this
This works with the c backend
But with the llvm backend we face this issue
We define
basic_const_pilikeBut if you see the error message it is passing a double pointer as the first argument. Is this because
rhas an intent of typeOut?cc @certik @Thirumalai-Shaktivel
Thirumalai-Shaktivel commentedon Nov 11, 2023
Yup, it's because of intent
Out.I don't know how to proceed here; I will have to look into it soon and report back.
certik commentedon Nov 11, 2023
@anutosh491 yes, correct. I reopened this issue since the comment #2411 (comment) is not fixed. You are on the right track, we first need to get the
Out[S]arguments working.anutosh491 commentedon Nov 19, 2023
I think we have all 4 TODOS of #2411 (comment) addressed now. Hence the issue can be closed.
certik commentedon Nov 19, 2023
@anutosh491 great job!