Skip to content
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

[ir] Make lower_scalar_pointer testable #2407

Merged
merged 3 commits into from
Jun 8, 2021
Merged

Conversation

k-ye
Copy link
Member

@k-ye k-ye commented Jun 6, 2021

Related issue = #2382

lower_scalar_pointer() used to do three difference things:

  1. transform the indices into a series of extract_bits and linearized statements
  2. test if the SNode is linear related to the struct_for
  3. generate SNode access ops (e.g. GetCh)

This PR pulls out step 1 into a separate class ScalarPointerLowerer to make it testable. Later we can also grow the logic around 1 separately (e.g. generate index decomposition statements for non power-of-two SNodes).

Steps 2 and 3 still remain in the original lower_acesss pass.

[Click here for the format server]


@k-ye k-ye requested review from KLozes and xumingkuan June 7, 2021 10:15
@k-ye k-ye marked this pull request as ready for review June 7, 2021 10:15
Copy link
Contributor

@xumingkuan xumingkuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

taichi/analysis/arithmetic_interpretor.h Outdated Show resolved Hide resolved

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Co-authored-by: xumingkuan <xumingkuan0721@126.com>
@k-ye k-ye merged commit 1aa4ed1 into taichi-dev:master Jun 8, 2021
@k-ye k-ye deleted the lower-scalar branch June 8, 2021 06:57
@k-ye k-ye mentioned this pull request Jun 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants