-
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
[opt] Automatically identify allocas to scalarize #7055
Conversation
✅ Deploy Preview for docsite-preview ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
for more information, see https://pre-commit.ci
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.
Should this pass be placed after a simplify pass? IIUC the offset may be optimized to a constant after constant folding.
Co-authored-by: Lin Jiang <[email protected]>
Currently |
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.
LGTM
Issue: taichi-dev#2590 ### Brief Summary Previously `ScalarizePointers` (which is for allocas) takes place only when `dynamic_index=False`. In this PR, we automatically identify those allocas only indexed with constants and get them scalarized, and let the remaining allocas go through the code path for dynamic indexing. In this way, we make old user programs behave the same regardless of the `dynamic_index` option, and provide dynamic indexing support for new user programs at the same time. Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Lin Jiang <[email protected]>
Issue: #2590
Brief Summary
Previously
ScalarizePointers
(which is for allocas) takes place only whendynamic_index=False
. In this PR, we automatically identify those allocas only indexed with constants and get them scalarized, and let the remaining allocas go through the code path for dynamic indexing. In this way, we make old user programs behave the same regardless of thedynamic_index
option, and provide dynamic indexing support for new user programs at the same time.