Skip to content

ARM64 - Investigate why a mov is inserted #83618

@TIHan

Description

@TIHan

This PR had a few diffs that looked like this:

R2RTest.CompileSerpCommand+<FilterAssembliesNoSimpleNameDuplicates>d__32:MoveNext():bool:this

-            cmp     w0, #0
+            tbz     w0, #31, G_M20047_IG08
+						;; size=92 bbWeight=2 PerfScore 60.00
+G_M20047_IG06:        ; bbWeight=0.50, gcrefRegs=380000 {x19 x20 x21}, byrefRegs=0000 {}, byref
             mov     x0, x19
             ; gcrRegs +[x0]
-            bge     G_M20047_IG08
-						;; size=100 bbWeight=2 PerfScore 62.00
-G_M20047_IG06:        ; bbWeight=0.50, gcrefRegs=300001 {x0 x20 x21}, byrefRegs=0000 {}, byref
-            ; gcrRegs -[x19]

It is curious that mov x0, x19 was inserted between the cmp and bge before. But now that we transform those two instructions into a single tbz, the mov is inserted after a branching operation instead of before - which may cause a perf regression.

Might be worthwhile to investigate why the mov was inserted in the first place. There were not many of these cases as a result of the PR, so it's probably a non-issue in general.

Metadata

Metadata

Assignees

No one assigned

    Labels

    arch-arm64area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMItenet-performancePerformance related issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions