-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
topdown/copypropagation: keep refs into livevars (#4936)
Before, a query of input.a == input.a would not survive copypropagation. With this change, it'll be recorded as removedEq, and subsequent processing steps ensure that it's kept in the body. Changing the sort order in sortBindings allows us to limit the unnecessary variable bindings: with the previous ordering, we'd get __local0__1 = input; __localcp0__ = input.a for the query `x := input; input.a == input.a`. Sorting the other way, we'll process `__localcp0__ = input.a` first, add it to the body, and when we check `__local0__1 = input`, we find that `input` is already contained in the body, and is thus not needed. Fixes #4848. Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
- Loading branch information
Showing
4 changed files
with
159 additions
and
43 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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