Python: Fix bad scope_entry_points_to
join
#7332
Merged
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.
From
pritomrajkhowa/LoopBound
:specifically
First, this is an
antijoin
, so there's likely some negation involved. Also, there's mention ofGlobalVariable
,getScope
, andgetSourceVariable
, none of which appear inscope_entry_points_to
, so it's likely that something got inlined.Taking a closer look at the predicates mentioned in the body, we spot
undefined_variable
as a likely culprit.Evaluating this predicate in isolation reveals that it's not terribly big, so we could try just marking it with
pragma[noinline]
(I opted for the slightly more solidnomagic
) and see how that fares. I also checked thatbuiltin_not_in_outer_scope
was similarly small, and made that one un-inlineable as well.The result? Well, I can't even show you. Both
scope_entry_points_to
andundefined_variable
are so fast that they don't appear in the clause timing report (so they can at most take 3.5s each to evaluate, as that is the smallest timing in the list).