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

Iterate over lets in the correct order in VectorizeLoops #7830

Merged
merged 4 commits into from
Sep 6, 2023

Conversation

vksnk
Copy link
Member

@vksnk vksnk commented Sep 1, 2023

We need to iterate over vars in insertion order, but the Scope doesn't preserver the order.

Fixes #7779

for (auto it = scope.cbegin(); it != scope.cend(); ++it) {
string vectorized_name = get_widened_var_name(it.name());
Expr vectorized_value = mutate(it.value());
for (auto let = containing_lets.begin(); let != containing_lets.end(); let++) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to add comment(s) here and below about why we are doing this?

Copy link
Member Author

Choose a reason for hiding this comment

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

I updated the comments, but it really was just my mistake incorrectly assuming that Scope preserves insertion order (which it does but only within specific name).

src/VectorizeLoops.cpp Outdated Show resolved Hide resolved
@vksnk
Copy link
Member Author

vksnk commented Sep 6, 2023

Looks like failure are unrelated, going to merge in.

@vksnk vksnk merged commit b704abd into main Sep 6, 2023
ardier pushed a commit to ardier/Halide-mutation that referenced this pull request Mar 3, 2024
* Iterate over lets in correct order

* Comments

* Comments

* Comments
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.

vectorize loops triggers name not in scope error
2 participants