Repository navigation
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces several optimizations and safety checks across various passes to prevent redundant processing and infinite recursion. Specifically, it adds visited-set checks in AllocateDescriptorsPass, AutoPodArgsPass, and SpecializeImageTypesPass, deduplicates callees in CallGraphOrderedFunctions, and optimizes entry point tracing in ShareModuleScopeVariablesPass. In Types.cpp, recursion guards and caching are introduced to InferType. However, a critical issue was identified where permanently caching nullptr in InferType can lead to incorrect type inference failures due to recursion guards. It is recommended to revert this change and return nullptr without caching it permanently.
rjodinchr
force-pushed
the
dedup-call-dag-traversals
branch
from
October 16, 2026 13:26
12cadbd to
b50e36e
Compare
dneto0
requested changes
Oct 16, 2026
Several passes traversed call graphs or argument user chains without marking nodes as visited when enqueuing, causing exponential O(2^D) traversal times and memory growth on deep diamond call DAGs: - AutoPodArgsPass: insert into visited_fct when pushing to next_fcts_to_visit - ShareModuleScopeVariables: return early if entry_point is already recorded - CallGraphOrderedFunctions: deduplicate sorted callees list - SpecializeImageTypes: track visited arguments in RemapUse - AllocateDescriptorsPass: track visited arguments in HasReadsAndWrites - Types: cache nullptr in InferType to avoid re-traversing call graphs for untyped pointer arguments
rjodinchr
force-pushed
the
dedup-call-dag-traversals
branch
from
October 17, 2026 13:43
b50e36e to
e20f6fe
Compare
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.
Several passes traversed call graphs or argument user chains without marking nodes as visited when enqueuing, causing exponential O(2^D) traversal times and memory growth on deep diamond call DAGs:
Ref #1668