-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JIT: allow forward sub of QMARK nodes #76476
Conversation
There is often a single-def single use temp consuming a QMARK (which in turn often comes from expansion of `isinst` and friends). This temp assignment tends to stay around and can inhibit redundant branch opts in a number of interesting cases. It may also serve as an attractive nuisance for copy prop. While it would be ideal to generalize RBO to handle assignment side effects, doing so appears quite challenging, as we would need to rewrite possibly large chunks of the SSA and VN graphs. Forward sub eliminates the temp and so clears the way for the existing RBO to remove more branches. Addresses aspects of the "side effect" enhancements for RBO (see dotnet#48115).
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsThere is often a single-def single use temp consuming a QMARK (which in turn often comes from expansion of While it would be ideal to generalize RBO to handle assignment side effects, doing so appears quite challenging, as we would need to rewrite possibly large chunks of the SSA and VN graphs. Forward sub eliminates the temp and so clears the way for the existing RBO to remove more branches. Addresses aspects of the "side effect" enhancements for RBO (see #48115).
|
@EgorBo PTAL A few largeish regressions; a decent number of improvements. I looked at Post RBO we have a graph like the following, where the |
This is a typical improvement (and a motivating case: #48115 (comment)). Note how
|
Does this handle cases handled by #76439? numbers of diffs look similar |
Hard to say how much overlap without diffing the two directly but looking at asp.net diff reports there doesn't seem to be many diffs in common. The qmark forward sub is avoiding small types so probably passing on TYP_BOOL qmarks. |
There is often a single-def single-use temp consuming a QMARK (which in turn often comes from expansion of
isinst
and friends). This temp assignment tends to stay around and can inhibit redundant branch opts in a number of interesting cases. It may also serve as an attractive nuisance for copy prop.While it would be ideal to generalize RBO to handle assignment side effects, doing so appears quite challenging, as we would need to rewrite possibly large chunks of the SSA and VN graphs. Forward sub eliminates the temp and so clears the way for the existing RBO to remove more branches.
Addresses aspects of the "side effect" enhancements for RBO (see #48115).
Diffs