Skip to content

Add more missing recursive mutations/visits#9065

Merged
mcourteaux merged 4 commits intomainfrom
abadams/add_missing_visit_base
Mar 21, 2026
Merged

Add more missing recursive mutations/visits#9065
mcourteaux merged 4 commits intomainfrom
abadams/add_missing_visit_base

Conversation

@abadams
Copy link
Member

@abadams abadams commented Mar 19, 2026

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.

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.
Copy link
Member

Choose a reason for hiding this comment

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

Nit: The internal_errors below all should have a proper message.

Copy link
Member

@alexreinking alexreinking left a comment

Choose a reason for hiding this comment

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

LGTM with nit

@mcourteaux mcourteaux merged commit b24ef1c into main Mar 21, 2026
23 checks passed
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.

3 participants