Skip to content

[arm64] JIT: Make 0.0 containable for fcmp - #61617

Merged
EgorBo merged 3 commits into
dotnet:mainfrom
EgorBo:arm64-cse-small-constants
Nov 16, 2021
Merged

[arm64] JIT: Make 0.0 containable for fcmp#61617
EgorBo merged 3 commits into
dotnet:mainfrom
EgorBo:arm64-cse-small-constants

Conversation

@EgorBo

@EgorBoEgorBo commented Nov 15, 2021

Copy link
Copy Markdown
Member

A quick fix for:

voidTest(doublex){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: 28

For arm32 it requires more efforts so I decided to leave that TODO (it was there before my changes)
@dotnet/jit-contrib @echesakovMSFT

@ghostghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Nov 15, 2021
@ghost

Copy link
Copy Markdown

Tagging subscribers to this area: @JulieLeeMSFT
See info in area-owners.md if you want to be subscribed.

Issue Details

A quick fix for:

voidTest(doublex){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: 28

For arm32 it requires more effort so I decided to leave that TODO (it was there before my changes)
@dotnet/jit-contrib @echesakovMSFT

Author:EgorBo
Assignees:-
Labels:

area-CodeGen-coreclr

Milestone:-

@EgorBo

Copy link
Copy Markdown
MemberAuthor

benchmarks.run.windows.arm64.checked.mch:


Summary of Code Size diffs:
(Lower is better)
Total bytes of base: 7508032 (overridden on cmd)
Total bytes of diff: 7507532 (overridden on cmd)
Total bytes of delta: -500 (-0.01 % of base)
diff is an improvement.
relative diff is an improvement.
Detail diffs

Top file regressions (bytes):
4 : 10790.dasm (0.37% of base)
4 : 10688.dasm (0.43% of base)
Top file improvements (bytes):
-48 : 18512.dasm (-16.90% of base)
-44 : 4215.dasm (-1.49% of base)
-24 : 11922.dasm (-5.41% of base)
-16 : 14877.dasm (-0.46% of base)
-12 : 20314.dasm (-1.60% of base)
-12 : 5985.dasm (-1.70% of base)
-12 : 12471.dasm (-1.03% of base)
-12 : 21011.dasm (-7.32% of base)
-12 : 23396.dasm (-2.14% of base)
-12 : 850.dasm (-1.72% of base)
-8 : 20324.dasm (-2.22% of base)
-8 : 21986.dasm (-13.33% of base)
-8 : 21985.dasm (-13.33% of base)
-8 : 14878.dasm (-1.06% of base)
-8 : 20328.dasm (-0.83% of base)
-8 : 11506.dasm (-0.08% of base)
-8 : 21984.dasm (-2.47% of base)
-8 : 903.dasm (-0.86% of base)
-8 : 14500.dasm (-1.55% of base)
-8 : 23222.dasm (-0.08% of base)
70 total files with Code Size differences (68 improved, 2 regressed), 0 unchanged.
Top method regressions (bytes):
4 ( 0.37% of base) : 10790.dasm - System.Runtime.Serialization.Json.DataContractJsonSerializer:InternalReadObject(System.Runtime.Serialization.XmlReaderDelegator,bool):System.Object:this
4 ( 0.43% of base) : 10688.dasm - System.Runtime.Serialization.Json.DataContractJsonSerializer:InternalWriteObjectContent(System.Runtime.Serialization.XmlWriterDelegator,System.Object):this
Top method improvements (bytes):
-48 (-16.90% of base) : 18512.dasm - System.Numerics.Matrix4x4:get_IsIdentity():bool:this
-44 (-1.49% of base) : 4215.dasm - HillClimbing:Update(int,double,int):System.ValueTuple`2[Int32,Int32]:this
-24 (-5.41% of base) : 11922.dasm - Benchstone.BenchF.Regula:Inner(byref,byref,double,double,int,byref)
-16 (-0.46% of base) : 14877.dasm - LUDecomp:ludcmp(System.Double[][],int,System.Int32[],byref):int
-12 (-1.60% of base) : 20314.dasm - Benchmarks.SIMD.RayTracer.Camera:Create(Benchmarks.SIMD.RayTracer.Vector,Benchmarks.SIMD.RayTracer.Vector):Benchmarks.SIMD.RayTracer.Camera
-12 (-1.03% of base) : 12471.dasm - Benchstone.BenchF.Romber:Test():bool:this
-12 (-1.72% of base) : 850.dasm - Grisu3:TryRunDouble(double,int,byref):bool
-12 (-1.70% of base) : 5985.dasm - Grisu3:TryRunSingle(float,int,byref):bool
-12 (-7.32% of base) : 21011.dasm - System.Math:Sign(float):int
-12 (-2.14% of base) : 23396.dasm - System.Numerics.Matrix4x4:CreatePerspectiveFieldOfView(float,float,float,float):System.Numerics.Matrix4x4
-8 (-0.86% of base) : 903.dasm - <GetMeasurements>d__14:MoveNext():bool:this
-8 (-0.83% of base) : 20328.dasm - Benchmarks.SIMD.RayTracer.RayTracer:GetNaturalColor(Benchmarks.SIMD.RayTracer.SceneObject,Benchmarks.SIMD.RayTracer.Vector,Benchmarks.SIMD.RayTracer.Vector,Benchmarks.SIMD.RayTracer.Vector,Benchmarks.SIMD.RayTracer.Scene):Benchmarks.SIMD.RayTracer.Color:this
-8 (-2.22% of base) : 20324.dasm - Benchmarks.SIMD.RayTracer.Sphere:Intersect(Benchmarks.SIMD.RayTracer.Ray):Benchmarks.SIMD.RayTracer.ISect:this
-8 (-3.08% of base) : 21702.dasm - Benchstone.BenchF.Bisect:Inner(byref,byref,byref,byref)
-8 (-2.47% of base) : 21984.dasm - Benchstone.BenchF.DMath:Bench(int):bool
-8 (-13.33% of base) : 21985.dasm - Benchstone.BenchF.DMath:Fact(double):double
-8 (-13.33% of base) : 21986.dasm - Benchstone.BenchF.DMath:Power(double,double):double
-8 (-0.08% of base) : 23222.dasm - Benchstone.BenchF.LLoops:Main1(int):this
-8 (-1.25% of base) : 8383.dasm - Benchstone.BenchF.MatInv4:Test():bool:this
-8 (-0.07% of base) : 13505.dasm - Benchstone.MDBenchF.MDLLoops:Main1(int):this
Top method regressions (percentages):
4 ( 0.43% of base) : 10688.dasm - System.Runtime.Serialization.Json.DataContractJsonSerializer:InternalWriteObjectContent(System.Runtime.Serialization.XmlWriterDelegator,System.Object):this
4 ( 0.37% of base) : 10790.dasm - System.Runtime.Serialization.Json.DataContractJsonSerializer:InternalReadObject(System.Runtime.Serialization.XmlReaderDelegator,bool):System.Object:this
Top method improvements (percentages):
-48 (-16.90% of base) : 18512.dasm - System.Numerics.Matrix4x4:get_IsIdentity():bool:this
-8 (-13.33% of base) : 21985.dasm - Benchstone.BenchF.DMath:Fact(double):double
-8 (-13.33% of base) : 21986.dasm - Benchstone.BenchF.DMath:Power(double,double):double
-12 (-7.32% of base) : 21011.dasm - System.Math:Sign(float):int
-24 (-5.41% of base) : 11922.dasm - Benchstone.BenchF.Regula:Inner(byref,byref,double,double,int,byref)
-4 (-4.35% of base) : 20331.dasm - <>c:<.cctor>b__3_2(Benchmarks.SIMD.RayTracer.Vector):double:this
-8 (-3.08% of base) : 21702.dasm - Benchstone.BenchF.Bisect:Inner(byref,byref,byref,byref)
-4 (-2.94% of base) : 4219.dasm - HillClimbing:ChangeThreadCount(int,int):this
-4 (-2.86% of base) : 20332.dasm - Benchmarks.SIMD.RayTracer.Sphere:Normal(Benchmarks.SIMD.RayTracer.Vector):Benchmarks.SIMD.RayTracer.Vector:this
-8 (-2.47% of base) : 21984.dasm - Benchstone.BenchF.DMath:Bench(int):bool
-4 (-2.33% of base) : 11302.dasm - System.Numerics.Tests.Perf_Plane:EqualityOperatorBenchmark():bool:this
-4 (-2.22% of base) : 20329.dasm - <>c:<.cctor>b__3_0(Benchmarks.SIMD.RayTracer.Vector):Benchmarks.SIMD.RayTracer.Color:this
-8 (-2.22% of base) : 20324.dasm - Benchmarks.SIMD.RayTracer.Sphere:Intersect(Benchmarks.SIMD.RayTracer.Ray):Benchmarks.SIMD.RayTracer.ISect:this
-4 (-2.22% of base) : 11757.dasm - System.Numerics.Tests.Perf_Plane:InequalityOperatorBenchmark():bool:this
-12 (-2.14% of base) : 23396.dasm - System.Numerics.Matrix4x4:CreatePerspectiveFieldOfView(float,float,float,float):System.Numerics.Matrix4x4
-4 (-1.96% of base) : 9309.dasm - SocketsHttpHandler:GetHttp2StreamWindowScaleThresholdMultiplier():double
-8 (-1.75% of base) : 22156.dasm - System.Numerics.Matrix4x4:CreatePerspectiveOffCenter(float,float,float,float,float,float):System.Numerics.Matrix4x4
-12 (-1.72% of base) : 850.dasm - Grisu3:TryRunDouble(double,int,byref):bool
-12 (-1.70% of base) : 5985.dasm - Grisu3:TryRunSingle(float,int,byref):bool
-4 (-1.69% of base) : 21010.dasm - System.MathF:IEEERemainder(float,float):float
70 total methods with Code Size differences (68 improved, 2 regressed), 0 unchanged.

coreclr_tests.pmi.windows.arm64.checked.mch:


Summary of Code Size diffs:
(Lower is better)
Total bytes of base: 162867532 (overridden on cmd)
Total bytes of diff: 162864980 (overridden on cmd)
Total bytes of delta: -2552 (-0.00 % of base)
diff is an improvement.
relative diff is an improvement.
Detail diffs

Top file improvements (bytes):
-36 : 246075.dasm (-17.31% of base)
-32 : 225623.dasm (-0.10% of base)
-32 : 225629.dasm (-0.10% of base)
-28 : 223377.dasm (-0.63% of base)
-24 : 251164.dasm (-5.41% of base)
-24 : 239433.dasm (-0.18% of base)
-20 : 251487.dasm (-0.47% of base)
-16 : 224824.dasm (-5.00% of base)
-16 : 240675.dasm (-0.84% of base)
-16 : 191650.dasm (-0.66% of base)
-16 : 191749.dasm (-0.46% of base)
-16 : 224808.dasm (-1.55% of base)
-16 : 246623.dasm (-0.94% of base)
-12 : 251142.dasm (-1.08% of base)
-12 : 234489.dasm (-2.80% of base)
-12 : 252709.dasm (-1.49% of base)
-12 : 252710.dasm (-1.57% of base)
-12 : 249021.dasm (-2.05% of base)
-12 : 83336.dasm (-6.67% of base)
-12 : 228251.dasm (-1.60% of base)
503 total files with Code Size differences (503 improved, 0 regressed), 11 unchanged.
Top method improvements (bytes):
-36 (-17.31% of base) : 246075.dasm - Central_Globİı:GetPropSmallDivByBig(double,double):double
-32 (-0.10% of base) : 225623.dasm - doubleMDArrTest:Main():int
-32 (-0.10% of base) : 225629.dasm - floatMDArrTest:Main():int
-28 (-0.63% of base) : 223377.dasm - StressAllocator.StressAllocator:ParseArgs(System.String[]):bool
-24 (-5.41% of base) : 251164.dasm - Benchstone.BenchF.Regula:Inner(byref,byref,double,double,int,byref)
-24 (-0.18% of base) : 239433.dasm - ILGEN_0x372a9ae6:Method_0xdc6ff1a4(byte,byte,int,long,ushort,double,long,long):int
-20 (-0.47% of base) : 251487.dasm - _rem:main(System.String[]):int
-16 (-5.00% of base) : 224824.dasm - <>c:<Main>b__2_3(System.Single[],System.Single[],System.Single[]):bool:this
-16 (-1.55% of base) : 224808.dasm - <>c:<Main>b__2_6(System.Single[],System.Single[],System.Single[]):bool:this
-16 (-0.84% of base) : 240675.dasm - ClassLibrary.test:convex_hull(System.Collections.Generic.List`1[Vector2])
-16 (-0.66% of base) : 191650.dasm - Huffman:DoHuffIteration(System.Byte[],System.Byte[],System.Byte[],int,int,huff_node[]):long
-16 (-0.46% of base) : 191749.dasm - LUDecomp:ludcmp(System.Double[][],int,System.Int32[],byref):int
-16 (-0.94% of base) : 246623.dasm - PinStress.PinStress:Main(System.String[]):int
-12 (-1.49% of base) : 252709.dasm - <Module>:main(System.String[]):int
-12 (-1.57% of base) : 252710.dasm - <Module>:main(System.String[]):int
-12 (-1.08% of base) : 251142.dasm - Benchstone.BenchF.Romber:Bench():bool
-12 (-1.60% of base) : 228251.dasm - Camera:Create(Vector,Vector):Camera
-12 (-1.38% of base) : 228266.dasm - Color:ChangeHue(float):this
-12 (-2.80% of base) : 234489.dasm - FPBehaviorApp.Managed:ConvertDoubleToUInt64(double,int):long
-12 (-2.05% of base) : 249021.dasm - GitHub_18362:VerifyMagnitudePhaseProperties(System.Numerics.Complex,double,double,int)
Top method improvements (percentages):
-36 (-17.31% of base) : 246075.dasm - Central_Globİı:GetPropSmallDivByBig(double,double):double
-8 (-13.33% of base) : 253107.dasm - Benchstone.BenchF.DMath:Fact(double):double
-8 (-13.33% of base) : 253108.dasm - Benchstone.BenchF.DMath:Power(double,double):double
-4 (-10.00% of base) : 240663.dasm - ClassLibrary.test:abs(float):float
-8 (-8.33% of base) : 85159.dasm - _ldloc:main(System.String[]):int
-8 (-8.33% of base) : 85161.dasm - _ldloc:main(System.String[]):int
-4 (-7.69% of base) : 240664.dasm - ClassLibrary.test:dist(float,float,Line):float
-4 (-7.14% of base) : 212665.dasm - TestStructReturns:TestNativeIntFloatFieldCall2():int
-4 (-6.67% of base) : 81991.dasm - BringUpTest_JTrueNeDbl:JTrueNeDbl(double):int
-4 (-6.67% of base) : 81995.dasm - BringUpTest_JTrueNeFP:JTrueNeFP(float):int
-4 (-6.67% of base) : 240674.dasm - ClassLibrary.test:ccw(System.Numerics.Vector2,System.Numerics.Vector2,System.Numerics.Vector2):bool
-4 (-6.67% of base) : 240673.dasm - ClassLibrary.test:cw(System.Numerics.Vector2,System.Numerics.Vector2,System.Numerics.Vector2):bool
-12 (-6.67% of base) : 83336.dasm - GitHub_20657.Program:Main(System.String[]):int
-4 (-6.67% of base) : 105707.dasm - JIT.HardwareIntrinsics.Arm.Helpers:ConvertToUInt32(float):int
-4 (-6.67% of base) : 131588.dasm - JIT.HardwareIntrinsics.Arm.Helpers:ConvertToUInt32(float):int
-4 (-6.67% of base) : 136800.dasm - JIT.HardwareIntrinsics.Arm.Helpers:ConvertToUInt32(float):int
-4 (-6.67% of base) : 171630.dasm - JIT.HardwareIntrinsics.Arm.Helpers:ConvertToUInt32(float):int
-4 (-6.67% of base) : 182207.dasm - JIT.HardwareIntrinsics.Arm.Helpers:ConvertToUInt32(float):int
-4 (-6.67% of base) : 104416.dasm - JIT.HardwareIntrinsics.Arm.Helpers:ConvertToUInt32(float):int
-4 (-6.67% of base) : 15497.dasm - JIT.HardwareIntrinsics.Arm.Helpers:ConvertToUInt32(float):int
503 total methods with Code Size differences (503 improved, 0 regressed), 11 unchanged.

libraries.crossgen2.windows.arm64.checked.mch:


Summary of Code Size diffs:
(Lower is better)
Total bytes of base: 51698076 (overridden on cmd)
Total bytes of diff: 51696576 (overridden on cmd)
Total bytes of delta: -1500 (-0.00 % of base)
diff is an improvement.
relative diff is an improvement.
Detail diffs

Top file improvements (bytes):
-48 : 71464.dasm (-16.90% of base)
-40 : 68173.dasm (-1.29% of base)
-24 : 151123.dasm (-4.58% of base)
-24 : 705.dasm (-6.38% of base)
-24 : 201574.dasm (-2.62% of base)
-24 : 151117.dasm (-3.70% of base)
-20 : 90307.dasm (-2.13% of base)
-16 : 152517.dasm (-0.86% of base)
-16 : 152556.dasm (-1.23% of base)
-16 : 182002.dasm (-4.17% of base)
-16 : 130846.dasm (-2.82% of base)
-12 : 71444.dasm (-1.94% of base)
-12 : 74397.dasm (-1.50% of base)
-12 : 151119.dasm (-0.79% of base)
-12 : 693.dasm (-0.57% of base)
-12 : 77902.dasm (-6.12% of base)
-12 : 71383.dasm (-12.50% of base)
-12 : 141343.dasm (-0.96% of base)
-12 : 27076.dasm (-1.46% of base)
-12 : 19453.dasm (-2.26% of base)
243 total files with Code Size differences (243 improved, 0 regressed), 0 unchanged.
Top method improvements (bytes):
-48 (-16.90% of base) : 71464.dasm - System.Numerics.Matrix4x4:get_IsIdentity():bool:this
-40 (-1.29% of base) : 68173.dasm - HillClimbing:Update(int,double,int):System.ValueTuple`2[System.Int32, System.Int32]:this
-24 (-4.58% of base) : 151123.dasm - Microsoft.VisualBasic.Financial:DDB(double,double,double,double,double):double
-24 (-3.70% of base) : 151117.dasm - Microsoft.VisualBasic.Financial:NPer(double,double,double,double,int):double
-24 (-2.62% of base) : 201574.dasm - System.Drawing.Graphics:GetContextInfo(byref,bool,byref):this
-24 (-6.38% of base) : 705.dasm - ThreadState:LogThreadStack(double,int,Microsoft.Diagnostics.Tracing.Etlx.TraceThread,Microsoft.Diagnostics.Tracing.SampleProfilerThreadTimeComputer,bool):this
-20 (-2.13% of base) : 90307.dasm - System.Data.SqlTypes.SqlDecimal:.ctor(double):this
-16 (-1.23% of base) : 152556.dasm - Microsoft.VisualBasic.CompilerServices.BooleanType:FromObject(System.Object):bool
-16 (-0.86% of base) : 152517.dasm - Microsoft.VisualBasic.CompilerServices.Conversions:ToBoolean(System.Object):bool
-16 (-2.82% of base) : 130846.dasm - MS.Internal.Xml.XPath.StringFunctions:Substring(System.Xml.XPath.XPathNodeIterator):System.String:this
-16 (-4.17% of base) : 182002.dasm - System.Numerics.Complex:Sqrt(System.Numerics.Complex):System.Numerics.Complex
-12 (-1.50% of base) : 74397.dasm - Grisu3:TryRunDouble(double,int,byref):bool
-12 (-1.49% of base) : 74395.dasm - Grisu3:TryRunSingle(float,int,byref):bool
-12 (-1.46% of base) : 27076.dasm - Microsoft.CodeAnalysis.VisualBasic.CompileTimeCalculations:ConvertFloatingValue(double,ubyte,byref):Microsoft.CodeAnalysis.ConstantValue
-12 (-0.84% of base) : 912.dasm - Microsoft.Diagnostics.Tracing.Analysis.GC.TraceGC:GetFreeListEfficiency(System.Collections.Generic.List`1[Microsoft.Diagnostics.Tracing.Analysis.GC.TraceGC],Microsoft.Diagnostics.Tracing.Analysis.GC.TraceGC):Microsoft.Diagnostics.Tracing.Analysis.GC.FreeListEfficiency
-12 (-2.26% of base) : 19453.dasm - Microsoft.Diagnostics.Tracing.SampleProfilerThreadTimeComputer:UpdateThreadToWorkOnStartStopActivity(Microsoft.Diagnostics.Tracing.Etlx.TraceThread,Microsoft.Diagnostics.Tracing.StartStopActivity,Microsoft.Diagnostics.Tracing.TraceEvent):this
-12 (-2.26% of base) : 19348.dasm - Microsoft.Diagnostics.Tracing.ThreadTimeStackComputer:UpdateThreadToWorkOnStartStopActivity(Microsoft.Diagnostics.Tracing.Etlx.TraceThread,Microsoft.Diagnostics.Tracing.StartStopActivity,Microsoft.Diagnostics.Tracing.TraceEvent):this
-12 (-0.79% of base) : 151119.dasm - Microsoft.VisualBasic.Financial:IRR(byref,double):double
-12 (-0.97% of base) : 141345.dasm - OperatorIntrinsics:gen@5470(double,double,double,Microsoft.FSharp.Core.Unit):System.Collections.Generic.IEnumerator`1[System.Double]
-12 (-0.96% of base) : 141343.dasm - OperatorIntrinsics:gen@5470-1(float,float,float,Microsoft.FSharp.Core.Unit):System.Collections.Generic.IEnumerator`1[System.Single]
Top method improvements (percentages):
-48 (-16.90% of base) : 71464.dasm - System.Numerics.Matrix4x4:get_IsIdentity():bool:this
-8 (-13.33% of base) : 161617.dasm - System.Drawing.PointF:get_IsEmpty():bool:this
-8 (-13.33% of base) : 161533.dasm - System.Drawing.RectangleF:get_IsEmpty():bool:this
-8 (-13.33% of base) : 161470.dasm - System.Drawing.SizeF:get_IsEmpty():bool:this
-12 (-12.50% of base) : 71383.dasm - System.Numerics.Quaternion:get_IsIdentity():bool:this
-4 (-12.50% of base) : 685.dasm - ThreadState:get_ThreadBlocked():bool:this
-4 (-12.50% of base) : 700.dasm - ThreadState:get_ThreadBlocked():bool:this
-4 (-12.50% of base) : 699.dasm - ThreadState:get_ThreadUninitialized():bool:this
-4 (-12.50% of base) : 684.dasm - ThreadState:get_ThreadUninitialized():bool:this
-8 (-11.76% of base) : 201477.dasm - System.Drawing.NumericsExtensions:IsEmpty(System.Numerics.Vector2):bool
-8 (-11.11% of base) : 892.dasm - Microsoft.Diagnostics.Tracing.Analysis.GC.BGCAllocWaitInfo:GetWaitTime(byref):bool:this
-4 (-9.09% of base) : 950.dasm - Microsoft.Diagnostics.Tracing.Analysis.JIT.TraceJittedMethod:get_DistanceAhead():double:this
-4 (-9.09% of base) : 19178.dasm - Microsoft.Diagnostics.Tracing.TraceEventSource:DataLifetimeEnabled():bool:this
-4 (-9.09% of base) : 70977.dasm - System.Globalization.CalendricalCalculationsHelper:AsSeason(double):double
-4 (-8.33% of base) : 152219.dasm - ForLoopControl:ForNextCheckR4(float,float,float):bool
-4 (-8.33% of base) : 152218.dasm - ForLoopControl:ForNextCheckR8(double,double,double):bool
-4 (-8.33% of base) : 151504.dasm - Microsoft.VisualBasic.Conversion:Fix(double):double
-4 (-8.33% of base) : 131170.dasm - MS.Internal.Xml.XPath.BooleanFunctions:toBoolean(double):bool
-4 (-7.69% of base) : 19355.dasm - Microsoft.Diagnostics.Tracing.StartStopActivity:RememberStop(int,double,int):this
-4 (-7.69% of base) : 76467.dasm - System.Convert:ToBoolean(double):bool
243 total methods with Code Size differences (243 improved, 0 regressed), 0 unchanged.

libraries.pmi.windows.arm64.checked.mch:


Summary of Code Size diffs:
(Lower is better)
Total bytes of base: 50803132 (overridden on cmd)
Total bytes of diff: 50801744 (overridden on cmd)
Total bytes of delta: -1388 (-0.00 % of base)
diff is an improvement.
relative diff is an improvement.
Detail diffs

Top file regressions (bytes):
8 : 52379.dasm (0.76% of base)
4 : 120078.dasm (0.35% of base)
4 : 120080.dasm (0.43% of base)
Top file improvements (bytes):
-32 : 150086.dasm (-0.79% of base)
-24 : 102311.dasm (-7.59% of base)
-24 : 151130.dasm (-4.58% of base)
-24 : 151124.dasm (-5.08% of base)
-24 : 179284.dasm (-3.16% of base)
-20 : 111084.dasm (-2.54% of base)
-20 : 150791.dasm (-1.92% of base)
-16 : 211847.dasm (-4.17% of base)
-16 : 151136.dasm (-2.25% of base)
-16 : 121572.dasm (-3.31% of base)
-16 : 149744.dasm (-1.11% of base)
-16 : 149639.dasm (-1.57% of base)
-12 : 211882.dasm (-7.89% of base)
-12 : 67638.dasm (-1.99% of base)
-12 : 232476.dasm (-0.32% of base)
-12 : 151128.dasm (-0.96% of base)
-12 : 83983.dasm (-2.31% of base)
-12 : 102323.dasm (-0.86% of base)
-12 : 13089.dasm (-1.01% of base)
-12 : 211879.dasm (-8.57% of base)
232 total files with Code Size differences (229 improved, 3 regressed), 3 unchanged.
Top method regressions (bytes):
8 ( 0.76% of base) : 52379.dasm - Microsoft.CodeAnalysis.VisualBasic.Symbols.ReducedExtensionMethodSymbol:.ctor(Microsoft.CodeAnalysis.VisualBasic.Symbols.TypeSymbol,Microsoft.CodeAnalysis.VisualBasic.Symbols.MethodSymbol,System.Collections.Immutable.ImmutableArray`1[[System.Collections.Generic.KeyValuePair`2[[Microsoft.CodeAnalysis.VisualBasic.Symbols.TypeParameterSymbol, Microsoft.CodeAnalysis.VisualBasic, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35],[Microsoft.CodeAnalysis.VisualBasic.Symbols.TypeSymbol, Microsoft.CodeAnalysis.VisualBasic, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]], System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]],int):this
4 ( 0.35% of base) : 120078.dasm - System.Runtime.Serialization.Json.DataContractJsonSerializer:InternalReadObject(System.Runtime.Serialization.XmlReaderDelegator,bool):System.Object:this
4 ( 0.43% of base) : 120080.dasm - System.Runtime.Serialization.Json.DataContractJsonSerializer:InternalWriteObjectContent(System.Runtime.Serialization.XmlWriterDelegator,System.Object):this
Top method improvements (bytes):
-32 (-0.79% of base) : 150086.dasm - Microsoft.VisualBasic.CompilerServices.ObjectType:ObjTst(System.Object,System.Object,bool):int
-24 (-5.08% of base) : 151124.dasm - Microsoft.VisualBasic.Financial:DDB(double,double,double,double,double):double
-24 (-4.58% of base) : 151130.dasm - Microsoft.VisualBasic.Financial:NPer(double,double,double,double,int):double
-24 (-3.16% of base) : 179284.dasm - System.Drawing.Graphics:GetContextInfo(byref,bool,byref):this
-24 (-7.59% of base) : 102311.dasm - ThreadState:LogThreadStack(double,int,Microsoft.Diagnostics.Tracing.Etlx.TraceThread,Microsoft.Diagnostics.Tracing.SampleProfilerThreadTimeComputer,bool):this
-20 (-1.92% of base) : 150791.dasm - Microsoft.VisualBasic.DateAndTime:DateAdd(int,double,System.DateTime):System.DateTime
-20 (-2.54% of base) : 111084.dasm - System.Data.SqlTypes.SqlDecimal:.ctor(double):this
-16 (-1.57% of base) : 149639.dasm - Microsoft.VisualBasic.CompilerServices.BooleanType:FromObject(System.Object):bool
-16 (-1.11% of base) : 149744.dasm - Microsoft.VisualBasic.CompilerServices.Conversions:ToBoolean(System.Object):bool
-16 (-2.25% of base) : 151136.dasm - Microsoft.VisualBasic.Financial:Rate(double,double,double,double,int,double):double
-16 (-3.31% of base) : 121572.dasm - MS.Internal.Xml.XPath.StringFunctions:Substring(System.Xml.XPath.XPathNodeIterator):System.String:this
-16 (-4.17% of base) : 211847.dasm - System.Numerics.Complex:Sqrt(System.Numerics.Complex):System.Numerics.Complex
-12 (-0.32% of base) : 232476.dasm - <ReadMIbcGroup>d__4:MoveNext():bool:this
-12 (-1.99% of base) : 67638.dasm - Microsoft.CodeAnalysis.VisualBasic.CompileTimeCalculations:ConvertFloatingValue(double,ubyte,byref):Microsoft.CodeAnalysis.ConstantValue
-12 (-1.15% of base) : 102130.dasm - Microsoft.Diagnostics.Tracing.Analysis.GC.TraceGC:GetFreeListEfficiency(System.Collections.Generic.List`1[[Microsoft.Diagnostics.Tracing.Analysis.GC.TraceGC, Microsoft.Diagnostics.Tracing.TraceEvent, Version=2.0.65.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]],Microsoft.Diagnostics.Tracing.Analysis.GC.TraceGC):Microsoft.Diagnostics.Tracing.Analysis.GC.FreeListEfficiency
-12 (-2.31% of base) : 83983.dasm - Microsoft.Diagnostics.Tracing.SampleProfilerThreadTimeComputer:UpdateThreadToWorkOnStartStopActivity(Microsoft.Diagnostics.Tracing.Etlx.TraceThread,Microsoft.Diagnostics.Tracing.StartStopActivity,Microsoft.Diagnostics.Tracing.TraceEvent):this
-12 (-2.31% of base) : 84088.dasm - Microsoft.Diagnostics.Tracing.ThreadTimeStackComputer:UpdateThreadToWorkOnStartStopActivity(Microsoft.Diagnostics.Tracing.Etlx.TraceThread,Microsoft.Diagnostics.Tracing.StartStopActivity,Microsoft.Diagnostics.Tracing.TraceEvent):this
-12 (-0.96% of base) : 151128.dasm - Microsoft.VisualBasic.Financial:IRR(byref,double):double
-12 (-1.71% of base) : 106117.dasm - Newtonsoft.Json.Linq.JValue:CompareBigInteger(System.Numerics.BigInteger,System.Object):int
-12 (-1.01% of base) : 13087.dasm - OperatorIntrinsics:gen@5470(double,double,double,Microsoft.FSharp.Core.Unit):System.Collections.Generic.IEnumerator`1[Double]
Top method regressions (percentages):
8 ( 0.76% of base) : 52379.dasm - Microsoft.CodeAnalysis.VisualBasic.Symbols.ReducedExtensionMethodSymbol:.ctor(Microsoft.CodeAnalysis.VisualBasic.Symbols.TypeSymbol,Microsoft.CodeAnalysis.VisualBasic.Symbols.MethodSymbol,System.Collections.Immutable.ImmutableArray`1[[System.Collections.Generic.KeyValuePair`2[[Microsoft.CodeAnalysis.VisualBasic.Symbols.TypeParameterSymbol, Microsoft.CodeAnalysis.VisualBasic, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35],[Microsoft.CodeAnalysis.VisualBasic.Symbols.TypeSymbol, Microsoft.CodeAnalysis.VisualBasic, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]], System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]],int):this
4 ( 0.43% of base) : 120080.dasm - System.Runtime.Serialization.Json.DataContractJsonSerializer:InternalWriteObjectContent(System.Runtime.Serialization.XmlWriterDelegator,System.Object):this
4 ( 0.35% of base) : 120078.dasm - System.Runtime.Serialization.Json.DataContractJsonSerializer:InternalReadObject(System.Runtime.Serialization.XmlReaderDelegator,bool):System.Object:this
Top method improvements (percentages):
-8 (-15.38% of base) : 179597.dasm - System.Drawing.NumericsExtensions:IsEmpty(System.Numerics.Vector2):bool
-8 (-13.33% of base) : 181488.dasm - System.Drawing.PointF:get_IsEmpty():bool:this
-8 (-13.33% of base) : 181580.dasm - System.Drawing.RectangleF:get_IsEmpty():bool:this
-8 (-13.33% of base) : 181630.dasm - System.Drawing.SizeF:get_IsEmpty():bool:this
-4 (-12.50% of base) : 84278.dasm - Microsoft.Diagnostics.Tracing.TraceEventSource:DataLifetimeEnabled():bool:this
-4 (-12.50% of base) : 102316.dasm - ThreadState:get_ThreadBlocked():bool:this
-4 (-12.50% of base) : 102331.dasm - ThreadState:get_ThreadBlocked():bool:this
-4 (-12.50% of base) : 102317.dasm - ThreadState:get_ThreadUninitialized():bool:this
-4 (-12.50% of base) : 102332.dasm - ThreadState:get_ThreadUninitialized():bool:this
-8 (-11.11% of base) : 102134.dasm - Microsoft.Diagnostics.Tracing.Analysis.GC.BGCAllocWaitInfo:GetWaitTime(byref):bool:this
-4 (-9.09% of base) : 102076.dasm - Microsoft.Diagnostics.Tracing.Analysis.JIT.TraceJittedMethod:get_DistanceAhead():double:this
-12 (-8.57% of base) : 211879.dasm - System.Numerics.Complex:Asin(System.Numerics.Complex):System.Numerics.Complex
-4 (-8.33% of base) : 150013.dasm - ForLoopControl:ForNextCheckR4(float,float,float):bool
-4 (-8.33% of base) : 150014.dasm - ForLoopControl:ForNextCheckR8(double,double,double):bool
-4 (-8.33% of base) : 230148.dasm - ILCompiler.ReadyToRunFileLayoutOptimizer:<ApplyMethodSort>g__ComputeHotColdRegion|7_2(ILCompiler.DependencyAnalysis.ReadyToRun.MethodWithGCInfo):int:this
-4 (-8.33% of base) : 150753.dasm - Microsoft.VisualBasic.Conversion:Fix(double):double
-4 (-8.33% of base) : 121215.dasm - MS.Internal.Xml.XPath.BooleanFunctions:toBoolean(double):bool
-12 (-7.89% of base) : 211882.dasm - System.Numerics.Complex:Acos(System.Numerics.Complex):System.Numerics.Complex
-4 (-7.69% of base) : 84077.dasm - Microsoft.Diagnostics.Tracing.StartStopActivity:RememberStop(int,double,int):this
-24 (-7.59% of base) : 102311.dasm - ThreadState:LogThreadStack(double,int,Microsoft.Diagnostics.Tracing.Etlx.TraceThread,Microsoft.Diagnostics.Tracing.SampleProfilerThreadTimeComputer,bool):this
232 total methods with Code Size differences (229 improved, 3 regressed), 3 unchanged.

libraries_tests.pmi.windows.arm64.checked.mch:


Summary of Code Size diffs:
(Lower is better)
Total bytes of base: 115440620 (overridden on cmd)
Total bytes of diff: 115439644 (overridden on cmd)
Total bytes of delta: -976 (-0.00 % of base)
diff is an improvement.
relative diff is an improvement.
Detail diffs

Top file regressions (bytes):
12 : 174431.dasm (17.65% of base)
12 : 75942.dasm (12.50% of base)
4 : 75944.dasm (5.00% of base)
Top file improvements (bytes):
-48 : 281597.dasm (-8.39% of base)
-32 : 154502.dasm (-3.88% of base)
-28 : 72342.dasm (-0.74% of base)
-24 : 281632.dasm (-8.82% of base)
-24 : 325084.dasm (-1.26% of base)
-24 : 325826.dasm (-1.27% of base)
-24 : 72340.dasm (-0.98% of base)
-24 : 324298.dasm (-7.79% of base)
-24 : 281647.dasm (-8.82% of base)
-16 : 182988.dasm (-0.94% of base)
-16 : 156392.dasm (-2.92% of base)
-16 : 324300.dasm (-5.00% of base)
-16 : 154504.dasm (-2.33% of base)
-16 : 156393.dasm (-1.52% of base)
-16 : 72343.dasm (-0.42% of base)
-12 : 155826.dasm (-0.62% of base)
-12 : 190139.dasm (-4.76% of base)
-12 : 66213.dasm (-4.76% of base)
-12 : 308928.dasm (-0.60% of base)
-12 : 65755.dasm (-0.59% of base)
138 total files with Code Size differences (135 improved, 3 regressed), 1 unchanged.
Top method regressions (bytes):
12 (17.65% of base) : 174431.dasm - <>c:<GetArrayDataReference_NullInput_ThrowsNullRef>b__46_1():System.Object:this
12 (12.50% of base) : 75942.dasm - <>c:<GetByte_Invalid>b__7_0():System.Object:this
4 ( 5.00% of base) : 75944.dasm - <>c:<SetByte_Invalid>b__12_0():this
Top method improvements (bytes):
-48 (-8.39% of base) : 281597.dasm - System.Drawing.PrimitivesTest.RectangleFTests:IsEmptyTest():this
-32 (-3.88% of base) : 154502.dasm - MonoTests.System.Drawing.GraphicsTest:MeasureString_StringFont():this
-28 (-0.74% of base) : 72342.dasm - System.Tests.TimeZoneInfoTests:ConvertTime_DateTime_LocalToLocal()
-24 (-1.26% of base) : 325084.dasm - DataContractJsonSerializerTests:DCJS_DateTimeAsRoot()
-24 (-1.27% of base) : 325826.dasm - DataContractJsonSerializerTests:DCJS_DateTimeAsRoot()
-24 (-8.82% of base) : 281632.dasm - System.Drawing.PrimitivesTest.SizeFTests:IsEmptyDefaultsTest():this
-24 (-8.82% of base) : 281647.dasm - System.Drawing.PrimitivesTests.PointFTests:IsEmptyDefaultsTest():this
-24 (-7.79% of base) : 324298.dasm - System.Numerics.Tests.ComplexTests:VerifyPow_Complex_Double(double,double,double)
-24 (-0.98% of base) : 72340.dasm - System.Tests.TimeZoneInfoTests:ConvertTime_DateTime_UtcToLocal()
-16 (-2.33% of base) : 154504.dasm - MonoTests.System.Drawing.GraphicsTest:MeasureString_StringFontSizeF():this
-16 (-1.52% of base) : 156393.dasm - System.Drawing.Tests.Graphics_GetContextTests:GetContextInfo_New_Clipping():this
-16 (-2.92% of base) : 156392.dasm - System.Drawing.Tests.Graphics_GetContextTests:GetContextInfo_New_DefaultGraphics():this
-16 (-0.94% of base) : 182988.dasm - System.Net.Sockets.Tests.TelemetryTest:VerifyEventCounters(System.Collections.Concurrent.ConcurrentQueue`1[[System.ValueTuple`2[[System.Diagnostics.Tracing.EventWrittenEventArgs, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Guid, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]],int,bool,bool,bool)
-16 (-5.00% of base) : 324300.dasm - System.Numerics.Tests.ComplexTests:VerifyPow_Complex_Complex(double,double,double,double)
-16 (-0.42% of base) : 72343.dasm - System.Tests.TimeZoneInfoTests:ConvertTime_DateTime_LocalToUtc()
-12 (-0.59% of base) : 65755.dasm - DataContractSerializerTests:DCS_DateTimeOffsetAsRoot()
-12 (-0.58% of base) : 189809.dasm - DataContractSerializerTests:DCS_DateTimeOffsetAsRoot()
-12 (-4.76% of base) : 190139.dasm - SerializationTestTypes.ComparisonHelper:CompareDoubleApproximately(double,double):bool
-12 (-4.76% of base) : 66213.dasm - SerializationTestTypes.ComparisonHelper:CompareDoubleApproximately(double,double):bool
-12 (-0.62% of base) : 155826.dasm - System.Drawing.Drawing2D.Tests.LinearGradientBrushTests:Ctor_RectangleF_Color_Color_Angle(System.Drawing.Rectangle,System.Drawing.Color,System.Drawing.Color,float):this
Top method regressions (percentages):
12 (17.65% of base) : 174431.dasm - <>c:<GetArrayDataReference_NullInput_ThrowsNullRef>b__46_1():System.Object:this
12 (12.50% of base) : 75942.dasm - <>c:<GetByte_Invalid>b__7_0():System.Object:this
4 ( 5.00% of base) : 75944.dasm - <>c:<SetByte_Invalid>b__12_0():this
Top method improvements (percentages):
-4 (-14.29% of base) : 127369.dasm - <>c:<GenerateDoubleLiteralExpression>b__8_0(double):bool:this
-4 (-14.29% of base) : 127371.dasm - <>c:<GenerateSingleLiteralExpression>b__9_0(float):bool:this
-4 (-14.29% of base) : 62840.dasm - <>c:<ValidateEventCounters>b__10_7(double):bool:this
-8 (-11.11% of base) : 281633.dasm - System.Drawing.PrimitivesTest.SizeFTests:IsEmptyRandomTest(float,float):this
-8 (-11.11% of base) : 281648.dasm - System.Drawing.PrimitivesTests.PointFTests:IsEmptyRandomTest(float,float):this
-24 (-8.82% of base) : 281632.dasm - System.Drawing.PrimitivesTest.SizeFTests:IsEmptyDefaultsTest():this
-24 (-8.82% of base) : 281647.dasm - System.Drawing.PrimitivesTests.PointFTests:IsEmptyDefaultsTest():this
-48 (-8.39% of base) : 281597.dasm - System.Drawing.PrimitivesTest.RectangleFTests:IsEmptyTest():this
-4 (-8.33% of base) : 62842.dasm - <>c:<ValidateEventCounters>b__10_12(double):this
-24 (-7.79% of base) : 324298.dasm - System.Numerics.Tests.ComplexTests:VerifyPow_Complex_Double(double,double,double)
-12 (-7.50% of base) : 309013.dasm - System.Numerics.Tests.QuaternionTests:QuaternionCreateFromAxisAngleTest1():this
-4 (-6.25% of base) : 319782.dasm - System.Tests.NumberHelper`1[Byte][System.Byte]:CreateSaturating(double):ubyte
-4 (-6.25% of base) : 319800.dasm - System.Tests.NumberHelper`1[Byte][System.Byte]:TryCreate(double,byref):bool
-16 (-5.00% of base) : 324300.dasm - System.Numerics.Tests.ComplexTests:VerifyPow_Complex_Complex(double,double,double,double)
-12 (-4.76% of base) : 190139.dasm - SerializationTestTypes.ComparisonHelper:CompareDoubleApproximately(double,double):bool
-12 (-4.76% of base) : 66213.dasm - SerializationTestTypes.ComparisonHelper:CompareDoubleApproximately(double,double):bool
-4 (-4.17% of base) : 110751.dasm - shrinker@573-14:Invoke(System.Tuple`2[Double,Double]):bool:this
-32 (-3.88% of base) : 154502.dasm - MonoTests.System.Drawing.GraphicsTest:MeasureString_StringFont():this
-4 (-3.45% of base) : 138358.dasm - NuGet.Protocol.Plugins.Progress:IsValidPercentage(System.Nullable`1[Double]):bool
-8 (-3.45% of base) : 324058.dasm - System.Numerics.Tests.logTest:ApproxEqual(double,double):bool
138 total methods with Code Size differences (135 improved, 3 regressed), 1 unchanged.

assert(!op1->isContained());
assert(op1Type == op2Type);

if (op2->IsIntegralConst(0))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@EgorBo So, effectively, this was always dead code, right?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@echesakovMSFT yep

Comment threadsrc/coreclr/jit/lowerarmarch.cpp Outdated

@kunalspathakkunalspathak left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment threadsrc/coreclr/jit/lowerarmarch.cpp Outdated

@echesakovechesakov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Can you share what the regressions look like?

@EgorBo

Copy link
Copy Markdown
MemberAuthor

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
https://www.diffchecker.com/EvuKLYkT
https://www.diffchecker.com/MSo6JjAA

@kunalspathak

Copy link
Copy Markdown
Contributor

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 https://www.diffchecker.com/EvuKLYkThttps://www.diffchecker.com/MSo6JjAA

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
EgorBo merged commit c397327 into dotnet:mainNov 16, 2021
@agocke

Copy link
Copy Markdown
Member

@EgorBo

Copy link
Copy Markdown
MemberAuthor

@agocke definitely not possible, this PR only touches two jit .cpp files which are not used in mono

Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@EgorBo@kunalspathak@agocke@echesakov