Add more missing recursive mutations/visits#9065
Merged
mcourteaux merged 4 commits intomainfrom Mar 21, 2026
Merged
Conversation
After #9064 I had Claude audit the codebase looking for places where it looked like a recursive call to the base class visitor/mutator was missing. If found a few. There was a very subtle one in SplitTuples.cpp (accompanied by a new test) in a visitor which tries to determine which tuple components potentially depend on the old value of another component, but it wasn't recursing into Call args, so tuple components could hide cross-dependencies inside the args of a self-dependency. Region costs isn't recursing into Shuffle nodes, but really it shouldn't see them at all, because this is before vectorization. A Store visitor in handling of atomic vectorization isn't considering predicates, seemingly for no reason. I changed it to just use the base class visit method. Finally, an example custom lowering pass should recursively visit children because it is attempting to ensure something was absent in the IR.
Comment on lines
252
to
253
| // None of the following IR nodes should be encountered when traversing the | ||
| // IR at the level at which the auto scheduler operates. |
Member
There was a problem hiding this comment.
Nit: The internal_errors below all should have a proper message.
mcourteaux
approved these changes
Mar 19, 2026
mcourteaux
approved these changes
Mar 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After #9064 I had Claude audit the codebase looking for places where it looked like a recursive call to the base class visitor/mutator was missing. If found a few.
There was a very subtle one in SplitTuples.cpp (accompanied by a new test) in a visitor which tries to determine which tuple components potentially depend on the old value of another component, but it wasn't recursing into Call args, so tuple components could hide cross-dependencies inside the args of a self-dependency. This requires highly artificial code to actually trigger, but it's a genuine bug.
Region costs isn't recursing into Shuffle nodes, but really it shouldn't see them at all, because this is before vectorization.
A Store visitor in handling of atomic vectorization isn't considering predicates, seemingly for no reason. I changed it to just use the base class visit method. Atomic vectorization with predicates is still a TODO, so no test (see #8845).
Finally, an example custom lowering pass should recursively visit children because it is attempting to ensure something was absent in the IR.