Uh oh!
There was an error while loading. Please reload this page.
ARM64: Avoid LEA for volatile IND - #64354
Conversation
ghost
commented
Jan 26, 2022
Tagging subscribers to this area: @JulieLeeMSFT Issue DetailsFollow up to #62895 volatileintf1;volatileintf2;voidTest(){f1=1;f2=1;}Codgen diff: ; Method Runtime:Test():this
G_M53852_IG01: ;; offset=0000H
A9BF7BFD stp fp, lr, [sp,#-16]!
910003FD mov fp, sp
;; bbWeight=1 PerfScore 1.50
G_M53852_IG02: ;; offset=0008H
- 52800021 mov w1, #1- D5033BBF dmb ish- B9000801 str w1, [x0,#8]- D5033BBF dmb ish- B9000C01 str w1, [x0,#12]- ;; bbWeight=1 PerfScore 22.50+ 91002001 add x1, x0, #8+ 52800022 mov w2, #1+ 889FFC22 stlr w2, [x1]+ 91003000 add x0, x0, #12+ 889FFC02 stlr w2, [x0]+ ;; bbWeight=1 PerfScore 3.50
G_M53852_IG03: ;; offset=001CH
A8C17BFD ldp fp, lr, [sp],#16
D65F03C0 ret lr
;; bbWeight=1 PerfScore 2.00
; Total bytes of code: 36Same byte size, but better PerfScore (no memory barrier)
|
VSadov
commented
Jan 27, 2022
resulting assembly looks correct and better than before |
@dotnet/jit-contrib PTAL There are some size regressions (https://dev.azure.com/dnceng/public/_build/results?buildId=1575482&view=ms.vss-build-web.run-extensions-tab) due to additional instructions to prepare addresses instead of addressing modes, but PerfScore diffs are much better, e.g. NOTE x64/x86 diffs are unrelated (not reproduceable locally) - spmi job picked a wrong baseline jit for them it seems |
Uh oh!
There was an error while loading. Please reload this page.
kunalspathak
commented
Jan 27, 2022
It picks the same baseline for x64/x86/arm/arm64...so all the diffs are related to that baseline. The question is why it picked wrong baseline, perhaps we didn't catch up or something in jitrollingbuild? @BruceForstall - any idea? I see that arm asmdiffs timesout which we are seeing more recently. I would probably rebase and double check with official baseline to make sure there is nothing suspicious. |
…-addrmode-volatile
EgorBo
commented
Jan 27, 2022
Yeah I noticed it in my other PR today, some superpmi job silently fails and then displays some previous diffs or something like that. Rebased. |
kunalspathak
commented
Jan 27, 2022
Also that might explain the huge diffs followed by timeouts that many of us are seeing. |
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Kunal Pathak <Kunal.Pathak@microsoft.com>
It seems that the snippet add x1, x0, #8mov w2, #1stlr w2,[x1]can be optimized even further on targets supporting ARMv8.4 mov w2, #1stlur w2,[x0, #8]@EgorBo As a general thought, I wonder if in voidTest(){f1=1;f2=1;}the first write needs to be store-release? Shouldn't the following be sufficient? |
EgorBo
commented
Jan 27, 2022
Good idea! Will file an issue, not sure even my M1 supports it 😄
I am not sure why I used two variables in that snippet, the issue reproduces even with a single. |
EgorBo
commented
Jan 27, 2022
@kunalspathak no irrelevant diffs after rebase: https://dev.azure.com/dnceng/public/_build/results?buildId=1576187&view=ms.vss-build-web.run-extensions-tab |
BruceForstall
commented
Jan 27, 2022
The jitrollingbuild pipeline is set to build every time the JIT changes, and not batch changes: However, it appears that AzDO doesn't kick off the build immediately; I noticed a delay of about 10 minutes for this particular change. In a few previous cases for JIT changes, there were also delays before the AzDO job kicked off, and in those cases, another change was merged before the kickoff, and AzDO built that change, not the JIT change that kicked off the job. Because of this, when we upload the JIT to Azure Storage, we use a git hash of a non-JIT change, and when superpmi.py looks for a baseline JIT, it doesn't find the hash of the JIT that should have been built. Summary: there is an assumption that the pipeline builds every JIT change at the git hash of the JIT change. That doesn't appear to be the case with AzDO. I'm not sure if there's a config to force that to happen. E.g., what if 2 JIT changes were merged at almost exactly the same time? AzDO should build both of them, but does it? Possibly we could change the jitrollingbuild.py upload script to walk back the |
BruceForstall
commented
Jan 27, 2022
Added #64392 |
Follow up to #62895
e.g.:
Codgen diff:
Same byte size, but better PerfScore (no memory barrier)