Uh oh!
There was an error while loading. Please reload this page.
JIT: Improve VN for (EQ/NE (RELOP ...), 0/1) - #60943
Conversation
Try and re-express these VNs in terms of the RELOP or its complement.
ghost
commented
Oct 27, 2021
Tagging subscribers to this area: @JulieLeeMSFT Issue DetailsTry and re-express these VNs in terms of the RELOP or its complement.
|
AndyAyersMS
commented
Oct 27, 2021
cc @dotnet/jit-contrib Next installment in the ongoing saga of removing branch redundancy. Surprising number and amount of diffs. Will post some diff snippets shortly. aspnet.run.windows.x64.checked.mch:Detail diffsbenchmarks.run.windows.x64.checked.mch:Detail diffscoreclr_tests.pmi.windows.x64.checked.mch:Detail diffslibraries.crossgen2.windows.x64.checked.mch:Detail diffslibraries.pmi.windows.x64.checked.mch:Detail diffslibraries_tests.pmi.windows.x64.checked.mch:Detail diffs |
AndyAyersMS
commented
Oct 27, 2021
Sample diffs ;; Assembly listing for method Microsoft.CodeAnalysis.CSharp.DiagnosticsPass:IsInterlockedAPI(Microsoft.CodeAnalysis.CSharp.Symbol):bool:this;; beforeG_M7814_IG03: ; gcrefRegs=000000C0 {rsi rdi}, byrefRegs=00000000 {}, byref, isz ; gcrRegs -[rax]movrcx,rsi ; gcrRegs +[rcx]movrax, qword ptr [rsi]movrax, qword ptr [rax+80]call[rax+56]hackishModuleName:hackishMethodName():Microsoft.CodeAnalysis.CSharp.Symbols.NamedTypeSymbol:this ; gcrRegs -[rcx rsi] +[rax] ; gcr arg pop 0testrax,raxjne SHORT G_M7814_IG04xoresi,esije SHORT G_M7814_IG07jmp SHORT G_M7814_IG05 ;; bbWeight=0.50 PerfScore 5.88G_M7814_IG04: ; gcrefRegs=00000081 {rax rdi}, byrefRegs=00000000 {}, byref, iszcmprdi,raxje SHORT G_M7814_IG05;; afterG_M7814_IG03: ; gcrefRegs=000000C0 {rsi rdi}, byrefRegs=00000000 {}, byref, isz ; gcrRegs -[rax]movrcx,rsi ; gcrRegs +[rcx]movrax, qword ptr [rsi]movrax, qword ptr [rax+80]call[rax+56]hackishModuleName:hackishMethodName():Microsoft.CodeAnalysis.CSharp.Symbols.NamedTypeSymbol:this ; gcrRegs -[rcx rsi] +[rax] ; gcr arg pop 0testrax,raxje SHORT G_M7814_IG06cmprdi,raxje SHORT G_M7814_IG04Here's a fairly common pattern. Haven't yet mapped this back to see where it comes from. ;; Assembly listing for method System.Threading.ThreadPool:UnsafeQueueUserWorkItem(System.Action`1[Byte],ubyte,bool):bool;; beforemovr14,rax ; gcrRegs +[r14]movecx,1movrdx,0xD1FFAB1E ; string handlemovrdx, gword ptr [rdx] ; gcrRegs +[rdx]testecx,ecxjne SHORT G_M35947_IG04 ;; bbWeight=1 PerfScore 14.50G_M35947_IG03: ; gcrefRegs=00004064 {rdx rbp rsi r14}, byrefRegs=00000000 {}, byref ; gcrRegs -[rax]movrcx,rdx ; gcrRegs +[rcx]call hackishModuleName:hackishMethodName() ; gcrRegs -[rcx rdx] ; gcr arg pop 0 ;; bbWeight=0.50 PerfScore 0.62G_M35947_IG04: ; gcrefRegs=00004060 {rbp rsi r14}, byrefRegs=00000000 {}, byreflearcx, bword ptr [r14+16];; aftermovr14,rax ; gcrRegs +[r14]learcx, bword ptr [r14+16] |
jakobbotsch
commented
Oct 27, 2021
It's also a little curious that there are so many more PMI diffs compared to crossgen2 diffs, do you know why? |
AndyAyersMS
commented
Oct 27, 2021
No, I don't. Could be we're seeing a runtime idiom that is hidden/abstracted in R2R. Or else the patterns in R2R are just different. I'll see if I can track this down. |
EgorBo
commented
Oct 27, 2021
because of generics? like every generic call-site is instantiated with one of 8 predefined types in PMI mode (or I am wrong?) |
AndyAyersMS
commented
Oct 27, 2021
Hmm, the second pattern above looks like it comes (in part) from So perhaps the diffs here are overstated as we're evidently doing a PMI collection of a checked SPC? We really need to make sure we're not capturing checked SPC methods as part of SPMI. |
AndyAyersMS
commented
Oct 27, 2021
Let me run regular PMI diffs here and see what it says... |
AndyAyersMS
commented
Oct 27, 2021
PMI diffs suggest that many of the sizeable diffs above are indeed from eliminating various |
AndyAyersMS
commented
Oct 28, 2021
@dotnet/jit-contrib ping -- this is still interesting, just not as impactful as it first seemed. |
BruceForstall
left a comment
There was a problem hiding this comment.
LGTM. You should probably trigger outerloop and/or jitstress pipelines
AndyAyersMS
commented
Oct 28, 2021
/azp run runtime-coreclr jitstress |
|
Azure Pipelines successfully started running 1 pipeline(s). |
AndyAyersMS
commented
Oct 28, 2021
/azp run runtime-coreclr outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Try and re-express these VNs in terms of the RELOP or its complement.