Skip to content

Commit

Permalink
Update on "[compiler] Fix mode for generating scopes for reassignments"
Browse files Browse the repository at this point in the history
We have an experimental mode where we generate scopes for simple phi values, even if they aren't subsequently mutated. This mode was incorrectly generating scope ranges, leaving the start at 0 which is invalid. The fix is to allow non-zero identifier ranges to overwrite the scope start (rather than taking the min) if the scope start is still zero.

[ghstack-poisoned]
  • Loading branch information
josephsavona committed Jul 12, 2024
1 parent d88f26a commit 3f6d0e4
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,12 @@ export function inferReactiveScopeVariables(fn: HIRFunction): void {
};
scopes.set(groupIdentifier, scope);
} else {
if (identifier.mutableRange.start !== 0 && scope.range.start !== 0) {
if (scope.range.start === 0) {
scope.range.start = identifier.mutableRange.start;
} else if (identifier.mutableRange.start !== 0) {
scope.range.start = makeInstructionId(
Math.min(scope.range.start, identifier.mutableRange.start)
);
} else if (identifier.mutableRange.start !== 0) {
scope.range.start = identifier.mutableRange.start;
}
scope.range.end = makeInstructionId(
Math.max(scope.range.end, identifier.mutableRange.end)
Expand Down

0 comments on commit 3f6d0e4

Please sign in to comment.