-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle embedded assignments in copy propagation (#63447)
* Clean things up a little Delete redundant conditions, use "LclVarDsc*", rename locals for clarity. * Delete a redundant condition For actual def nodes, GTF_VAR_CAST will never be set, it is only set in "optNarrowTree" for uses. For "def nodes" that are actually uses (parameters), the VNs will never match anyway. * Handle embedded assignments in copy propagation Previously, as the comments in copy propagation tell us, it did not handle "intervening", or not-top-level definitions of locals, instead opting to maintain a dedicated kill set of them. This is obviously a CQ problem, but also a TP one, as it meant there had to be a second pass over the statement's IR, where the definitions would be pushed on the stack. This change does away with that, instead pushing new definitions as they are encountered in execution order, and simultaneously propagating on uses. Notably, this means the code now needs to look at the real definition nodes, i. e. ASGs, not the LHS locals, as those are encountered first in canonical execution order, i. e. for a tree like: ``` ASG LCL_VAR V00 "def" ADD LCL_VAR V00 LCL_VAR V00 ``` Were we to use the "def" as the definition point, we would wrongly push it as the definition on the stack, even as the assignments itself hasn't happened yet at that point. There are nice diffs with this change, all resulting from unblocked propagations, and mostly coming from setup arguments under calls. * Simplify optIsSsaLocal
- Loading branch information
1 parent
1d3c23d
commit 651fa6d
Showing
2 changed files
with
93 additions
and
148 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