Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip CSE for non-hoistable floats #57438

Merged
merged 9 commits into from
Aug 17, 2021
Merged

Conversation

EgorBo
Copy link
Member

@EgorBo EgorBo commented Aug 15, 2021

Fixes #57087 regression (I checked the actual benchmark after this PR).

if we decide not to hoist a FP value - we better also skip CSE for it. Example (Linux, where we don't have callee-saved XMMs):

public static void Testik()
{
    for (int i = 0; i < 100; i++)
    {
        Console.WriteLine(3.14f);
        Console.WriteLine(3.14f);
    }
}

Codegen diff: https://www.diffchecker.com/gHTKTLAf

@AndyAyersMS proposed a better fix, but it's more complicated and unlikely to make into .NET 6.0. Also, since SuperPMI.py's diff is quite small and mostly an improvement (including Burgers.Test0) I decided to give it a try.

benchmarks.run.Linux.x64.checked.mch:


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 7249
Total bytes of diff: 7031
Total bytes of delta: -218 (-3.007% of base)
Total relative delta: -0.57
    diff is an improvement.
    relative diff is an improvement.
Detail diffs


Top file regressions (bytes):
           6 : 29412.dasm (0.753% of base)
           4 : 15315.dasm (1.493% of base)
           4 : 12554.dasm (0.811% of base)

Top file improvements (bytes):
         -39 : 15893.dasm (-14.130% of base)
         -33 : 28001.dasm (-9.348% of base)
         -33 : 28334.dasm (-8.847% of base)
         -27 : 18116.dasm (-5.357% of base)
         -24 : 27577.dasm (-6.723% of base)
         -24 : 28196.dasm (-6.366% of base)
         -22 : 12884.dasm (-3.416% of base)
         -17 : 27873.dasm (-4.427% of base)
         -12 : 14186.dasm (-1.329% of base)
          -1 : 27657.dasm (-0.158% of base)

13 total files with Code Size differences (10 improved, 3 regressed), 2 unchanged.

Top method regressions (bytes):
           6 (0.753% of base) : 29412.dasm - Benchstone.BenchF.Lorenz:Test():bool:this
           4 (0.811% of base) : 12554.dasm - Benchmarks.SIMD.RayTracer.RayTracer:RenderSequential(Benchmarks.SIMD.RayTracer.Scene,System.Int32[]):this
           4 (1.493% of base) : 15315.dasm - Benchstone.BenchF.Secant:Test():bool:this

Top method improvements (bytes):
         -39 (-14.130% of base) : 15893.dasm - Benchstone.BenchF.Simpsn:Test():bool:this
         -33 (-8.847% of base) : 28334.dasm - Algorithms.ScalarDoubleRenderer:RenderSingleThreadedWithADT(float,float,float,float,float):this
         -33 (-9.348% of base) : 28001.dasm - Algorithms.ScalarFloatRenderer:RenderSingleThreadedWithADT(float,float,float,float,float):this
         -27 (-5.357% of base) : 18116.dasm - BenchmarksGame.Mandelbrot_2:DoBench(int,System.IO.MemoryStream,bool)
         -24 (-6.366% of base) : 28196.dasm - Algorithms.ScalarDoubleRenderer:RenderSingleThreadedNoADT(float,float,float,float,float):this
         -24 (-6.723% of base) : 27577.dasm - Algorithms.ScalarFloatRenderer:RenderSingleThreadedNoADT(float,float,float,float,float):this
         -22 (-3.416% of base) : 12884.dasm - Benchstone.BenchF.NewtE:Test():bool:this
         -17 (-4.427% of base) : 27873.dasm - Benchstone.BenchF.DMath:Bench(int):bool
         -12 (-1.329% of base) : 14186.dasm - Benchstone.BenchF.Romber:Test():bool:this
          -1 (-0.158% of base) : 27657.dasm - Burgers:GetCalculated0(int,int,double,double,double,System.Double[]):System.Double[]

Top method regressions (percentages):
           4 (1.493% of base) : 15315.dasm - Benchstone.BenchF.Secant:Test():bool:this
           4 (0.811% of base) : 12554.dasm - Benchmarks.SIMD.RayTracer.RayTracer:RenderSequential(Benchmarks.SIMD.RayTracer.Scene,System.Int32[]):this
           6 (0.753% of base) : 29412.dasm - Benchstone.BenchF.Lorenz:Test():bool:this

Top method improvements (percentages):
         -39 (-14.130% of base) : 15893.dasm - Benchstone.BenchF.Simpsn:Test():bool:this
         -33 (-9.348% of base) : 28001.dasm - Algorithms.ScalarFloatRenderer:RenderSingleThreadedWithADT(float,float,float,float,float):this
         -33 (-8.847% of base) : 28334.dasm - Algorithms.ScalarDoubleRenderer:RenderSingleThreadedWithADT(float,float,float,float,float):this
         -24 (-6.723% of base) : 27577.dasm - Algorithms.ScalarFloatRenderer:RenderSingleThreadedNoADT(float,float,float,float,float):this
         -24 (-6.366% of base) : 28196.dasm - Algorithms.ScalarDoubleRenderer:RenderSingleThreadedNoADT(float,float,float,float,float):this
         -27 (-5.357% of base) : 18116.dasm - BenchmarksGame.Mandelbrot_2:DoBench(int,System.IO.MemoryStream,bool)
         -17 (-4.427% of base) : 27873.dasm - Benchstone.BenchF.DMath:Bench(int):bool
         -22 (-3.416% of base) : 12884.dasm - Benchstone.BenchF.NewtE:Test():bool:this
         -12 (-1.329% of base) : 14186.dasm - Benchstone.BenchF.Romber:Test():bool:this
          -1 (-0.158% of base) : 27657.dasm - Burgers:GetCalculated0(int,int,double,double,double,System.Double[]):System.Double[]

13 total methods with Code Size differences (10 improved, 3 regressed), 2 unchanged.


coreclr_tests.pmi.Linux.x64.checked.mch:


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 11583
Total bytes of diff: 11481
Total bytes of delta: -102 (-0.881% of base)
Total relative delta: -0.28
    diff is an improvement.
    relative diff is an improvement.
Detail diffs


Top file regressions (bytes):
          48 : 253058.dasm (6.887% of base)
           7 : 242019.dasm (1.566% of base)
           7 : 242002.dasm (1.471% of base)
           6 : 248138.dasm (0.753% of base)
           4 : 221237.dasm (0.835% of base)
           4 : 221119.dasm (0.811% of base)
           4 : 221239.dasm (0.749% of base)
           3 : 222748.dasm (1.154% of base)
           3 : 222750.dasm (1.167% of base)

Top file improvements (bytes):
         -33 : 222703.dasm (-8.847% of base)
         -33 : 222708.dasm (-9.348% of base)
         -27 : 247239.dasm (-5.357% of base)
         -24 : 222709.dasm (-6.723% of base)
         -24 : 222704.dasm (-6.366% of base)
         -23 : 238096.dasm (-1.505% of base)
         -17 : 248125.dasm (-4.315% of base)
          -4 : 238790.dasm (-0.670% of base)
          -2 : 246410.dasm (-0.348% of base)
          -1 : 242801.dasm (-0.158% of base)

19 total files with Code Size differences (10 improved, 9 regressed), 4 unchanged.

Top method regressions (bytes):
          48 (6.887% of base) : 253058.dasm - pow0:Main():int
           7 (1.566% of base) : 242019.dasm - MathFusedMultiplyAddTest.Program:TestDoubles()
           7 (1.471% of base) : 242002.dasm - MathFusedMultiplyAddTest.Program:TestFloats()
           6 (0.753% of base) : 248138.dasm - Benchstone.BenchF.Lorenz:Bench():bool
           4 (0.835% of base) : 221237.dasm - <>c__DisplayClass5_0:<RenderParallel>b__0(int):this
           4 (0.749% of base) : 221239.dasm - <>c__DisplayClass6_0:<RenderParallelShowingThreads>b__1(int,System.Threading.Tasks.ParallelLoopState,float):float:this
           4 (0.811% of base) : 221119.dasm - RayTracer:RenderSequential(Scene,System.Int32[]):this
           3 (1.154% of base) : 222748.dasm - <>c__DisplayClass4_0:<RenderMultiThreadedWithADT>b__0(int):this
           3 (1.167% of base) : 222750.dasm - <>c__DisplayClass4_0:<RenderMultiThreadedWithADT>b__0(int):this

Top method improvements (bytes):
         -33 (-8.847% of base) : 222703.dasm - Algorithms.ScalarDoubleRenderer:RenderSingleThreadedWithADT(float,float,float,float,float):this
         -33 (-9.348% of base) : 222708.dasm - Algorithms.ScalarFloatRenderer:RenderSingleThreadedWithADT(float,float,float,float,float):this
         -27 (-5.357% of base) : 247239.dasm - BenchmarksGame.Mandelbrot_2:DoBench(int,System.IO.MemoryStream,bool)
         -24 (-6.366% of base) : 222704.dasm - Algorithms.ScalarDoubleRenderer:RenderSingleThreadedNoADT(float,float,float,float,float):this
         -24 (-6.723% of base) : 222709.dasm - Algorithms.ScalarFloatRenderer:RenderSingleThreadedNoADT(float,float,float,float,float):this
         -23 (-1.505% of base) : 238096.dasm - BilinearTest:RunTests():this
         -17 (-4.315% of base) : 248125.dasm - Benchstone.BenchF.DMath:Bench(int):bool
          -4 (-0.670% of base) : 238790.dasm - Program:Main(System.String[]):int
          -2 (-0.348% of base) : 246410.dasm - DefaultNamespace.GCQueue:MakeLeak(int,int):this
          -1 (-0.158% of base) : 242801.dasm - Burgers:GetCalculated0(int,int,double,double,double,System.Double[]):System.Double[]

Top method regressions (percentages):
          48 (6.887% of base) : 253058.dasm - pow0:Main():int
           7 (1.566% of base) : 242019.dasm - MathFusedMultiplyAddTest.Program:TestDoubles()
           7 (1.471% of base) : 242002.dasm - MathFusedMultiplyAddTest.Program:TestFloats()
           3 (1.167% of base) : 222750.dasm - <>c__DisplayClass4_0:<RenderMultiThreadedWithADT>b__0(int):this
           3 (1.154% of base) : 222748.dasm - <>c__DisplayClass4_0:<RenderMultiThreadedWithADT>b__0(int):this
           4 (0.835% of base) : 221237.dasm - <>c__DisplayClass5_0:<RenderParallel>b__0(int):this
           4 (0.811% of base) : 221119.dasm - RayTracer:RenderSequential(Scene,System.Int32[]):this
           6 (0.753% of base) : 248138.dasm - Benchstone.BenchF.Lorenz:Bench():bool
           4 (0.749% of base) : 221239.dasm - <>c__DisplayClass6_0:<RenderParallelShowingThreads>b__1(int,System.Threading.Tasks.ParallelLoopState,float):float:this

Top method improvements (percentages):
         -33 (-9.348% of base) : 222708.dasm - Algorithms.ScalarFloatRenderer:RenderSingleThreadedWithADT(float,float,float,float,float):this
         -33 (-8.847% of base) : 222703.dasm - Algorithms.ScalarDoubleRenderer:RenderSingleThreadedWithADT(float,float,float,float,float):this
         -24 (-6.723% of base) : 222709.dasm - Algorithms.ScalarFloatRenderer:RenderSingleThreadedNoADT(float,float,float,float,float):this
         -24 (-6.366% of base) : 222704.dasm - Algorithms.ScalarDoubleRenderer:RenderSingleThreadedNoADT(float,float,float,float,float):this
         -27 (-5.357% of base) : 247239.dasm - BenchmarksGame.Mandelbrot_2:DoBench(int,System.IO.MemoryStream,bool)
         -17 (-4.315% of base) : 248125.dasm - Benchstone.BenchF.DMath:Bench(int):bool
         -23 (-1.505% of base) : 238096.dasm - BilinearTest:RunTests():this
          -4 (-0.670% of base) : 238790.dasm - Program:Main(System.String[]):int
          -2 (-0.348% of base) : 246410.dasm - DefaultNamespace.GCQueue:MakeLeak(int,int):this
          -1 (-0.158% of base) : 242801.dasm - Burgers:GetCalculated0(int,int,double,double,double,System.Double[]):System.Double[]

19 total methods with Code Size differences (10 improved, 9 regressed), 4 unchanged.


libraries.crossgen2.Linux.x64.checked.mch:


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 1206
Total bytes of diff: 1199
Total bytes of delta: -7 (-0.580% of base)
Total relative delta: -0.06
    diff is an improvement.
    relative diff is an improvement.
Detail diffs


Top file regressions (bytes):
           5 : 114816.dasm (0.649% of base)

Top file improvements (bytes):
         -10 : 70059.dasm (-6.369% of base)
          -2 : 70060.dasm (-0.719% of base)

3 total files with Code Size differences (2 improved, 1 regressed), 0 unchanged.

Top method regressions (bytes):
           5 (0.649% of base) : 114816.dasm - System.Drawing.Printing.PrintingServices:LoadPrinterPaperSizes(long,System.Drawing.Printing.PrinterSettings,System.String,System.Collections.Specialized.NameValueCollection):System.Drawing.Printing.PaperSize

Top method improvements (bytes):
         -10 (-6.369% of base) : 70059.dasm - System.Diagnostics.Tracing.EventCounter:Flush():this
          -2 (-0.719% of base) : 70060.dasm - System.Diagnostics.Tracing.EventCounter:Enqueue(double):this

Top method regressions (percentages):
           5 (0.649% of base) : 114816.dasm - System.Drawing.Printing.PrintingServices:LoadPrinterPaperSizes(long,System.Drawing.Printing.PrinterSettings,System.String,System.Collections.Specialized.NameValueCollection):System.Drawing.Printing.PaperSize

Top method improvements (percentages):
         -10 (-6.369% of base) : 70059.dasm - System.Diagnostics.Tracing.EventCounter:Flush():this
          -2 (-0.719% of base) : 70060.dasm - System.Diagnostics.Tracing.EventCounter:Enqueue(double):this

3 total methods with Code Size differences (2 improved, 1 regressed), 0 unchanged.


@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Aug 15, 2021
@ghost
Copy link

ghost commented Aug 15, 2021

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

Issue Details

Fixes #57087 regression.

if we decide not to hoist a FP value - we better also skip CSE for it. Example (Linux, where we don't have callee-saved XMMs):

public static void Testik()
{
    for (int i = 0; i < 100; i++)
    {
        Console.WriteLine(3.14f);
        Console.WriteLine(3.14f);
    }
}

Codegen diff: https://www.diffchecker.com/gHTKTLAf

@AndyAyersMS proposed a better fix, but it's more complicated and unlikely to make into .NET 6.0. Also, since SuperPMI.py's diff is quite small and mostly an improvement (including Burgers.Test0) I decided to give it a try.

benchmarks.run.Linux.x64.checked.mch:


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 7249
Total bytes of diff: 7031
Total bytes of delta: -218 (-3.007% of base)
Total relative delta: -0.57
    diff is an improvement.
    relative diff is an improvement.
Detail diffs


Top file regressions (bytes):
           6 : 29412.dasm (0.753% of base)
           4 : 15315.dasm (1.493% of base)
           4 : 12554.dasm (0.811% of base)

Top file improvements (bytes):
         -39 : 15893.dasm (-14.130% of base)
         -33 : 28001.dasm (-9.348% of base)
         -33 : 28334.dasm (-8.847% of base)
         -27 : 18116.dasm (-5.357% of base)
         -24 : 27577.dasm (-6.723% of base)
         -24 : 28196.dasm (-6.366% of base)
         -22 : 12884.dasm (-3.416% of base)
         -17 : 27873.dasm (-4.427% of base)
         -12 : 14186.dasm (-1.329% of base)
          -1 : 27657.dasm (-0.158% of base)

13 total files with Code Size differences (10 improved, 3 regressed), 2 unchanged.

Top method regressions (bytes):
           6 (0.753% of base) : 29412.dasm - Benchstone.BenchF.Lorenz:Test():bool:this
           4 (0.811% of base) : 12554.dasm - Benchmarks.SIMD.RayTracer.RayTracer:RenderSequential(Benchmarks.SIMD.RayTracer.Scene,System.Int32[]):this
           4 (1.493% of base) : 15315.dasm - Benchstone.BenchF.Secant:Test():bool:this

Top method improvements (bytes):
         -39 (-14.130% of base) : 15893.dasm - Benchstone.BenchF.Simpsn:Test():bool:this
         -33 (-8.847% of base) : 28334.dasm - Algorithms.ScalarDoubleRenderer:RenderSingleThreadedWithADT(float,float,float,float,float):this
         -33 (-9.348% of base) : 28001.dasm - Algorithms.ScalarFloatRenderer:RenderSingleThreadedWithADT(float,float,float,float,float):this
         -27 (-5.357% of base) : 18116.dasm - BenchmarksGame.Mandelbrot_2:DoBench(int,System.IO.MemoryStream,bool)
         -24 (-6.366% of base) : 28196.dasm - Algorithms.ScalarDoubleRenderer:RenderSingleThreadedNoADT(float,float,float,float,float):this
         -24 (-6.723% of base) : 27577.dasm - Algorithms.ScalarFloatRenderer:RenderSingleThreadedNoADT(float,float,float,float,float):this
         -22 (-3.416% of base) : 12884.dasm - Benchstone.BenchF.NewtE:Test():bool:this
         -17 (-4.427% of base) : 27873.dasm - Benchstone.BenchF.DMath:Bench(int):bool
         -12 (-1.329% of base) : 14186.dasm - Benchstone.BenchF.Romber:Test():bool:this
          -1 (-0.158% of base) : 27657.dasm - Burgers:GetCalculated0(int,int,double,double,double,System.Double[]):System.Double[]

Top method regressions (percentages):
           4 (1.493% of base) : 15315.dasm - Benchstone.BenchF.Secant:Test():bool:this
           4 (0.811% of base) : 12554.dasm - Benchmarks.SIMD.RayTracer.RayTracer:RenderSequential(Benchmarks.SIMD.RayTracer.Scene,System.Int32[]):this
           6 (0.753% of base) : 29412.dasm - Benchstone.BenchF.Lorenz:Test():bool:this

Top method improvements (percentages):
         -39 (-14.130% of base) : 15893.dasm - Benchstone.BenchF.Simpsn:Test():bool:this
         -33 (-9.348% of base) : 28001.dasm - Algorithms.ScalarFloatRenderer:RenderSingleThreadedWithADT(float,float,float,float,float):this
         -33 (-8.847% of base) : 28334.dasm - Algorithms.ScalarDoubleRenderer:RenderSingleThreadedWithADT(float,float,float,float,float):this
         -24 (-6.723% of base) : 27577.dasm - Algorithms.ScalarFloatRenderer:RenderSingleThreadedNoADT(float,float,float,float,float):this
         -24 (-6.366% of base) : 28196.dasm - Algorithms.ScalarDoubleRenderer:RenderSingleThreadedNoADT(float,float,float,float,float):this
         -27 (-5.357% of base) : 18116.dasm - BenchmarksGame.Mandelbrot_2:DoBench(int,System.IO.MemoryStream,bool)
         -17 (-4.427% of base) : 27873.dasm - Benchstone.BenchF.DMath:Bench(int):bool
         -22 (-3.416% of base) : 12884.dasm - Benchstone.BenchF.NewtE:Test():bool:this
         -12 (-1.329% of base) : 14186.dasm - Benchstone.BenchF.Romber:Test():bool:this
          -1 (-0.158% of base) : 27657.dasm - Burgers:GetCalculated0(int,int,double,double,double,System.Double[]):System.Double[]

13 total methods with Code Size differences (10 improved, 3 regressed), 2 unchanged.


coreclr_tests.pmi.Linux.x64.checked.mch:


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 11583
Total bytes of diff: 11481
Total bytes of delta: -102 (-0.881% of base)
Total relative delta: -0.28
    diff is an improvement.
    relative diff is an improvement.
Detail diffs


Top file regressions (bytes):
          48 : 253058.dasm (6.887% of base)
           7 : 242019.dasm (1.566% of base)
           7 : 242002.dasm (1.471% of base)
           6 : 248138.dasm (0.753% of base)
           4 : 221237.dasm (0.835% of base)
           4 : 221119.dasm (0.811% of base)
           4 : 221239.dasm (0.749% of base)
           3 : 222748.dasm (1.154% of base)
           3 : 222750.dasm (1.167% of base)

Top file improvements (bytes):
         -33 : 222703.dasm (-8.847% of base)
         -33 : 222708.dasm (-9.348% of base)
         -27 : 247239.dasm (-5.357% of base)
         -24 : 222709.dasm (-6.723% of base)
         -24 : 222704.dasm (-6.366% of base)
         -23 : 238096.dasm (-1.505% of base)
         -17 : 248125.dasm (-4.315% of base)
          -4 : 238790.dasm (-0.670% of base)
          -2 : 246410.dasm (-0.348% of base)
          -1 : 242801.dasm (-0.158% of base)

19 total files with Code Size differences (10 improved, 9 regressed), 4 unchanged.

Top method regressions (bytes):
          48 (6.887% of base) : 253058.dasm - pow0:Main():int
           7 (1.566% of base) : 242019.dasm - MathFusedMultiplyAddTest.Program:TestDoubles()
           7 (1.471% of base) : 242002.dasm - MathFusedMultiplyAddTest.Program:TestFloats()
           6 (0.753% of base) : 248138.dasm - Benchstone.BenchF.Lorenz:Bench():bool
           4 (0.835% of base) : 221237.dasm - <>c__DisplayClass5_0:<RenderParallel>b__0(int):this
           4 (0.749% of base) : 221239.dasm - <>c__DisplayClass6_0:<RenderParallelShowingThreads>b__1(int,System.Threading.Tasks.ParallelLoopState,float):float:this
           4 (0.811% of base) : 221119.dasm - RayTracer:RenderSequential(Scene,System.Int32[]):this
           3 (1.154% of base) : 222748.dasm - <>c__DisplayClass4_0:<RenderMultiThreadedWithADT>b__0(int):this
           3 (1.167% of base) : 222750.dasm - <>c__DisplayClass4_0:<RenderMultiThreadedWithADT>b__0(int):this

Top method improvements (bytes):
         -33 (-8.847% of base) : 222703.dasm - Algorithms.ScalarDoubleRenderer:RenderSingleThreadedWithADT(float,float,float,float,float):this
         -33 (-9.348% of base) : 222708.dasm - Algorithms.ScalarFloatRenderer:RenderSingleThreadedWithADT(float,float,float,float,float):this
         -27 (-5.357% of base) : 247239.dasm - BenchmarksGame.Mandelbrot_2:DoBench(int,System.IO.MemoryStream,bool)
         -24 (-6.366% of base) : 222704.dasm - Algorithms.ScalarDoubleRenderer:RenderSingleThreadedNoADT(float,float,float,float,float):this
         -24 (-6.723% of base) : 222709.dasm - Algorithms.ScalarFloatRenderer:RenderSingleThreadedNoADT(float,float,float,float,float):this
         -23 (-1.505% of base) : 238096.dasm - BilinearTest:RunTests():this
         -17 (-4.315% of base) : 248125.dasm - Benchstone.BenchF.DMath:Bench(int):bool
          -4 (-0.670% of base) : 238790.dasm - Program:Main(System.String[]):int
          -2 (-0.348% of base) : 246410.dasm - DefaultNamespace.GCQueue:MakeLeak(int,int):this
          -1 (-0.158% of base) : 242801.dasm - Burgers:GetCalculated0(int,int,double,double,double,System.Double[]):System.Double[]

Top method regressions (percentages):
          48 (6.887% of base) : 253058.dasm - pow0:Main():int
           7 (1.566% of base) : 242019.dasm - MathFusedMultiplyAddTest.Program:TestDoubles()
           7 (1.471% of base) : 242002.dasm - MathFusedMultiplyAddTest.Program:TestFloats()
           3 (1.167% of base) : 222750.dasm - <>c__DisplayClass4_0:<RenderMultiThreadedWithADT>b__0(int):this
           3 (1.154% of base) : 222748.dasm - <>c__DisplayClass4_0:<RenderMultiThreadedWithADT>b__0(int):this
           4 (0.835% of base) : 221237.dasm - <>c__DisplayClass5_0:<RenderParallel>b__0(int):this
           4 (0.811% of base) : 221119.dasm - RayTracer:RenderSequential(Scene,System.Int32[]):this
           6 (0.753% of base) : 248138.dasm - Benchstone.BenchF.Lorenz:Bench():bool
           4 (0.749% of base) : 221239.dasm - <>c__DisplayClass6_0:<RenderParallelShowingThreads>b__1(int,System.Threading.Tasks.ParallelLoopState,float):float:this

Top method improvements (percentages):
         -33 (-9.348% of base) : 222708.dasm - Algorithms.ScalarFloatRenderer:RenderSingleThreadedWithADT(float,float,float,float,float):this
         -33 (-8.847% of base) : 222703.dasm - Algorithms.ScalarDoubleRenderer:RenderSingleThreadedWithADT(float,float,float,float,float):this
         -24 (-6.723% of base) : 222709.dasm - Algorithms.ScalarFloatRenderer:RenderSingleThreadedNoADT(float,float,float,float,float):this
         -24 (-6.366% of base) : 222704.dasm - Algorithms.ScalarDoubleRenderer:RenderSingleThreadedNoADT(float,float,float,float,float):this
         -27 (-5.357% of base) : 247239.dasm - BenchmarksGame.Mandelbrot_2:DoBench(int,System.IO.MemoryStream,bool)
         -17 (-4.315% of base) : 248125.dasm - Benchstone.BenchF.DMath:Bench(int):bool
         -23 (-1.505% of base) : 238096.dasm - BilinearTest:RunTests():this
          -4 (-0.670% of base) : 238790.dasm - Program:Main(System.String[]):int
          -2 (-0.348% of base) : 246410.dasm - DefaultNamespace.GCQueue:MakeLeak(int,int):this
          -1 (-0.158% of base) : 242801.dasm - Burgers:GetCalculated0(int,int,double,double,double,System.Double[]):System.Double[]

19 total methods with Code Size differences (10 improved, 9 regressed), 4 unchanged.


libraries.crossgen2.Linux.x64.checked.mch:


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 1206
Total bytes of diff: 1199
Total bytes of delta: -7 (-0.580% of base)
Total relative delta: -0.06
    diff is an improvement.
    relative diff is an improvement.
Detail diffs


Top file regressions (bytes):
           5 : 114816.dasm (0.649% of base)

Top file improvements (bytes):
         -10 : 70059.dasm (-6.369% of base)
          -2 : 70060.dasm (-0.719% of base)

3 total files with Code Size differences (2 improved, 1 regressed), 0 unchanged.

Top method regressions (bytes):
           5 (0.649% of base) : 114816.dasm - System.Drawing.Printing.PrintingServices:LoadPrinterPaperSizes(long,System.Drawing.Printing.PrinterSettings,System.String,System.Collections.Specialized.NameValueCollection):System.Drawing.Printing.PaperSize

Top method improvements (bytes):
         -10 (-6.369% of base) : 70059.dasm - System.Diagnostics.Tracing.EventCounter:Flush():this
          -2 (-0.719% of base) : 70060.dasm - System.Diagnostics.Tracing.EventCounter:Enqueue(double):this

Top method regressions (percentages):
           5 (0.649% of base) : 114816.dasm - System.Drawing.Printing.PrintingServices:LoadPrinterPaperSizes(long,System.Drawing.Printing.PrinterSettings,System.String,System.Collections.Specialized.NameValueCollection):System.Drawing.Printing.PaperSize

Top method improvements (percentages):
         -10 (-6.369% of base) : 70059.dasm - System.Diagnostics.Tracing.EventCounter:Flush():this
          -2 (-0.719% of base) : 70060.dasm - System.Diagnostics.Tracing.EventCounter:Enqueue(double):this

3 total methods with Code Size differences (2 improved, 1 regressed), 0 unchanged.


Author: EgorBo
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@EgorBo
Copy link
Member Author

EgorBo commented Aug 15, 2021

Burgers.Test0 (#57087) diff: https://www.diffchecker.com/HAYcIrcR
Benchstone.BenchF.Simpsn:Test() diff https://www.diffchecker.com/HvnC7EJr

Size regression example: https://www.diffchecker.com/NiaNkVA9 (loop alignment)

@jakobbotsch
Copy link
Member

It looks like CSE already tries to account for this:

if (candidate->LiveAcrossCall())
{
// If we don't have a lot of variables to enregister or we have a floating point type
// then we will likely need to spill an additional caller save register.
//
if ((enregCount < (CNT_CALLEE_ENREG * 3 / 2)) || varTypeIsFloating(candidate->Expr()->TypeGet()))
{
// Extra cost in case we have to spill/restore a caller saved register
extra_yes_cost = BB_UNITY_WEIGHT_UNSIGNED;
if (cseRefCnt < moderateRefCnt) // If Conservative CSE promotion
{
extra_yes_cost *= 2; // full cost if we are being Conservative
}
}

Any idea why it's not enough?

@EgorBo
Copy link
Member Author

EgorBo commented Aug 15, 2021

It looks like CSE already tries to account for this:

if (candidate->LiveAcrossCall())
{
// If we don't have a lot of variables to enregister or we have a floating point type
// then we will likely need to spill an additional caller save register.
//
if ((enregCount < (CNT_CALLEE_ENREG * 3 / 2)) || varTypeIsFloating(candidate->Expr()->TypeGet()))
{
// Extra cost in case we have to spill/restore a caller saved register
extra_yes_cost = BB_UNITY_WEIGHT_UNSIGNED;
if (cseRefCnt < moderateRefCnt) // If Conservative CSE promotion
{
extra_yes_cost *= 2; // full cost if we are being Conservative
}
}

Any idea why it's not enough?

Wow, thanks! Didn't know about LiveAcrossCall
Looks like it doesn't satisfy this condition for my sample:

if (cseRefCnt < moderateRefCnt) // If Conservative CSE promotion
(1200 < 100)

@EgorBo
Copy link
Member Author

EgorBo commented Aug 15, 2021

New diffs:

benchmarks.run.Linux.x64.checked.mch:


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 8578
Total bytes of diff: 8267
Total bytes of delta: -311 (-3.626% of base)
Total relative delta: -0.80
    diff is an improvement.
    relative diff is an improvement.
Detail diffs


Top file improvements (bytes):
         -52 : 12549.dasm (-7.407% of base)
         -49 : 13035.dasm (-9.423% of base)
         -39 : 15893.dasm (-14.130% of base)
         -27 : 18116.dasm (-5.357% of base)
         -18 : 5938.dasm (-10.345% of base)
         -18 : 8925.dasm (-10.345% of base)
         -17 : 27873.dasm (-4.427% of base)
         -16 : 12884.dasm (-2.484% of base)
         -15 : 27657.dasm (-2.366% of base)
         -12 : 14186.dasm (-1.329% of base)
         -10 : 27652.dasm (-3.650% of base)
         -10 : 23593.dasm (-1.642% of base)
          -9 : 23118.dasm (-0.834% of base)
          -8 : 9256.dasm (-3.347% of base)
          -7 : 25066.dasm (-2.431% of base)
          -2 : 11099.dasm (-0.465% of base)
          -2 : 1722.dasm (-0.269% of base)

17 total files with Code Size differences (17 improved, 0 regressed), 0 unchanged.

Top method improvements (bytes):
         -52 (-7.407% of base) : 12549.dasm - Benchmarks.SIMD.RayTracer.Camera:Create(Benchmarks.SIMD.RayTracer.Vector,Benchmarks.SIMD.RayTracer.Vector):Benchmarks.SIMD.RayTracer.Camera
         -49 (-9.423% of base) : 13035.dasm - System.Numerics.Matrix4x4:CreateShadow(System.Numerics.Vector3,System.Numerics.Plane):System.Numerics.Matrix4x4
         -39 (-14.130% of base) : 15893.dasm - Benchstone.BenchF.Simpsn:Test():bool:this
         -27 (-5.357% of base) : 18116.dasm - BenchmarksGame.Mandelbrot_2:DoBench(int,System.IO.MemoryStream,bool)
         -18 (-10.345% of base) : 8925.dasm - MessagePack.Formatters.DynamicObjectTypeFallbackFormatter:.ctor(MessagePack.IFormatterResolver[]):this
         -18 (-10.345% of base) : 5938.dasm - Utf8Json.Formatters.DynamicObjectTypeFallbackFormatter:.ctor(Utf8Json.IJsonFormatterResolver[]):this
         -17 (-4.427% of base) : 27873.dasm - Benchstone.BenchF.DMath:Bench(int):bool
         -16 (-2.484% of base) : 12884.dasm - Benchstone.BenchF.NewtE:Test():bool:this
         -15 (-2.366% of base) : 27657.dasm - Burgers:GetCalculated0(int,int,double,double,double,System.Double[]):System.Double[]
         -12 (-1.329% of base) : 14186.dasm - Benchstone.BenchF.Romber:Test():bool:this
         -10 (-3.650% of base) : 27652.dasm - Burgers:Setup():this
         -10 (-1.642% of base) : 23593.dasm - System.Numerics.Matrix4x4:CreateLookAt(System.Numerics.Vector3,System.Numerics.Vector3,System.Numerics.Vector3):System.Numerics.Matrix4x4
          -9 (-0.834% of base) : 23118.dasm - BenchmarksGame.NBodySystem:.ctor():this
          -8 (-3.347% of base) : 9256.dasm - ObjectFallbackEqualityComparer:.ctor(MessagePack.MessagePackSecurity):this
          -7 (-2.431% of base) : 25066.dasm - FractalPerf.Launch:Test():double:this
          -2 (-0.269% of base) : 1722.dasm - HillClimbing:.ctor():this
          -2 (-0.465% of base) : 11099.dasm - System.MathBenchmarks.Double:MaxTest()

Top method improvements (percentages):
         -39 (-14.130% of base) : 15893.dasm - Benchstone.BenchF.Simpsn:Test():bool:this
         -18 (-10.345% of base) : 8925.dasm - MessagePack.Formatters.DynamicObjectTypeFallbackFormatter:.ctor(MessagePack.IFormatterResolver[]):this
         -18 (-10.345% of base) : 5938.dasm - Utf8Json.Formatters.DynamicObjectTypeFallbackFormatter:.ctor(Utf8Json.IJsonFormatterResolver[]):this
         -49 (-9.423% of base) : 13035.dasm - System.Numerics.Matrix4x4:CreateShadow(System.Numerics.Vector3,System.Numerics.Plane):System.Numerics.Matrix4x4
         -52 (-7.407% of base) : 12549.dasm - Benchmarks.SIMD.RayTracer.Camera:Create(Benchmarks.SIMD.RayTracer.Vector,Benchmarks.SIMD.RayTracer.Vector):Benchmarks.SIMD.RayTracer.Camera
         -27 (-5.357% of base) : 18116.dasm - BenchmarksGame.Mandelbrot_2:DoBench(int,System.IO.MemoryStream,bool)
         -17 (-4.427% of base) : 27873.dasm - Benchstone.BenchF.DMath:Bench(int):bool
         -10 (-3.650% of base) : 27652.dasm - Burgers:Setup():this
          -8 (-3.347% of base) : 9256.dasm - ObjectFallbackEqualityComparer:.ctor(MessagePack.MessagePackSecurity):this
         -16 (-2.484% of base) : 12884.dasm - Benchstone.BenchF.NewtE:Test():bool:this
          -7 (-2.431% of base) : 25066.dasm - FractalPerf.Launch:Test():double:this
         -15 (-2.366% of base) : 27657.dasm - Burgers:GetCalculated0(int,int,double,double,double,System.Double[]):System.Double[]
         -10 (-1.642% of base) : 23593.dasm - System.Numerics.Matrix4x4:CreateLookAt(System.Numerics.Vector3,System.Numerics.Vector3,System.Numerics.Vector3):System.Numerics.Matrix4x4
         -12 (-1.329% of base) : 14186.dasm - Benchstone.BenchF.Romber:Test():bool:this
          -9 (-0.834% of base) : 23118.dasm - BenchmarksGame.NBodySystem:.ctor():this
          -2 (-0.465% of base) : 11099.dasm - System.MathBenchmarks.Double:MaxTest()
          -2 (-0.269% of base) : 1722.dasm - HillClimbing:.ctor():this

17 total methods with Code Size differences (17 improved, 0 regressed), 0 unchanged.


coreclr_tests.pmi.Linux.x64.checked.mch:


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 1495979
Total bytes of diff: 1499371
Total bytes of delta: 3392 (0.227% of base)
Total relative delta: -3.29
    diff is a regression.
    relative diff is an improvement.
Detail diffs


Top file regressions (bytes):
         591 : 253032.dasm (25.562% of base)
         591 : 247497.dasm (25.562% of base)
         551 : 237579.dasm (37.688% of base)
         551 : 237556.dasm (37.688% of base)
         551 : 239973.dasm (37.662% of base)
         367 : 250840.dasm (9.164% of base)
         348 : 250724.dasm (6.055% of base)
         348 : 250478.dasm (6.055% of base)
         302 : 231223.dasm (3.902% of base)
         289 : 224196.dasm (3.938% of base)
         280 : 246393.dasm (6.222% of base)
         278 : 248621.dasm (4.821% of base)
         278 : 250888.dasm (4.828% of base)
         266 : 226458.dasm (3.675% of base)
         266 : 227517.dasm (3.681% of base)
         204 : 185292.dasm (47.887% of base)
         203 : 185277.dasm (41.260% of base)
         201 : 185247.dasm (27.839% of base)
         200 : 185272.dasm (46.296% of base)
         194 : 185280.dasm (30.455% of base)

Top file improvements (bytes):
        -268 : 215034.dasm (-0.951% of base)
        -262 : 226032.dasm (-9.868% of base)
        -232 : 217234.dasm (-0.830% of base)
        -212 : 221256.dasm (-0.746% of base)
        -204 : 221012.dasm (-0.725% of base)
        -168 : 253358.dasm (-39.252% of base)
        -156 : 82787.dasm (-38.806% of base)
        -153 : 215935.dasm (-0.543% of base)
        -141 : 222902.dasm (-0.506% of base)
        -137 : 218794.dasm (-0.487% of base)
        -137 : 220459.dasm (-0.487% of base)
        -112 : 230486.dasm (-20.401% of base)
         -98 : 222323.dasm (-1.613% of base)
         -91 : 221261.dasm (-0.324% of base)
         -91 : 220953.dasm (-0.324% of base)
         -70 : 223099.dasm (-0.253% of base)
         -70 : 222540.dasm (-0.253% of base)
         -64 : 215594.dasm (-10.978% of base)
         -63 : 218591.dasm (-0.229% of base)
         -63 : 216310.dasm (-0.229% of base)

657 total files with Code Size differences (468 improved, 189 regressed), 12 unchanged.

Top method regressions (bytes):
         591 (25.562% of base) : 253032.dasm - _add:main(System.String[]):int
         591 (25.562% of base) : 247497.dasm - _add:main(System.String[]):int
         551 (37.688% of base) : 237579.dasm - JitTest.Test:Main():int
         551 (37.688% of base) : 237556.dasm - JitTest.Test:Main():int
         551 (37.662% of base) : 239973.dasm - JitTest.Test:Main():int
         367 (9.164% of base) : 250840.dasm - _div:main(System.String[]):int
         348 (6.055% of base) : 250724.dasm - _sub:main(System.String[]):int
         348 (6.055% of base) : 250478.dasm - _sub:main(System.String[]):int
         302 (3.902% of base) : 231223.dasm - TestApp:Main():int
         289 (3.938% of base) : 224196.dasm - TestApp:Main():int
         280 (6.222% of base) : 246393.dasm - _div:main(System.String[]):int
         278 (4.821% of base) : 248621.dasm - _mul:main(System.String[]):int
         278 (4.828% of base) : 250888.dasm - _mul:main(System.String[]):int
         266 (3.675% of base) : 226458.dasm - TestApp:Main():int
         266 (3.681% of base) : 227517.dasm - TestApp:Main():int
         204 (47.887% of base) : 185292.dasm - testout1:Func_0_4_3():double
         203 (41.260% of base) : 185277.dasm - testout1:Func_0_7_1():float
         201 (27.839% of base) : 185247.dasm - testout1:Func_0_1_8():double
         200 (46.296% of base) : 185272.dasm - testout1:Func_0_7_6():double
         194 (30.455% of base) : 185280.dasm - testout1:Func_0_6_3():long

Top method improvements (bytes):
        -268 (-0.951% of base) : 215034.dasm - r4NaNrem:Main():int
        -262 (-9.868% of base) : 226032.dasm - PInvokeTest:test():bool
        -232 (-0.830% of base) : 217234.dasm - r4NaNrem:Main():int
        -212 (-0.746% of base) : 221256.dasm - r4NaNmul:Main():int
        -204 (-0.725% of base) : 221012.dasm - r4NaNmul:Main():int
        -168 (-39.252% of base) : 253358.dasm - Program:Main():int
        -156 (-38.806% of base) : 82787.dasm - GitHub_36905:Main():int
        -153 (-0.543% of base) : 215935.dasm - r4NaNadd:Main():int
        -141 (-0.506% of base) : 222902.dasm - r4NaNadd:Main():int
        -137 (-0.487% of base) : 218794.dasm - r4NaNdiv:Main():int
        -137 (-0.487% of base) : 220459.dasm - r4NaNdiv:Main():int
        -112 (-20.401% of base) : 230486.dasm - IntelHardwareIntrinsicTest:Main():int
         -98 (-1.613% of base) : 222323.dasm - TestShufflingThunk.Test16833:Main(System.String[]):int
         -91 (-0.324% of base) : 221261.dasm - r8NaNrem:Main():int
         -91 (-0.324% of base) : 220953.dasm - r8NaNrem:Main():int
         -70 (-0.253% of base) : 223099.dasm - r8NaNsub:Main():int
         -70 (-0.253% of base) : 222540.dasm - r8NaNsub:Main():int
         -64 (-10.978% of base) : 215594.dasm - StructABI:NotEnoughRegistersSysV4Wrapper():bool
         -63 (-0.229% of base) : 218591.dasm - r8NaNmul:Main():int
         -63 (-0.229% of base) : 216310.dasm - r8NaNmul:Main():int

Top method regressions (percentages):
         106 (84.800% of base) : 249595.dasm - Test:Main():int
         204 (47.887% of base) : 185292.dasm - testout1:Func_0_4_3():double
         200 (46.296% of base) : 185272.dasm - testout1:Func_0_7_6():double
         185 (46.020% of base) : 185266.dasm - testout1:Func_0_8_4():double
         185 (42.824% of base) : 185274.dasm - testout1:Func_0_7_4():double
         203 (41.260% of base) : 185277.dasm - testout1:Func_0_7_1():float
         168 (40.777% of base) : 185281.dasm - testout1:Func_0_6_2():double
         161 (39.558% of base) : 185270.dasm - testout1:Func_0_7_8():double
         551 (37.688% of base) : 237579.dasm - JitTest.Test:Main():int
         551 (37.688% of base) : 237556.dasm - JitTest.Test:Main():int
         551 (37.662% of base) : 239973.dasm - JitTest.Test:Main():int
         194 (30.455% of base) : 185280.dasm - testout1:Func_0_6_3():long
         169 (29.545% of base) : 185250.dasm - testout1:Func_0_1_5():double
         201 (27.839% of base) : 185247.dasm - testout1:Func_0_1_8():double
         164 (27.797% of base) : 185241.dasm - testout1:Func_0_2_5():short
         591 (25.562% of base) : 253032.dasm - _add:main(System.String[]):int
         591 (25.562% of base) : 247497.dasm - _add:main(System.String[]):int
         167 (21.438% of base) : 185284.dasm - testout1:Func_0_5_6():double
          15 (20.000% of base) : 241999.dasm - MathFusedMultiplyAddTest.Program:TestExplicitFmaUsage5(byref,double)
          15 (18.072% of base) : 242017.dasm - MathFusedMultiplyAddTest.Program:TestExplicitFmaUsage5(byref,float)

Top method improvements (percentages):
        -168 (-39.252% of base) : 253358.dasm - Program:Main():int
        -156 (-38.806% of base) : 82787.dasm - GitHub_36905:Main():int
         -24 (-27.273% of base) : 252545.dasm - coreclr_test_13647.doublenegate:Test2():bool
         -48 (-22.642% of base) : 241736.dasm - VectorTest:Vector3ReturnTest():int
        -112 (-20.401% of base) : 230486.dasm - IntelHardwareIntrinsicTest:Main():int
         -20 (-18.018% of base) : 147761.dasm - testout1:Func_0_3_3_6_3():float
         -15 (-15.957% of base) : 98127.dasm - testout1:Func_0_4_3_2_6():float
         -39 (-15.663% of base) : 246765.dasm - Benchstone.BenchF.Simpsn:Bench():bool
         -24 (-14.286% of base) : 239200.dasm - FloatOvfToInt:TestValuesDoubleInt():int
         -24 (-14.286% of base) : 239196.dasm - FloatOvfToInt:TestValuesFloatInt():int
         -17 (-13.077% of base) : 98167.dasm - testout1:Func_0_4_3_6_6():float
         -10 (-11.236% of base) : 97947.dasm - testout1:Func_0_3_1_6_4():double
         -64 (-10.978% of base) : 215594.dasm - StructABI:NotEnoughRegistersSysV4Wrapper():bool
         -19 (-10.215% of base) : 147689.dasm - testout1:Func_0_2_6_6_6():double
        -262 (-9.868% of base) : 226032.dasm - PInvokeTest:test():bool
         -23 (-9.465% of base) : 85196.dasm - ILGEN_0xf9a34ac1:Method_0x2d60f019(byte,int):long
         -22 (-9.322% of base) : 98372.dasm - testout1:Func_0_5_5_2_1():float
         -22 (-9.322% of base) : 148008.dasm - testout1:Func_0_5_5_2_1():float
         -51 (-9.206% of base) : 215595.dasm - StructABI:NotEnoughRegistersSysV5Wrapper():bool
         -59 (-8.912% of base) : 185293.dasm - testout1:Func_0_4_2():double

657 total methods with Code Size differences (468 improved, 189 regressed), 12 unchanged.


libraries.pmi.Linux.x64.checked.mch:


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 2070
Total bytes of diff: 1980
Total bytes of delta: -90 (-4.348% of base)
Total relative delta: -0.19
    diff is an improvement.
    relative diff is an improvement.
Detail diffs


Top file improvements (bytes):
         -47 : 12234.dasm (-3.481% of base)
         -33 : 43731.dasm (-10.312% of base)
          -6 : 133981.dasm (-2.510% of base)
          -4 : 2644.dasm (-2.484% of base)

4 total files with Code Size differences (4 improved, 0 regressed), 0 unchanged.

Top method improvements (bytes):
         -47 (-3.481% of base) : 12234.dasm - Microsoft.VisualBasic.Financial:IRR(byref,double):double
         -33 (-10.312% of base) : 43731.dasm - System.Drawing.Drawing2D.Matrix:RotateAt(float,System.Drawing.PointF,int):this
          -6 (-2.510% of base) : 133981.dasm - Microsoft.Diagnostics.Tracing.Analysis.TraceProcessesExtensions:Process(Microsoft.Diagnostics.Tracing.TraceEvent):Microsoft.Diagnostics.Tracing.Analysis.TraceProcess
          -4 (-2.484% of base) : 2644.dasm - Microsoft.CodeAnalysis.ConstantValue:Create(float):Microsoft.CodeAnalysis.ConstantValue

Top method improvements (percentages):
         -33 (-10.312% of base) : 43731.dasm - System.Drawing.Drawing2D.Matrix:RotateAt(float,System.Drawing.PointF,int):this
         -47 (-3.481% of base) : 12234.dasm - Microsoft.VisualBasic.Financial:IRR(byref,double):double
          -6 (-2.510% of base) : 133981.dasm - Microsoft.Diagnostics.Tracing.Analysis.TraceProcessesExtensions:Process(Microsoft.Diagnostics.Tracing.TraceEvent):Microsoft.Diagnostics.Tracing.Analysis.TraceProcess
          -4 (-2.484% of base) : 2644.dasm - Microsoft.CodeAnalysis.ConstantValue:Create(float):Microsoft.CodeAnalysis.ConstantValue

4 total methods with Code Size differences (4 improved, 0 regressed), 0 unchanged.


libraries.crossgen2.Linux.x64.checked.mch:


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 6192
Total bytes of diff: 5943
Total bytes of delta: -249 (-4.021% of base)
Total relative delta: -0.95
    diff is an improvement.
    relative diff is an improvement.
Detail diffs


Top file improvements (bytes):
         -47 : 48740.dasm (-3.818% of base)
         -45 : 80737.dasm (-8.427% of base)
         -32 : 80756.dasm (-5.063% of base)
         -29 : 181966.dasm (-11.462% of base)
         -29 : 181968.dasm (-9.764% of base)
         -10 : 80367.dasm (-5.650% of base)
         -10 : 70059.dasm (-6.369% of base)
          -9 : 84815.dasm (-6.569% of base)
          -8 : 144600.dasm (-6.780% of base)
          -8 : 59632.dasm (-6.723% of base)
          -6 : 80375.dasm (-17.647% of base)
          -5 : 59643.dasm (-4.202% of base)
          -5 : 184706.dasm (-0.466% of base)
          -2 : 70060.dasm (-0.719% of base)
          -2 : 77602.dasm (-0.294% of base)
          -2 : 56034.dasm (-0.847% of base)

16 total files with Code Size differences (16 improved, 0 regressed), 1 unchanged.

Top method improvements (bytes):
         -47 (-3.818% of base) : 48740.dasm - Microsoft.VisualBasic.Financial:IRR(byref,double):double
         -45 (-8.427% of base) : 80737.dasm - System.Numerics.Matrix4x4:CreateShadow(System.Numerics.Vector3,System.Numerics.Plane):System.Numerics.Matrix4x4
         -32 (-5.063% of base) : 80756.dasm - System.Numerics.Matrix4x4:CreateLookAt(System.Numerics.Vector3,System.Numerics.Vector3,System.Numerics.Vector3):System.Numerics.Matrix4x4
         -29 (-9.764% of base) : 181968.dasm - System.Drawing.RectangleF:Intersect(System.Drawing.RectangleF,System.Drawing.RectangleF):System.Drawing.RectangleF
         -29 (-11.462% of base) : 181966.dasm - System.Drawing.RectangleF:Union(System.Drawing.RectangleF,System.Drawing.RectangleF):System.Drawing.RectangleF
         -10 (-6.369% of base) : 70059.dasm - System.Diagnostics.Tracing.EventCounter:Flush():this
         -10 (-5.650% of base) : 80367.dasm - System.Globalization.CalendricalCalculationsHelper:EstimatePrior(double,double):double
          -9 (-6.569% of base) : 84815.dasm - System.DateTimeParse:ParseFraction(byref,byref):bool
          -8 (-6.780% of base) : 144600.dasm - Microsoft.CodeAnalysis.ConstantValue:Create(float):Microsoft.CodeAnalysis.ConstantValue
          -8 (-6.723% of base) : 59632.dasm - RangeSingle@5431-2:.ctor(float,float,float,bool,bool):this
          -6 (-17.647% of base) : 80375.dasm - System.Globalization.CalendricalCalculationsHelper:InitLongitude(double):double
          -5 (-0.466% of base) : 184706.dasm - Microsoft.Xunit.Performance.Api.CSVMetricReader:.ctor(System.String):this
          -5 (-4.202% of base) : 59643.dasm - RangeDouble@5430-2:.ctor(double,double,double,bool,bool):this
          -2 (-0.294% of base) : 77602.dasm - HillClimbing:.ctor():this
          -2 (-0.847% of base) : 56034.dasm - Internal.Cryptography.Pal.CachedSystemStoreProvider:.cctor()
          -2 (-0.719% of base) : 70060.dasm - System.Diagnostics.Tracing.EventCounter:Enqueue(double):this

Top method improvements (percentages):
          -6 (-17.647% of base) : 80375.dasm - System.Globalization.CalendricalCalculationsHelper:InitLongitude(double):double
         -29 (-11.462% of base) : 181966.dasm - System.Drawing.RectangleF:Union(System.Drawing.RectangleF,System.Drawing.RectangleF):System.Drawing.RectangleF
         -29 (-9.764% of base) : 181968.dasm - System.Drawing.RectangleF:Intersect(System.Drawing.RectangleF,System.Drawing.RectangleF):System.Drawing.RectangleF
         -45 (-8.427% of base) : 80737.dasm - System.Numerics.Matrix4x4:CreateShadow(System.Numerics.Vector3,System.Numerics.Plane):System.Numerics.Matrix4x4
          -8 (-6.780% of base) : 144600.dasm - Microsoft.CodeAnalysis.ConstantValue:Create(float):Microsoft.CodeAnalysis.ConstantValue
          -8 (-6.723% of base) : 59632.dasm - RangeSingle@5431-2:.ctor(float,float,float,bool,bool):this
          -9 (-6.569% of base) : 84815.dasm - System.DateTimeParse:ParseFraction(byref,byref):bool
         -10 (-6.369% of base) : 70059.dasm - System.Diagnostics.Tracing.EventCounter:Flush():this
         -10 (-5.650% of base) : 80367.dasm - System.Globalization.CalendricalCalculationsHelper:EstimatePrior(double,double):double
         -32 (-5.063% of base) : 80756.dasm - System.Numerics.Matrix4x4:CreateLookAt(System.Numerics.Vector3,System.Numerics.Vector3,System.Numerics.Vector3):System.Numerics.Matrix4x4
          -5 (-4.202% of base) : 59643.dasm - RangeDouble@5430-2:.ctor(double,double,double,bool,bool):this
         -47 (-3.818% of base) : 48740.dasm - Microsoft.VisualBasic.Financial:IRR(byref,double):double
          -2 (-0.847% of base) : 56034.dasm - Internal.Cryptography.Pal.CachedSystemStoreProvider:.cctor()
          -2 (-0.719% of base) : 70060.dasm - System.Diagnostics.Tracing.EventCounter:Enqueue(double):this
          -5 (-0.466% of base) : 184706.dasm - Microsoft.Xunit.Performance.Api.CSVMetricReader:.ctor(System.String):this
          -2 (-0.294% of base) : 77602.dasm - HillClimbing:.ctor():this

16 total methods with Code Size differences (16 improved, 0 regressed), 1 unchanged.


libraries_tests.pmi.Linux.x64.checked.mch:


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 1347035
Total bytes of diff: 1342258
Total bytes of delta: -4777 (-0.355% of base)
Total relative delta: -4.11
    diff is an improvement.
    relative diff is an improvement.
Detail diffs


Top file regressions (bytes):
         709 : 227460.dasm (11.265% of base)
          53 : 256827.dasm (1.216% of base)
          49 : 256550.dasm (8.208% of base)
          43 : 256128.dasm (2.778% of base)
          39 : 256741.dasm (1.943% of base)
          33 : 256501.dasm (34.375% of base)
          29 : 256549.dasm (17.901% of base)
          28 : 227476.dasm (0.972% of base)
          28 : 106707.dasm (0.443% of base)
          24 : 256698.dasm (2.218% of base)
          23 : 227445.dasm (1.815% of base)
          22 : 106709.dasm (0.510% of base)
          20 : 165182.dasm (1.299% of base)
          20 : 227610.dasm (10.417% of base)
          16 : 287936.dasm (0.721% of base)
          16 : 227517.dasm (2.488% of base)
          16 : 269520.dasm (0.715% of base)
          16 : 227416.dasm (1.388% of base)
          12 : 276326.dasm (2.400% of base)
           9 : 92663.dasm (0.669% of base)

Top file improvements (bytes):
       -1522 : 227608.dasm (-37.776% of base)
        -252 : 227428.dasm (-14.711% of base)
        -240 : 227584.dasm (-18.504% of base)
        -204 : 227559.dasm (-14.256% of base)
        -184 : 227607.dasm (-38.017% of base)
        -175 : 227285.dasm (-12.324% of base)
        -138 : 261079.dasm (-3.480% of base)
        -104 : 261059.dasm (-3.118% of base)
         -98 : 74313.dasm (-1.925% of base)
         -98 : 74193.dasm (-1.884% of base)
         -98 : 74163.dasm (-1.884% of base)
         -98 : 74373.dasm (-1.811% of base)
         -98 : 74223.dasm (-1.774% of base)
         -98 : 74418.dasm (-1.925% of base)
         -98 : 74178.dasm (-1.884% of base)
         -98 : 74343.dasm (-1.925% of base)
         -98 : 74268.dasm (-1.884% of base)
         -98 : 74328.dasm (-1.925% of base)
         -84 : 261083.dasm (-1.945% of base)
         -84 : 227479.dasm (-12.299% of base)

231 total files with Code Size differences (183 improved, 48 regressed), 2 unchanged.

Top method regressions (bytes):
         709 (11.265% of base) : 227460.dasm - System.Numerics.Tests.Matrix3x2Tests:Matrix3x2EqualsNanTest():this
          53 (1.216% of base) : 256827.dasm - <Sqrt_AdvancedTestData>d__94:MoveNext():bool:this
          49 (8.208% of base) : 256550.dasm - System.Numerics.Tests.ComplexTests:VerifyLogWithBase(System.Numerics.Complex)
          43 (2.778% of base) : 256128.dasm - System.Numerics.Tests.BigIntegerConstructorTest:RunCtorDoubleTests()
          39 (1.943% of base) : 256741.dasm - <Add_TestData>d__29:MoveNext():bool:this
          33 (34.375% of base) : 256501.dasm - System.Numerics.Tests.ComplexTests:Negate(double,double)
          29 (17.901% of base) : 256549.dasm - System.Numerics.Tests.ComplexTests:VerifyLog10(System.Numerics.Complex)
          28 (0.972% of base) : 227476.dasm - System.Numerics.Tests.Matrix3x2Tests:Matrix3x2CreateRotationRightAngleTest():this
          28 (0.443% of base) : 106707.dasm - System.Tests.TimeZoneInfoTests:ConvertTime_DateTime_LocalToSystem()
          24 (2.218% of base) : 256698.dasm - <Random_2_TestData>d__13:MoveNext():bool:this
          23 (1.815% of base) : 227445.dasm - System.Numerics.Tests.Matrix3x2Tests:Matrix3x2CreateScaleCenterTest1():this
          22 (0.510% of base) : 106709.dasm - System.Tests.TimeZoneInfoTests:ConvertTime_DateTime_LocalToUtc()
          20 (1.299% of base) : 165182.dasm - Microsoft.VisualBasic.Tests.DoubleTypeTests:FromObject():this
          20 (10.417% of base) : 227610.dasm - System.Numerics.Tests.Matrix4x4Tests:Matrix4x4DecomposeTest03():this
          16 (0.721% of base) : 287936.dasm - DataContractJsonSerializerTests:DCJS_DateTimeAsRoot()
          16 (0.715% of base) : 269520.dasm - DataContractJsonSerializerTests:DCJS_DateTimeAsRoot()
          16 (2.488% of base) : 227517.dasm - System.Numerics.Tests.Matrix4x4Tests:Matrix4x4CreateScaleTest2():this
          16 (1.388% of base) : 227416.dasm - System.Numerics.Tests.Vector4Tests:Vector4ToStringTest():this
          12 (2.400% of base) : 276326.dasm - System.Drawing.PrimitivesTest.SizeFTests:GetHashCodeTest()
           9 (0.669% of base) : 92663.dasm - Microsoft.Build.Evaluation.EvaluationLocationPrettyPrinterBase:AppendDefaultLocationWithSeparator(System.Text.StringBuilder,System.TimeSpan,Microsoft.Build.Framework.Profiler.EvaluationLocation,Microsoft.Build.Framework.Profiler.ProfiledLocation,System.String):this

Top method improvements (bytes):
       -1522 (-37.776% of base) : 227608.dasm - System.Numerics.Tests.Matrix4x4Tests:Matrix4x4DecomposeTest02():this
        -252 (-14.711% of base) : 227428.dasm - System.Numerics.Tests.Vector4Tests:Vector4ClampTest():this
        -240 (-18.504% of base) : 227584.dasm - System.Numerics.Tests.Matrix4x4Tests:Matrix4x4LerpTest():this
        -204 (-14.256% of base) : 227559.dasm - System.Numerics.Tests.Matrix4x4Tests:CreateConstrainedBillboardFact(System.Numerics.Vector3,System.Numerics.Vector3,System.Numerics.Matrix4x4):this
        -184 (-38.017% of base) : 227607.dasm - System.Numerics.Tests.Matrix4x4Tests:Matrix4x4DecomposeTest01():this
        -175 (-12.324% of base) : 227285.dasm - System.Numerics.Tests.Vector3Tests:Vector3ClampTest():this
        -138 (-3.480% of base) : 261079.dasm - <Min_NullableFloat_TestData>d__29:MoveNext():bool:this
        -104 (-3.118% of base) : 261059.dasm - <Min_Float_TestData>d__10:MoveNext():bool:this
         -98 (-1.884% of base) : 74163.dasm - Dynamic.Operator.Tests.DivideEqualLiftTests:Float()
         -98 (-1.925% of base) : 74313.dasm - Dynamic.Operator.Tests.DivideEqualTypeTests:Float()
         -98 (-1.884% of base) : 74268.dasm - Dynamic.Operator.Tests.MinusEqualsLiftTests:Float()
         -98 (-1.925% of base) : 74418.dasm - Dynamic.Operator.Tests.MinusEqualsTypeTests:Float()
         -98 (-1.884% of base) : 74178.dasm - Dynamic.Operator.Tests.ModEqualLiftTests:Float()
         -98 (-1.925% of base) : 74328.dasm - Dynamic.Operator.Tests.ModEqualTypeTests:Float()
         -98 (-1.774% of base) : 74223.dasm - Dynamic.Operator.Tests.PlusEqualLiftTests:Float()
         -98 (-1.811% of base) : 74373.dasm - Dynamic.Operator.Tests.PlusEqualTypeTests:Float()
         -98 (-1.884% of base) : 74193.dasm - Dynamic.Operator.Tests.TimesEqualLiftTests:Float()
         -98 (-1.925% of base) : 74343.dasm - Dynamic.Operator.Tests.TimesEqualTypeTests:Float()
         -84 (-1.945% of base) : 261083.dasm - <Min_NullableDouble_TestData>d__32:MoveNext():bool:this
         -84 (-12.299% of base) : 227479.dasm - System.Numerics.Tests.Matrix3x2Tests:Matrix3x2LerpTest():this

Top method regressions (percentages):
          33 (34.375% of base) : 256501.dasm - System.Numerics.Tests.ComplexTests:Negate(double,double)
          29 (17.901% of base) : 256549.dasm - System.Numerics.Tests.ComplexTests:VerifyLog10(System.Numerics.Complex)
         709 (11.265% of base) : 227460.dasm - System.Numerics.Tests.Matrix3x2Tests:Matrix3x2EqualsNanTest():this
          20 (10.417% of base) : 227610.dasm - System.Numerics.Tests.Matrix4x4Tests:Matrix4x4DecomposeTest03():this
          49 (8.208% of base) : 256550.dasm - System.Numerics.Tests.ComplexTests:VerifyLogWithBase(System.Numerics.Complex)
          43 (2.778% of base) : 256128.dasm - System.Numerics.Tests.BigIntegerConstructorTest:RunCtorDoubleTests()
          16 (2.488% of base) : 227517.dasm - System.Numerics.Tests.Matrix4x4Tests:Matrix4x4CreateScaleTest2():this
          12 (2.400% of base) : 276326.dasm - System.Drawing.PrimitivesTest.SizeFTests:GetHashCodeTest()
          24 (2.218% of base) : 256698.dasm - <Random_2_TestData>d__13:MoveNext():bool:this
          39 (1.943% of base) : 256741.dasm - <Add_TestData>d__29:MoveNext():bool:this
          23 (1.815% of base) : 227445.dasm - System.Numerics.Tests.Matrix3x2Tests:Matrix3x2CreateScaleCenterTest1():this
           4 (1.702% of base) : 41568.dasm - System.Collections.Tests.Queue_Generic_Tests`1[__Canon][System.__Canon]:Queue_Generic_TrimExcess_Repeatedly(int):this
           4 (1.476% of base) : 106456.dasm - System.Tests.SingleTests:NaN()
           8 (1.468% of base) : 152790.dasm - <>c:<Test_Write_Metric>b__2_9(System.Collections.Generic.List`1[[BasicEventSourceTests.Event, System.Diagnostics.Tracing.Tests, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]]):this
           4 (1.439% of base) : 105804.dasm - System.Tests.DoubleTests:NaN()
          16 (1.388% of base) : 227416.dasm - System.Numerics.Tests.Vector4Tests:Vector4ToStringTest():this
          20 (1.299% of base) : 165182.dasm - Microsoft.VisualBasic.Tests.DoubleTypeTests:FromObject():this
          53 (1.216% of base) : 256827.dasm - <Sqrt_AdvancedTestData>d__94:MoveNext():bool:this
           9 (1.210% of base) : 262318.dasm - System.Diagnostics.Metrics.Tests.ExponentialHistogramTests:DifferencesGreaterThanErrorBound():this
           7 (1.180% of base) : 227377.dasm - System.Numerics.Tests.Vector4Tests:EmbeddedVectorSetFields():this

Top method improvements (percentages):
        -184 (-38.017% of base) : 227607.dasm - System.Numerics.Tests.Matrix4x4Tests:Matrix4x4DecomposeTest01():this
       -1522 (-37.776% of base) : 227608.dasm - System.Numerics.Tests.Matrix4x4Tests:Matrix4x4DecomposeTest02():this
        -240 (-18.504% of base) : 227584.dasm - System.Numerics.Tests.Matrix4x4Tests:Matrix4x4LerpTest():this
         -59 (-17.404% of base) : 227407.dasm - System.Numerics.Tests.Vector4Tests:Vector4DivisionTest3():this
         -45 (-16.245% of base) : 227302.dasm - System.Numerics.Tests.Vector3Tests:Vector3DivisionTest3():this
        -252 (-14.711% of base) : 227428.dasm - System.Numerics.Tests.Vector4Tests:Vector4ClampTest():this
        -204 (-14.256% of base) : 227559.dasm - System.Numerics.Tests.Matrix4x4Tests:CreateConstrainedBillboardFact(System.Numerics.Vector3,System.Numerics.Vector3,System.Numerics.Matrix4x4):this
        -175 (-12.324% of base) : 227285.dasm - System.Numerics.Tests.Vector3Tests:Vector3ClampTest():this
         -84 (-12.299% of base) : 227479.dasm - System.Numerics.Tests.Matrix3x2Tests:Matrix3x2LerpTest():this
         -12 (-10.714% of base) : 165551.dasm - Microsoft.VisualBasic.Tests.FinancialTests:FV_Default():this
         -12 (-10.714% of base) : 165565.dasm - Microsoft.VisualBasic.Tests.FinancialTests:Pmt_Default():this
         -12 (-10.714% of base) : 165569.dasm - Microsoft.VisualBasic.Tests.FinancialTests:PV_Default():this
         -25 (-8.993% of base) : 292519.dasm - Microsoft.Extensions.Logging.Console.Test.JsonConsoleFormatterTests:get_FloatingPointValues():Xunit.TheoryData`1[[System.Object, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]
         -30 (-8.798% of base) : 227644.dasm - System.Numerics.Tests.QuaternionTests:QuaternionToStringTest():this
         -40 (-7.905% of base) : 227567.dasm - System.Numerics.Tests.Matrix4x4Tests:Matrix4x4CreateOrthoOffCenterTest():this
         -56 (-7.152% of base) : 227344.dasm - System.Numerics.Tests.Vector3Tests:Vector3ReflectTest():this
         -32 (-7.018% of base) : 227566.dasm - System.Numerics.Tests.Matrix4x4Tests:Matrix4x4CreateOrthoTest():this
         -77 (-6.542% of base) : 227621.dasm - System.Numerics.Tests.Matrix4x4Tests:Matrix4x4CreateFromYawPitchRollTest2():this
         -10 (-5.495% of base) : 193783.dasm - <>c__DisplayClass13_0:<ConfigureAwait_TimeoutOrCanceled_Throws>b__2():System.Threading.Tasks.Task:this
         -10 (-5.495% of base) : 193786.dasm - <>c__DisplayClass13_0:<ConfigureAwait_TimeoutOrCanceled_Throws>b__5():System.Threading.Tasks.Task:this

231 total methods with Code Size differences (183 improved, 48 regressed), 2 unchanged.


Copy link
Member

@jakobbotsch jakobbotsch left a comment

Choose a reason for hiding this comment

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

LGTM. Do the diffs generally look good? Can you post perfscore diffs?

@EgorBo
Copy link
Member Author

EgorBo commented Aug 15, 2021

LGTM. Do the diffs generally look good? Can you post perfscore diffs?

Mostly, regressions don't look good in some cases, e.g.:

public static void Testik(double real, double imaginary)
{
    var complex = new Complex(real, imaginary);
    Complex result = -complex;
    VerifyRealImaginaryProperties(result, -complex.Real, -complex.Imaginary);
    result = Complex.Negate(complex);
    VerifyRealImaginaryProperties(result, -complex.Real, -complex.Imaginary);
}

codegen diff: https://www.diffchecker.com/sM5lRuLM

if (yes_cse_cost <= no_cse_cost) // 1200 <= 600

So the heuristics have to be tuned more...
(it was not regressed in my initial PR because it only handled loops' bodies)

@AndyAyersMS
Copy link
Member

Seems like there ought to be some cost element -- we likely only want to block cross-call CSEs for things that are cheap to recompute, like constants.

@jakobbotsch
Copy link
Member

Seems like there ought to be some cost element -- we likely only want to block cross-call CSEs for things that are cheap to recompute, like constants.

CSE will estimate the use/def cost based on canEnregister, so it is using existing heuristics now to determine this. However, those heuristics may not be adjusted well enough for float computations, so not too sure if it is too risky to rely on them without digging into them in more detail.

@AndyAyersMS
Copy link
Member

Seems like accurate costing is tricky. Uses that happen before a call are cheaper than the ones that happen after a call, but we only count the total number.

We know there's at least one of each, I suppose.

Comment on lines 2604 to 2609
if (candidate->Expr()->IsCnsFltOrDbl() && (CNT_CALLEE_SAVED_FLOAT == 0))
{
// We should do CSE for fp constants in case of LiveAcrossCall only when absolutely necessary
// on ABIs without callee-saved registers.
cse_use_cost += 2;
}
Copy link
Member

Choose a reason for hiding this comment

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

I am ok with this more surgical fix for 6.0, but if we decide to go this route then you should open an issue about revisiting the float heuristics for .NET 7. It does not really make sense to adjust the use cost of a CSE based on the contents of the tree that is being CSE'd, I think.

@EgorBo
Copy link
Member Author

EgorBo commented Aug 16, 2021

Seems like accurate costing is tricky. Uses that happen before a call are cheaper than the ones that happen after a call, but we only count the total number.

We know there's at least one of each, I suppose.

Why uses after calls are more expensive? We're going to spill a value before a call and then load it to a reg again, so all uses after the call are going to use that reg making it as cheap as before-call uses, am I correct? (ah, well if that reg will be available)

So I found the least painful workaround - I disable CSE for constants if there are 4 or less uses on SysV-like ABIs when we cross calls.

jit-diff:

benchmarks.run.Linux.x64.checked.mch:


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 6003
Total bytes of diff: 5818
Total bytes of delta: -185 (-3.082% of base)
Total relative delta: -0.56
    diff is an improvement.
    relative diff is an improvement.
Detail diffs


Top file improvements (bytes):
         -27 : 18116.dasm (-5.357% of base)
         -22 : 12884.dasm (-3.416% of base)
         -20 : 15893.dasm (-7.246% of base)
         -18 : 8925.dasm (-10.345% of base)
         -18 : 5938.dasm (-10.345% of base)
         -17 : 27873.dasm (-4.427% of base)
         -15 : 27657.dasm (-2.366% of base)
         -12 : 14186.dasm (-1.329% of base)
         -10 : 27652.dasm (-3.650% of base)
          -9 : 23118.dasm (-0.834% of base)
          -8 : 9256.dasm (-3.347% of base)
          -7 : 25066.dasm (-2.431% of base)
          -2 : 11099.dasm (-0.465% of base)

13 total files with Code Size differences (13 improved, 0 regressed), 0 unchanged.

Top method improvements (bytes):
         -27 (-5.357% of base) : 18116.dasm - BenchmarksGame.Mandelbrot_2:DoBench(int,System.IO.MemoryStream,bool)
         -22 (-3.416% of base) : 12884.dasm - Benchstone.BenchF.NewtE:Test():bool:this
         -20 (-7.246% of base) : 15893.dasm - Benchstone.BenchF.Simpsn:Test():bool:this
         -18 (-10.345% of base) : 8925.dasm - MessagePack.Formatters.DynamicObjectTypeFallbackFormatter:.ctor(MessagePack.IFormatterResolver[]):this
         -18 (-10.345% of base) : 5938.dasm - Utf8Json.Formatters.DynamicObjectTypeFallbackFormatter:.ctor(Utf8Json.IJsonFormatterResolver[]):this
         -17 (-4.427% of base) : 27873.dasm - Benchstone.BenchF.DMath:Bench(int):bool
         -15 (-2.366% of base) : 27657.dasm - Burgers:GetCalculated0(int,int,double,double,double,System.Double[]):System.Double[]
         -12 (-1.329% of base) : 14186.dasm - Benchstone.BenchF.Romber:Test():bool:this
         -10 (-3.650% of base) : 27652.dasm - Burgers:Setup():this
          -9 (-0.834% of base) : 23118.dasm - BenchmarksGame.NBodySystem:.ctor():this
          -8 (-3.347% of base) : 9256.dasm - ObjectFallbackEqualityComparer:.ctor(MessagePack.MessagePackSecurity):this
          -7 (-2.431% of base) : 25066.dasm - FractalPerf.Launch:Test():double:this
          -2 (-0.465% of base) : 11099.dasm - System.MathBenchmarks.Double:MaxTest()

Top method improvements (percentages):
         -18 (-10.345% of base) : 8925.dasm - MessagePack.Formatters.DynamicObjectTypeFallbackFormatter:.ctor(MessagePack.IFormatterResolver[]):this
         -18 (-10.345% of base) : 5938.dasm - Utf8Json.Formatters.DynamicObjectTypeFallbackFormatter:.ctor(Utf8Json.IJsonFormatterResolver[]):this
         -20 (-7.246% of base) : 15893.dasm - Benchstone.BenchF.Simpsn:Test():bool:this
         -27 (-5.357% of base) : 18116.dasm - BenchmarksGame.Mandelbrot_2:DoBench(int,System.IO.MemoryStream,bool)
         -17 (-4.427% of base) : 27873.dasm - Benchstone.BenchF.DMath:Bench(int):bool
         -10 (-3.650% of base) : 27652.dasm - Burgers:Setup():this
         -22 (-3.416% of base) : 12884.dasm - Benchstone.BenchF.NewtE:Test():bool:this
          -8 (-3.347% of base) : 9256.dasm - ObjectFallbackEqualityComparer:.ctor(MessagePack.MessagePackSecurity):this
          -7 (-2.431% of base) : 25066.dasm - FractalPerf.Launch:Test():double:this
         -15 (-2.366% of base) : 27657.dasm - Burgers:GetCalculated0(int,int,double,double,double,System.Double[]):System.Double[]
         -12 (-1.329% of base) : 14186.dasm - Benchstone.BenchF.Romber:Test():bool:this
          -9 (-0.834% of base) : 23118.dasm - BenchmarksGame.NBodySystem:.ctor():this
          -2 (-0.465% of base) : 11099.dasm - System.MathBenchmarks.Double:MaxTest()

13 total methods with Code Size differences (13 improved, 0 regressed), 0 unchanged.


coreclr_tests.pmi.Linux.x64.checked.mch:


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 269425
Total bytes of diff: 268443
Total bytes of delta: -982 (-0.364% of base)
Total relative delta: -5.38
    diff is an improvement.
    relative diff is an improvement.
Detail diffs


Top file regressions (bytes):
         204 : 185292.dasm (47.887% of base)
         203 : 185277.dasm (41.260% of base)
         201 : 185247.dasm (27.839% of base)
         200 : 185272.dasm (46.296% of base)
         194 : 185280.dasm (30.455% of base)
         185 : 185274.dasm (42.824% of base)
         185 : 185253.dasm (11.997% of base)
         185 : 185266.dasm (46.020% of base)
         169 : 185250.dasm (29.545% of base)
         168 : 185281.dasm (40.777% of base)
         167 : 185284.dasm (21.438% of base)
         164 : 185241.dasm (27.797% of base)
         161 : 185270.dasm (39.558% of base)
         111 : 244808.dasm (5.241% of base)
         111 : 233710.dasm (5.241% of base)
          99 : 242705.dasm (4.699% of base)
          99 : 233359.dasm (4.699% of base)
          48 : 253058.dasm (6.887% of base)
          40 : 148168.dasm (1.775% of base)
          34 : 242805.dasm (2.133% of base)

Top file improvements (bytes):
        -168 : 253358.dasm (-39.252% of base)
        -156 : 82787.dasm (-38.806% of base)
         -64 : 215594.dasm (-10.978% of base)
         -59 : 185293.dasm (-8.912% of base)
         -51 : 215595.dasm (-9.206% of base)
         -48 : 241736.dasm (-22.642% of base)
         -44 : 185290.dasm (-7.166% of base)
         -43 : 185265.dasm (-6.740% of base)
         -39 : 246765.dasm (-15.663% of base)
         -38 : 215596.dasm (-7.393% of base)
         -38 : 215563.dasm (-8.172% of base)
         -33 : 202680.dasm (-3.399% of base)
         -33 : 215564.dasm (-6.889% of base)
         -32 : 245625.dasm (-2.560% of base)
         -30 : 185294.dasm (-4.918% of base)
         -29 : 185291.dasm (-4.625% of base)
         -29 : 185269.dasm (-4.693% of base)
         -29 : 147767.dasm (-6.621% of base)
         -27 : 247239.dasm (-5.357% of base)
         -26 : 235581.dasm (-3.171% of base)

479 total files with Code Size differences (375 improved, 104 regressed), 14 unchanged.

Top method regressions (bytes):
         204 (47.887% of base) : 185292.dasm - testout1:Func_0_4_3():double
         203 (41.260% of base) : 185277.dasm - testout1:Func_0_7_1():float
         201 (27.839% of base) : 185247.dasm - testout1:Func_0_1_8():double
         200 (46.296% of base) : 185272.dasm - testout1:Func_0_7_6():double
         194 (30.455% of base) : 185280.dasm - testout1:Func_0_6_3():long
         185 (11.997% of base) : 185253.dasm - testout1:Func_0_1_2():float
         185 (42.824% of base) : 185274.dasm - testout1:Func_0_7_4():double
         185 (46.020% of base) : 185266.dasm - testout1:Func_0_8_4():double
         169 (29.545% of base) : 185250.dasm - testout1:Func_0_1_5():double
         168 (40.777% of base) : 185281.dasm - testout1:Func_0_6_2():double
         167 (21.438% of base) : 185284.dasm - testout1:Func_0_5_6():double
         164 (27.797% of base) : 185241.dasm - testout1:Func_0_2_5():short
         161 (39.558% of base) : 185270.dasm - testout1:Func_0_7_8():double
         111 (5.241% of base) : 244808.dasm - ConvR8test:Main():int
         111 (5.241% of base) : 233710.dasm - ConvR8test:Main():int
          99 (4.699% of base) : 242705.dasm - ConvR4test:Main():int
          99 (4.699% of base) : 233359.dasm - ConvR4test:Main():int
          48 (6.887% of base) : 253058.dasm - pow0:Main():int
          40 (1.775% of base) : 148168.dasm - testout1:Func_0_6_5_4_2():float
          34 (2.133% of base) : 242805.dasm - Burgers:Main():int

Top method improvements (bytes):
        -168 (-39.252% of base) : 253358.dasm - Program:Main():int
        -156 (-38.806% of base) : 82787.dasm - GitHub_36905:Main():int
         -64 (-10.978% of base) : 215594.dasm - StructABI:NotEnoughRegistersSysV4Wrapper():bool
         -59 (-8.912% of base) : 185293.dasm - testout1:Func_0_4_2():double
         -51 (-9.206% of base) : 215595.dasm - StructABI:NotEnoughRegistersSysV5Wrapper():bool
         -48 (-22.642% of base) : 241736.dasm - VectorTest:Vector3ReturnTest():int
         -44 (-7.166% of base) : 185290.dasm - testout1:Func_0_4_5():double
         -43 (-6.740% of base) : 185265.dasm - testout1:Func_0_8_5():double
         -39 (-15.663% of base) : 246765.dasm - Benchstone.BenchF.Simpsn:Bench():bool
         -38 (-8.172% of base) : 215563.dasm - StructABI:EnoughRegistersSysV3Wrapper():bool
         -38 (-7.393% of base) : 215596.dasm - StructABI:NotEnoughRegistersSysV6Wrapper():bool
         -33 (-6.889% of base) : 215564.dasm - StructABI:EnoughRegistersSysV4Wrapper():bool
         -33 (-3.399% of base) : 202680.dasm - testout1:Func_0_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1():double
         -32 (-2.560% of base) : 245625.dasm - VectorTest:Main():int
         -30 (-4.918% of base) : 185294.dasm - testout1:Func_0_4_1():double
         -29 (-6.621% of base) : 147767.dasm - testout1:Func_0_3_3_5_2():float
         -29 (-4.625% of base) : 185291.dasm - testout1:Func_0_4_4():double
         -29 (-4.693% of base) : 185269.dasm - testout1:Func_0_8_1():double
         -27 (-5.357% of base) : 247239.dasm - BenchmarksGame.Mandelbrot_2:DoBench(int,System.IO.MemoryStream,bool)
         -26 (-3.171% of base) : 235581.dasm - Program:TestNotPowOfTwo_Double(double)

Top method regressions (percentages):
         204 (47.887% of base) : 185292.dasm - testout1:Func_0_4_3():double
         200 (46.296% of base) : 185272.dasm - testout1:Func_0_7_6():double
         185 (46.020% of base) : 185266.dasm - testout1:Func_0_8_4():double
         185 (42.824% of base) : 185274.dasm - testout1:Func_0_7_4():double
         203 (41.260% of base) : 185277.dasm - testout1:Func_0_7_1():float
         168 (40.777% of base) : 185281.dasm - testout1:Func_0_6_2():double
         161 (39.558% of base) : 185270.dasm - testout1:Func_0_7_8():double
         194 (30.455% of base) : 185280.dasm - testout1:Func_0_6_3():long
         169 (29.545% of base) : 185250.dasm - testout1:Func_0_1_5():double
         201 (27.839% of base) : 185247.dasm - testout1:Func_0_1_8():double
         164 (27.797% of base) : 185241.dasm - testout1:Func_0_2_5():short
         167 (21.438% of base) : 185284.dasm - testout1:Func_0_5_6():double
         185 (11.997% of base) : 185253.dasm - testout1:Func_0_1_2():float
          48 (6.887% of base) : 253058.dasm - pow0:Main():int
          14 (6.542% of base) : 97794.dasm - testout1:Func_0_2_5_1_2():int
          20 (6.472% of base) : 97437.dasm - testout1:Func_0_2_3_4():double
          20 (6.472% of base) : 147324.dasm - testout1:Func_0_2_3_4():double
          18 (6.122% of base) : 98041.dasm - testout1:Func_0_3_5_6_3():float
         111 (5.241% of base) : 244808.dasm - ConvR8test:Main():int
         111 (5.241% of base) : 233710.dasm - ConvR8test:Main():int

Top method improvements (percentages):
        -168 (-39.252% of base) : 253358.dasm - Program:Main():int
        -156 (-38.806% of base) : 82787.dasm - GitHub_36905:Main():int
         -24 (-27.273% of base) : 252545.dasm - coreclr_test_13647.doublenegate:Test2():bool
         -48 (-22.642% of base) : 241736.dasm - VectorTest:Vector3ReturnTest():int
         -20 (-18.018% of base) : 147761.dasm - testout1:Func_0_3_3_6_3():float
         -39 (-15.663% of base) : 246765.dasm - Benchstone.BenchF.Simpsn:Bench():bool
         -24 (-14.286% of base) : 239200.dasm - FloatOvfToInt:TestValuesDoubleInt():int
         -24 (-14.286% of base) : 239196.dasm - FloatOvfToInt:TestValuesFloatInt():int
         -10 (-11.236% of base) : 97947.dasm - testout1:Func_0_3_1_6_4():double
         -64 (-10.978% of base) : 215594.dasm - StructABI:NotEnoughRegistersSysV4Wrapper():bool
         -19 (-10.215% of base) : 147689.dasm - testout1:Func_0_2_6_6_6():double
         -22 (-9.322% of base) : 148008.dasm - testout1:Func_0_5_5_2_1():float
         -22 (-9.322% of base) : 98372.dasm - testout1:Func_0_5_5_2_1():float
         -51 (-9.206% of base) : 215595.dasm - StructABI:NotEnoughRegistersSysV5Wrapper():bool
         -59 (-8.912% of base) : 185293.dasm - testout1:Func_0_4_2():double
         -38 (-8.172% of base) : 215563.dasm - StructABI:EnoughRegistersSysV3Wrapper():bool
         -24 (-8.163% of base) : 202629.dasm - testout1:Func_0_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1():float
         -14 (-8.046% of base) : 202673.dasm - testout1:Func_0_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1():float
         -14 (-8.046% of base) : 203600.dasm - testout1:Func_0_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1_1():float
         -38 (-7.393% of base) : 215596.dasm - StructABI:NotEnoughRegistersSysV6Wrapper():bool

479 total methods with Code Size differences (375 improved, 104 regressed), 14 unchanged.


libraries.pmi.Linux.x64.checked.mch:


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 1589
Total bytes of diff: 1536
Total bytes of delta: -53 (-3.335% of base)
Total relative delta: -0.06
    diff is an improvement.
    relative diff is an improvement.
Detail diffs


Top file improvements (bytes):
         -47 : 12234.dasm (-3.481% of base)
          -6 : 133981.dasm (-2.510% of base)

2 total files with Code Size differences (2 improved, 0 regressed), 0 unchanged.

Top method improvements (bytes):
         -47 (-3.481% of base) : 12234.dasm - Microsoft.VisualBasic.Financial:IRR(byref,double):double
          -6 (-2.510% of base) : 133981.dasm - Microsoft.Diagnostics.Tracing.Analysis.TraceProcessesExtensions:Process(Microsoft.Diagnostics.Tracing.TraceEvent):Microsoft.Diagnostics.Tracing.Analysis.TraceProcess

Top method improvements (percentages):
         -47 (-3.481% of base) : 12234.dasm - Microsoft.VisualBasic.Financial:IRR(byref,double):double
          -6 (-2.510% of base) : 133981.dasm - Microsoft.Diagnostics.Tracing.Analysis.TraceProcessesExtensions:Process(Microsoft.Diagnostics.Tracing.TraceEvent):Microsoft.Diagnostics.Tracing.Analysis.TraceProcess

2 total methods with Code Size differences (2 improved, 0 regressed), 0 unchanged.


libraries.crossgen2.Linux.x64.checked.mch:


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 3439
Total bytes of diff: 3348
Total bytes of delta: -91 (-2.646% of base)
Total relative delta: -0.42
    diff is an improvement.
    relative diff is an improvement.
Detail diffs


Top file improvements (bytes):
         -47 : 48740.dasm (-3.818% of base)
         -10 : 70059.dasm (-6.369% of base)
         -10 : 80367.dasm (-5.650% of base)
          -9 : 84815.dasm (-6.569% of base)
          -6 : 80375.dasm (-17.647% of base)
          -5 : 184706.dasm (-0.466% of base)
          -2 : 70060.dasm (-0.719% of base)
          -2 : 56034.dasm (-0.847% of base)

8 total files with Code Size differences (8 improved, 0 regressed), 1 unchanged.

Top method improvements (bytes):
         -47 (-3.818% of base) : 48740.dasm - Microsoft.VisualBasic.Financial:IRR(byref,double):double
         -10 (-6.369% of base) : 70059.dasm - System.Diagnostics.Tracing.EventCounter:Flush():this
         -10 (-5.650% of base) : 80367.dasm - System.Globalization.CalendricalCalculationsHelper:EstimatePrior(double,double):double
          -9 (-6.569% of base) : 84815.dasm - System.DateTimeParse:ParseFraction(byref,byref):bool
          -6 (-17.647% of base) : 80375.dasm - System.Globalization.CalendricalCalculationsHelper:InitLongitude(double):double
          -5 (-0.466% of base) : 184706.dasm - Microsoft.Xunit.Performance.Api.CSVMetricReader:.ctor(System.String):this
          -2 (-0.847% of base) : 56034.dasm - Internal.Cryptography.Pal.CachedSystemStoreProvider:.cctor()
          -2 (-0.719% of base) : 70060.dasm - System.Diagnostics.Tracing.EventCounter:Enqueue(double):this

Top method improvements (percentages):
          -6 (-17.647% of base) : 80375.dasm - System.Globalization.CalendricalCalculationsHelper:InitLongitude(double):double
          -9 (-6.569% of base) : 84815.dasm - System.DateTimeParse:ParseFraction(byref,byref):bool
         -10 (-6.369% of base) : 70059.dasm - System.Diagnostics.Tracing.EventCounter:Flush():this
         -10 (-5.650% of base) : 80367.dasm - System.Globalization.CalendricalCalculationsHelper:EstimatePrior(double,double):double
         -47 (-3.818% of base) : 48740.dasm - Microsoft.VisualBasic.Financial:IRR(byref,double):double
          -2 (-0.847% of base) : 56034.dasm - Internal.Cryptography.Pal.CachedSystemStoreProvider:.cctor()
          -2 (-0.719% of base) : 70060.dasm - System.Diagnostics.Tracing.EventCounter:Enqueue(double):this
          -5 (-0.466% of base) : 184706.dasm - Microsoft.Xunit.Performance.Api.CSVMetricReader:.ctor(System.String):this

8 total methods with Code Size differences (8 improved, 0 regressed), 1 unchanged.


libraries_tests.pmi.Linux.x64.checked.mch:


Summary of Code Size diffs:
(Lower is better)

Total bytes of base: 980213
Total bytes of diff: 978009
Total bytes of delta: -2204 (-0.225% of base)
Total relative delta: -3.95
    diff is an improvement.
    relative diff is an improvement.
Detail diffs


Top file regressions (bytes):
          16 : 227416.dasm (1.388% of base)
           9 : 262317.dasm (1.106% of base)
           9 : 262318.dasm (1.210% of base)
           8 : 152790.dasm (1.468% of base)
           8 : 227321.dasm (0.806% of base)
           4 : 227446.dasm (1.136% of base)
           4 : 41568.dasm (1.702% of base)
           4 : 249995.dasm (0.410% of base)
           4 : 171605.dasm (0.386% of base)
           4 : 106456.dasm (1.476% of base)
           4 : 105804.dasm (1.439% of base)
           3 : 280690.dasm (0.555% of base)
           1 : 250564.dasm (0.128% of base)
           1 : 249998.dasm (0.127% of base)
           1 : 256128.dasm (0.065% of base)

Top file improvements (bytes):
        -252 : 227428.dasm (-14.711% of base)
        -240 : 227584.dasm (-18.504% of base)
        -184 : 227607.dasm (-38.017% of base)
        -175 : 227285.dasm (-12.324% of base)
         -84 : 227479.dasm (-12.299% of base)
         -77 : 227621.dasm (-6.542% of base)
         -59 : 227407.dasm (-17.404% of base)
         -47 : 204531.dasm (-4.489% of base)
         -45 : 227302.dasm (-16.245% of base)
         -42 : 227692.dasm (-1.943% of base)
         -40 : 227567.dasm (-7.905% of base)
         -32 : 227566.dasm (-7.018% of base)
         -30 : 227644.dasm (-8.798% of base)
         -25 : 292519.dasm (-8.993% of base)
         -24 : 227531.dasm (-1.709% of base)
         -24 : 227530.dasm (-1.709% of base)
         -24 : 94596.dasm (-1.647% of base)
         -24 : 227619.dasm (-1.119% of base)
         -24 : 227447.dasm (-1.990% of base)
         -24 : 227529.dasm (-1.709% of base)

142 total files with Code Size differences (127 improved, 15 regressed), 3 unchanged.

Top method regressions (bytes):
          16 (1.388% of base) : 227416.dasm - System.Numerics.Tests.Vector4Tests:Vector4ToStringTest():this
           9 (1.210% of base) : 262318.dasm - System.Diagnostics.Metrics.Tests.ExponentialHistogramTests:DifferencesGreaterThanErrorBound():this
           9 (1.106% of base) : 262317.dasm - System.Diagnostics.Metrics.Tests.ExponentialHistogramTests:DifferencesLessThanErrorBound():this
           8 (1.468% of base) : 152790.dasm - <>c:<Test_Write_Metric>b__2_9(System.Collections.Generic.List`1[[BasicEventSourceTests.Event, System.Diagnostics.Tracing.Tests, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]]):this
           8 (0.806% of base) : 227321.dasm - System.Numerics.Tests.Vector3Tests:Vector3ToStringTest():this
           4 (1.702% of base) : 41568.dasm - System.Collections.Tests.Queue_Generic_Tests`1[__Canon][System.__Canon]:Queue_Generic_TrimExcess_Repeatedly(int):this
           4 (0.386% of base) : 171605.dasm - System.Net.Http.Tests.StringWithQualityHeaderValueTest:Equals_UseSameAndDifferentRanges_EqualOrNotEqualNoExceptions():this
           4 (1.136% of base) : 227446.dasm - System.Numerics.Tests.Matrix3x2Tests:Matrix3x2CreateScaleTest2():this
           4 (1.439% of base) : 105804.dasm - System.Tests.DoubleTests:NaN()
           4 (0.410% of base) : 249995.dasm - System.Tests.MathFTests:IEEERemainder()
           4 (1.476% of base) : 106456.dasm - System.Tests.SingleTests:NaN()
           3 (0.555% of base) : 280690.dasm - System.Diagnostics.Tests.ProcessTests:TestProcessorTime():this
           1 (0.065% of base) : 256128.dasm - System.Numerics.Tests.BigIntegerConstructorTest:RunCtorDoubleTests()
           1 (0.127% of base) : 249998.dasm - System.Tests.MathFTests:LogWithBase()
           1 (0.128% of base) : 250564.dasm - System.Tests.MathTests:LogWithBase()

Top method improvements (bytes):
        -252 (-14.711% of base) : 227428.dasm - System.Numerics.Tests.Vector4Tests:Vector4ClampTest():this
        -240 (-18.504% of base) : 227584.dasm - System.Numerics.Tests.Matrix4x4Tests:Matrix4x4LerpTest():this
        -184 (-38.017% of base) : 227607.dasm - System.Numerics.Tests.Matrix4x4Tests:Matrix4x4DecomposeTest01():this
        -175 (-12.324% of base) : 227285.dasm - System.Numerics.Tests.Vector3Tests:Vector3ClampTest():this
         -84 (-12.299% of base) : 227479.dasm - System.Numerics.Tests.Matrix3x2Tests:Matrix3x2LerpTest():this
         -77 (-6.542% of base) : 227621.dasm - System.Numerics.Tests.Matrix4x4Tests:Matrix4x4CreateFromYawPitchRollTest2():this
         -59 (-17.404% of base) : 227407.dasm - System.Numerics.Tests.Vector4Tests:Vector4DivisionTest3():this
         -47 (-4.489% of base) : 204531.dasm - System.ComponentModel.TypeConverterTests.SizeFConverterTests:get_SizeFData():System.Collections.Generic.IEnumerable`1[[System.Object[], System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]
         -45 (-16.245% of base) : 227302.dasm - System.Numerics.Tests.Vector3Tests:Vector3DivisionTest3():this
         -42 (-1.943% of base) : 227692.dasm - System.Numerics.Tests.QuaternionTests:QuaternionCreateFromYawPitchRollTest2():this
         -40 (-7.905% of base) : 227567.dasm - System.Numerics.Tests.Matrix4x4Tests:Matrix4x4CreateOrthoOffCenterTest():this
         -32 (-7.018% of base) : 227566.dasm - System.Numerics.Tests.Matrix4x4Tests:Matrix4x4CreateOrthoTest():this
         -30 (-8.798% of base) : 227644.dasm - System.Numerics.Tests.QuaternionTests:QuaternionToStringTest():this
         -25 (-8.993% of base) : 292519.dasm - Microsoft.Extensions.Logging.Console.Test.JsonConsoleFormatterTests:get_FloatingPointValues():Xunit.TheoryData`1[[System.Object, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]
         -24 (-1.647% of base) : 94596.dasm - Microsoft.Build.BackEnd.Scheduler:WriteRecursiveSummary(Microsoft.Build.BackEnd.Logging.ILoggingService,Microsoft.Build.Framework.BuildEventContext,int,Microsoft.Build.BackEnd.SchedulableRequest,int,bool,bool):this
         -24 (-1.990% of base) : 227447.dasm - System.Numerics.Tests.Matrix3x2Tests:Matrix3x2CreateScaleCenterTest2():this
         -24 (-1.119% of base) : 227619.dasm - System.Numerics.Tests.Matrix4x4Tests:Matrix4x4CreateFromAxisAngleTest():this
         -24 (-3.433% of base) : 227519.dasm - System.Numerics.Tests.Matrix4x4Tests:Matrix4x4CreateScaleTest3():this
         -24 (-3.320% of base) : 227522.dasm - System.Numerics.Tests.Matrix4x4Tests:Matrix4x4CreateTranslationTest2():this
         -24 (-1.709% of base) : 227529.dasm - System.Numerics.Tests.Matrix4x4Tests:Matrix4x4FromQuaternionTest2():this

Top method regressions (percentages):
           4 (1.702% of base) : 41568.dasm - System.Collections.Tests.Queue_Generic_Tests`1[__Canon][System.__Canon]:Queue_Generic_TrimExcess_Repeatedly(int):this
           4 (1.476% of base) : 106456.dasm - System.Tests.SingleTests:NaN()
           8 (1.468% of base) : 152790.dasm - <>c:<Test_Write_Metric>b__2_9(System.Collections.Generic.List`1[[BasicEventSourceTests.Event, System.Diagnostics.Tracing.Tests, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]]):this
           4 (1.439% of base) : 105804.dasm - System.Tests.DoubleTests:NaN()
          16 (1.388% of base) : 227416.dasm - System.Numerics.Tests.Vector4Tests:Vector4ToStringTest():this
           9 (1.210% of base) : 262318.dasm - System.Diagnostics.Metrics.Tests.ExponentialHistogramTests:DifferencesGreaterThanErrorBound():this
           4 (1.136% of base) : 227446.dasm - System.Numerics.Tests.Matrix3x2Tests:Matrix3x2CreateScaleTest2():this
           9 (1.106% of base) : 262317.dasm - System.Diagnostics.Metrics.Tests.ExponentialHistogramTests:DifferencesLessThanErrorBound():this
           8 (0.806% of base) : 227321.dasm - System.Numerics.Tests.Vector3Tests:Vector3ToStringTest():this
           3 (0.555% of base) : 280690.dasm - System.Diagnostics.Tests.ProcessTests:TestProcessorTime():this
           4 (0.410% of base) : 249995.dasm - System.Tests.MathFTests:IEEERemainder()
           4 (0.386% of base) : 171605.dasm - System.Net.Http.Tests.StringWithQualityHeaderValueTest:Equals_UseSameAndDifferentRanges_EqualOrNotEqualNoExceptions():this
           1 (0.128% of base) : 250564.dasm - System.Tests.MathTests:LogWithBase()
           1 (0.127% of base) : 249998.dasm - System.Tests.MathFTests:LogWithBase()
           1 (0.065% of base) : 256128.dasm - System.Numerics.Tests.BigIntegerConstructorTest:RunCtorDoubleTests()

Top method improvements (percentages):
        -184 (-38.017% of base) : 227607.dasm - System.Numerics.Tests.Matrix4x4Tests:Matrix4x4DecomposeTest01():this
        -240 (-18.504% of base) : 227584.dasm - System.Numerics.Tests.Matrix4x4Tests:Matrix4x4LerpTest():this
         -59 (-17.404% of base) : 227407.dasm - System.Numerics.Tests.Vector4Tests:Vector4DivisionTest3():this
         -45 (-16.245% of base) : 227302.dasm - System.Numerics.Tests.Vector3Tests:Vector3DivisionTest3():this
        -252 (-14.711% of base) : 227428.dasm - System.Numerics.Tests.Vector4Tests:Vector4ClampTest():this
        -175 (-12.324% of base) : 227285.dasm - System.Numerics.Tests.Vector3Tests:Vector3ClampTest():this
         -84 (-12.299% of base) : 227479.dasm - System.Numerics.Tests.Matrix3x2Tests:Matrix3x2LerpTest():this
         -12 (-10.714% of base) : 165551.dasm - Microsoft.VisualBasic.Tests.FinancialTests:FV_Default():this
         -12 (-10.714% of base) : 165565.dasm - Microsoft.VisualBasic.Tests.FinancialTests:Pmt_Default():this
         -12 (-10.714% of base) : 165569.dasm - Microsoft.VisualBasic.Tests.FinancialTests:PV_Default():this
         -25 (-8.993% of base) : 292519.dasm - Microsoft.Extensions.Logging.Console.Test.JsonConsoleFormatterTests:get_FloatingPointValues():Xunit.TheoryData`1[[System.Object, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]
         -30 (-8.798% of base) : 227644.dasm - System.Numerics.Tests.QuaternionTests:QuaternionToStringTest():this
         -40 (-7.905% of base) : 227567.dasm - System.Numerics.Tests.Matrix4x4Tests:Matrix4x4CreateOrthoOffCenterTest():this
         -32 (-7.018% of base) : 227566.dasm - System.Numerics.Tests.Matrix4x4Tests:Matrix4x4CreateOrthoTest():this
         -77 (-6.542% of base) : 227621.dasm - System.Numerics.Tests.Matrix4x4Tests:Matrix4x4CreateFromYawPitchRollTest2():this
         -10 (-5.495% of base) : 193783.dasm - <>c__DisplayClass13_0:<ConfigureAwait_TimeoutOrCanceled_Throws>b__2():System.Threading.Tasks.Task:this
         -10 (-5.495% of base) : 193786.dasm - <>c__DisplayClass13_0:<ConfigureAwait_TimeoutOrCanceled_Throws>b__5():System.Threading.Tasks.Task:this
         -10 (-5.051% of base) : 165571.dasm - Microsoft.VisualBasic.Tests.FinancialTests:Rate_Default():this
         -10 (-4.902% of base) : 165553.dasm - Microsoft.VisualBasic.Tests.FinancialTests:IPmt_Default():this
         -10 (-4.902% of base) : 165567.dasm - Microsoft.VisualBasic.Tests.FinancialTests:PPmt_Default():this

142 total methods with Code Size differences (127 improved, 15 regressed), 3 unchanged.


Overall it's mostly an improvement, but there are some regressions (all previous jit-diffs were even worse):

https://www.diffchecker.com/ow2qn9Su
https://www.diffchecker.com/F2AxDXVI
https://www.diffchecker.com/nSjoTfPy
https://www.diffchecker.com/31s4kH4F

@jakobbotsch @AndyAyersMS PTAL once again please

@briansull
Copy link
Contributor

It looks like CSE already tries to account for this:

The CSE heuristics aren't going to get every case.
It is just an estimate of where we will win more than 50% of the time.

Copy link
Contributor

@briansull briansull left a comment

Choose a reason for hiding this comment

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

This fix looks good to me

@jakobbotsch
Copy link
Member

The CSE heuristics aren't going to get every case.
It is just an estimate of where we will win more than 50% of the time.

I realize that, but cases like this probably suggest that the heuristic can be adjusted (as it was now).

@EgorBo
Copy link
Member Author

EgorBo commented Aug 17, 2021

Failures:

@EgorBo EgorBo merged commit e6d37d7 into dotnet:main Aug 17, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Sep 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR 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.

[Perf] Regressions in Burgers.Test0
4 participants