[arm64] JIT: Make 0.0 containable for fcmp#61617
Conversation
|
Tagging subscribers to this area: @JulieLeeMSFT Issue DetailsA quick fix for: void Test(double x)
{
if (x < 0)
Console.WriteLine();
}codegen diff: ; Method MandelBrot:Test(double):this
G_M9914_IG01: ;; offset=0000H
A9BF7BFD stp fp, lr, [sp,#-16]!
910003FD mov fp, sp
;; bbWeight=1 PerfScore 1.50
G_M9914_IG02: ;; offset=0008H
- 4F00E410 movi v16.16b, #0x00
- 1E702000 fcmp d0, d16
+ 1E602008 fcmp d0, #0.0
54000042 bhs G_M9914_IG04
;; bbWeight=1 PerfScore 3.00
G_M9914_IG03: ;; offset=0010H
94000000 bl System.Console:WriteLine()
;; bbWeight=0.50 PerfScore 0.50
G_M9914_IG04: ;; offset=0014H
A8C17BFD ldp fp, lr, [sp],#16
D65F03C0 ret lr
;; bbWeight=1 PerfScore 2.00
; Total bytes of code: 28For arm32 it requires more effort so I decided to leave that TODO (it was there before my changes)
|
benchmarks.run.windows.arm64.checked.mch:Detail diffscoreclr_tests.pmi.windows.arm64.checked.mch:Detail diffslibraries.crossgen2.windows.arm64.checked.mch:Detail diffslibraries.pmi.windows.arm64.checked.mch:Detail diffslibraries_tests.pmi.windows.arm64.checked.mch:Detail diffs |
| assert(!op1->isContained()); | ||
| assert(op1Type == op2Type); | ||
|
|
||
| if (op2->IsIntegralConst(0)) |
There was a problem hiding this comment.
@EgorBo So, effectively, this was always dead code, right?
echesakov
left a comment
There was a problem hiding this comment.
LGTM. Can you share what the regressions look like?
some weird artifacts, I think I see them every time I make some changes which produce diffs |
I think it will be good to understand where are they coming from. Looks like in both cases, there is a "Inline arg" that was previously had zero reference but now we start using it? |
|
@EgorBo Is it possible this could have broken Mono JitIntrinsics tests? https://dev.azure.com/dnceng/public/_build/results?buildId=1472243&view=ms.vss-test-web.build-test-results-tab&runId=42217752&resultId=102746&paneView=dotnet-dnceng.dnceng-build-release-tasks.helix-test-information-tab |
|
@agocke definitely not possible, this PR only touches two jit .cpp files which are not used in mono |
A quick fix for:
codegen diff:
; Method MandelBrot:Test(double):this G_M9914_IG01: ;; offset=0000H A9BF7BFD stp fp, lr, [sp,#-16]! 910003FD mov fp, sp ;; bbWeight=1 PerfScore 1.50 G_M9914_IG02: ;; offset=0008H - 4F00E410 movi v16.16b, #0x00 - 1E702000 fcmp d0, d16 + 1E602008 fcmp d0, #0.0 54000042 bhs G_M9914_IG04 ;; bbWeight=1 PerfScore 3.00 G_M9914_IG03: ;; offset=0010H 94000000 bl System.Console:WriteLine() ;; bbWeight=0.50 PerfScore 0.50 G_M9914_IG04: ;; offset=0014H A8C17BFD ldp fp, lr, [sp],#16 D65F03C0 ret lr ;; bbWeight=1 PerfScore 2.00 ; Total bytes of code: 28For arm32 it requires more efforts so I decided to leave that TODO (it was there before my changes)
@dotnet/jit-contrib @echesakovMSFT