[clang][FlowSensitive] Do a quick check and bail early for massive CFGs - #186808
Merged
Conversation
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.
Bail out early if the visiting each reachable basic block once would have exceeded the MaxBlockVisits limit. If that is the case, then actually visiting and doing the dataflow analysis would hit the limit, but we would have wasted a lot of time.
Another possibility is that we run out of memory (OOM) and the process crashes. We've seen example of CFGs with # of blocks that are 2-8x the visit limit. Those examples also have lots of
Locs, which we track in MapVectors for each BB. Since the maps do not share memory across BBs, this leads to non-linear memory usage and OOMing before hitting the max visit limit. With this, we can avoid OOMing, and at least get some results for the other CFGs in the TU, instead of losing all results from the process crashing.