Replies: 10 comments
-
The Jit currently does not have "unit" test (with a few one-off exceptions). Most of the testing is functional and lives under |
Beta Was this translation helpful? Give feedback.
-
@SingleAccretion thanks for your answer, I have 2 additional questions if I'm allowed to ask:
|
Beta Was this translation helpful? Give feedback.
-
For all Jit changes, assembly code diffs they cause are evaluated. We have tooling (SPMI), in CI and locally, that allows one to replay tens of thousands of compilations and view how the Jit's output changes. We also have a good number of performance benchmarks that are monitored for regressions. These are the two primary mechanisms that ensure no unexpected things happen.
a) It's a bit of a personal workflow choice; I usually just create a very simple managed method and check whether the changes have the desired outcome. A collection of such methods could be, and often is, turned into a runtime test and committed together with the change. |
Beta Was this translation helpful? Give feedback.
-
@SingleAccretion thanks! your tips was valuable for me. I'm going forward and now I have the following dll
I can to debug this dll and I able to catch breakpoints in It's a bit strange for me, but To make sure, I need (somehow) to see the actual ASM code which jit emits. Could someone shed some light how to extract ASM from debugged jit? |
Beta Was this translation helpful? Give feedback.
-
Ordinarily, I would expect this expression to have been folded by the time we get to post-order. Are you running with optimizations on (aka TC turned off,
|
Beta Was this translation helpful? Give feedback.
-
I'm debugging on windows.x64.debug coreclr binaries and release configuration of my dll.
I set <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<TieredCompilation>false</TieredCompilation>
</PropertyGroup>
</Project> using System.Runtime.CompilerServices;
Mult();
[MethodImpl(MethodImplOptions.NoInlining)]
void Mult()
{
float a = 123;
//float b = 1;
float c = a * 1f;
Console.WriteLine($"c is {c}");
} and I see the following: I can't check ASM right now, due to I don't receive jit dumps. I followed that instruction but I've lost something probably (no idea what). (HKCU too) |
Beta Was this translation helpful? Give feedback.
-
addition: I get something big (18 MB) like:
That's not I need, no info about my dll exists here... |
Beta Was this translation helpful? Give feedback.
-
Depends on how you get the app to run;
I have a suspicion the |
Beta Was this translation helpful? Give feedback.
-
@SingleAccretion You're right. I switched to static method of static class and now I have could you share any tips to read such files? |
Beta Was this translation helpful? Give feedback.
-
Glad it worked in the end!
There is some useful information in the documentation. Personally, I find Notepad++ to be a good tool for reading the dumps, mainly due to fast search; syntax highlighting (C# one works well) is also useful. Beyond that, one is usually not "reading" the dump, but searching through it, either for specific phases ( |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I started to read runtime code for self-education, and I wonder if there is the unit tests for optimizations from morph.cpp? for example
// Fold "x * 1.0" to "x".
Probably I don't see something obvious, sorry for dumb question.
Beta Was this translation helpful? Give feedback.
All reactions