-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[llvm] Let real function support returning struct #6614
[llvm] Let real function support returning struct #6614
Conversation
✅ Deploy Preview for docsite-preview ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
67e8179
to
cf0b6c7
Compare
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Using U64 array types and doing pointer conversion is really bad. This prohibits the downstream compiler to do any sort of optimization on this array (because of pointer conversions), and it uses a lot of register space & causes larger spilling issue. |
Yeah, please look at the Possible Improvement section of #6590 , I will compile it into a real struct in the future. |
# Conflicts: # taichi/codegen/llvm/codegen_llvm.cpp
for more information, see https://pre-commit.ci
/rebase |
Rebase failed, please resolve the conflicts manually. |
Constructed the result buffer directly into a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome thanks!
Issue: taichi-dev#4401, taichi-dev#6614 Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Issue: taichi-dev#602 taichi-dev#6590 ### Brief Summary Only supports scalar struct (every element in the struct is a scalar) for now. This PR does the following things: 1. Let `FuncCallStmt` return the `real_func_ret_struct *` result buffer instead of returning the return value directly. 2. Add `GetElementStmt` and `GetElementExpression` to get the i-th return value in a result buffer 3. Add `StructType.from_real_func_ret` to construct the returned struct to the `StructType` in Python Will add support for nested struct and matrix in struct in the following PRs. Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Issue: taichi-dev#4401, taichi-dev#6614 Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Issue: #602 #6590
Brief Summary
Only supports scalar struct (every element in the struct is a scalar) for now.
This PR does the following things:
FuncCallStmt
return thereal_func_ret_struct *
result buffer instead of returning the return value directly.GetElementStmt
andGetElementExpression
to get the i-th return value in a result bufferStructType.from_real_func_ret
to construct the returned struct to theStructType
in PythonWill add support for nested struct and matrix in struct in the following PRs.