Skip to content

Conversation

@AndyAyersMS
Copy link
Member

No description provided.

@github-actions github-actions bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Oct 8, 2025
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

@AndyAyersMS
Copy link
Member Author

TP cost if we run this (when optimizing) only if there are improper headers is small, except for arm32. I wonder if the "failed to canonicalize" loops are getting mixed in here more often?

Of course if we were to do this for real we might need to run it in minopts, too, and presumably there the cost would be somewhat higher as we don't build loops their yet either.

@AndyAyersMS
Copy link
Member Author

diffs with the transformation enabled.

About 0.25% TP, and some sizeable code size increases, but those are somewhat unavoidable and probably less than we'd see with schemes that are perf-oriented and duplicate existing code. Interestingly enough some code size improvements (one guess is that this transformation might at times make LSRA's life easier; perhaps fewer critical edges / friendlier block ordering).

We can probably claw back a bit of the size by reusing the "transition" blocks (preds of the dispatch block); we'd need at most two per SCC entry (one for "outside" and one for "inside").

For something like wasm, we'd likely run this transformation later than I have it here currently, so TP would probably be somewhat cheaper (the added blocks/IR wouldn't gum up the optimization phases).

We can't fully validate all SCCs are removed just yet (though we seem to get almost all) because the current loop finding code allows loops to include exceptional flow; for our use cases we don't need to consider this, so we need a tweak to loop finding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant