JIT: Improve codegen around unsigned comparisons#105593
Conversation
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
|
In |
Changes like these always produce a few regressions. In this case the problem that VN version of IsNeverNegative currently is not able to recognize Span.Length. It's something I want to fix one day |
|
an unrelated quick test: @EgorBot -amd -arm64 -profiler using System.Text.Json;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
public class MyBench
{
public static IEnumerable<MyObj[]> TestData()
{
MyObj[] testData = new MyObj[100];
for (int i = 0; i < testData.Length; i++)
{
MyObj obj1 = new("Some long ASCII text bla bla bla", 42, Guid.NewGuid(), DateTime.Now, null);
MyObj obj2 = new("Какой-то non-ASCII text", i, Guid.NewGuid(), DateTime.Now, obj1);
testData[i] = obj2;
}
yield return testData;
}
[Benchmark]
[ArgumentsSource(nameof(TestData))]
public object JsonStatham(MyObj[] arrays) => JsonSerializer.Serialize(arrays);
}
public record MyObj(string Name, int Age, Guid Id, DateTime Time, MyObj? InnerObj); |
Benchmark results on Amd
Flame graphs: Main vs PR 🔥 For clean |
Benchmark results on Arm64
Flame graphs: Main vs PR 🔥 For clean |
|
PTAL @AndyAyersMS @BruceForstall @dotnet/jit-contrib TLDR: if we have PS: Will approved the PR (before the snap) but the approval is no longer green 😐 |
Diffs
Motivated by #104728 (comment)