Open VSadov opened 1 year ago
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch, @kunalspathak See info in area-owners.md if you want to be subscribed.
Author: | VSadov |
---|---|
Assignees: | - |
Labels: | `area-CodeGen-coreclr` |
Milestone: | - |
CC @tannergooding
cc @dotnet/jit-contrib. We will not have time to address this in .NET 8. Pushing to Future.
@VSadov, I think its fine to no longer do an optimization that was only relevant to Phenom based processors.
I'd imagine fixing this should be trivial overall.
I only see two appearances in code and one in SPMI's pattern matcher. AFAIK the jit does not emit these.
@VSadov are there more that you know of?
src/coreclr/tools/superpmi/superpmi/neardiffer.cpp: if (u16_strcmp(instrMnemonic_1, L"rep ret") == 0)
src/coreclr/vm/amd64/jithelpers_singleappdomain.S: rep ret
src/coreclr/vm/amd64/jithelpers_singleappdomain.S: rep ret
I am not sure if JIT emits this. It may be mostly relevant to various asm helpers like GC barriers. There is even a macro for this. Like here:
Ok, I am going to switch this over to runtime.
The REP RET was a workaround for some peculiarities of branch predictors in AMD Family 10h/12h. As of 15h (Bulldozer) the recommendation disappeared from the official optimization guides and for Zen families contain recommendation to not do that:
https://www.amd.com/en/support/tech-docs/software-optimization-guide-for-the-amd-zen4-microarchitecture
15h (Bulldozer) is a 12 years old architecture. Perhaps it is time to stop using the pattern?
We have a number of assembly helpers that use REPRET. I am not sure if JIT emits it too.