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

JIT: enable cross-block local assertion prop #94689

Merged
merged 8 commits into from
Nov 28, 2023

Conversation

AndyAyersMS
Copy link
Member

@AndyAyersMS AndyAyersMS commented Nov 14, 2023

Enable cross-block assertion prop by default.

@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 Nov 14, 2023
@ghost ghost assigned AndyAyersMS Nov 14, 2023
@ghost
Copy link

ghost commented Nov 14, 2023

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

Issue Details

null

Author: AndyAyersMS
Assignees: AndyAyersMS
Labels:

area-CodeGen-coreclr

Milestone: -

@AndyAyersMS
Copy link
Member Author

The failures above are for the release-mode debug info testing. With cross-block we remove the store at IL offset 0 and this causes the validation to fail.

Going to just add another exemption here... I'm surprised something downstream doesn't catch this already (basically x + 0 => x), but without an immediate zero.

@AndyAyersMS
Copy link
Member Author

Looks like a bug has crept in, possibly from the JTRUE assertions.

@AndyAyersMS
Copy link
Member Author

Latest diffs.

@AndyAyersMS
Copy link
Member Author

/azp run runtime-jit-experimental, runtime-coreclr jitstress, runtime-coreclr libraries-jitstress, runtime-coreclr outerloop

Copy link

Azure Pipelines successfully started running 4 pipeline(s).

@AndyAyersMS
Copy link
Member Author

jit-experimental failure was that the fgEntryBB was getting emtpy-merged, in cases where other flow optimizations more or less remove all the other blocks save one, and so fgBBcount was off by one going into morph. This currently can only happen with OSR stress.

@AndyAyersMS AndyAyersMS marked this pull request as ready for review November 28, 2023 15:38
@AndyAyersMS
Copy link
Member Author

FYI @dotnet/jit-contrib

Latest diffs. Main impact here is a code size improvement; TP results are mixed but "average" out to about zero.

@jakobbotsch
Copy link
Member

/azp run Fuzzlyn

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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, very nice to see this enabled. I kicked off a Fuzzlyn run with it enabled.

@AndyAyersMS
Copy link
Member Author

I have perf lab data too but so far it's indistinguishable from noise; I almost suspect the feature is not getting enabled,

@jakobbotsch
Copy link
Member

The Fuzzlyn runs will hit #95318 so we'll probably have to do a bit digging to see if there is anything else.

@AndyAyersMS
Copy link
Member Author

The Fuzzlyn runs will hit #95318 so we'll probably have to do a bit digging to see if there is anything else.

I only see the unexpected small type asserts.

@jakobbotsch
Copy link
Member

The Fuzzlyn runs will hit #95318 so we'll probably have to do a bit digging to see if there is anything else.

I only see the unexpected small type asserts.

The number of examples found does not match up with the number of those assertion occurrences... But I'm not totally sure whether those counts are accurate or not given the number of examples found.

@jakobbotsch
Copy link
Member

#95249 was merged now so I'm going to rerun Fuzzlyn to be sure.

@jakobbotsch
Copy link
Member

/azp run Fuzzlyn

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@AndyAyersMS
Copy link
Member Author

Do those runs merge up or do we need a new merge from main?

@jakobbotsch
Copy link
Member

Do those runs merge up or do we need a new merge from main?

It merges, the run is happening on 4cd4b07 that has @EgorBo's commit.

@AndyAyersMS
Copy link
Member Author

#95249 was merged now so I'm going to rerun Fuzzlyn to be sure.

All good.

@AndyAyersMS AndyAyersMS merged commit 5092ce8 into dotnet:main Nov 28, 2023
161 checks passed
@AndyAyersMS
Copy link
Member Author

Collated set of improvements (lower is better) as of 12-12-23. 134 benchmarks improved.

Notes Recent Score Orig Score arm64
Ubuntu
arm64
Windows
intel x64
Ubuntu
intel x64
amd x64
Windows
Benchmark
1.00 0.93 1.00
0.93
System.Linq.Tests.Perf_Enumerable.LastWithPredicate_FirstElementMatches(input: IOrderedEnumerable)
1.00 0.90 1.00
0.90
System.Linq.Tests.Perf_Enumerable.WhereSingle_LastElementMatches(input: Array)
0.98 0.93 0.98
0.93
System.Collections.IterateForEach(Int32).ImmutableDictionary(Size: 512)
0.97 0.93 0.97
0.93
System.Text.RegularExpressions.Tests.Perf_Regex_Industry_RustLang_Sherlock.Count(Pattern: "Holmes.{0,25}Watson
0.96 0.93 0.96
0.93
System.Collections.IterateForEach(Int32).SortedDictionary(Size: 512)
0.95 0.91 0.95
0.91
System.Collections.Tests.Perf_PriorityQueue(Int32, Int32).HeapSort(Size: 100)
0.95 0.94 0.95
0.94
System.Collections.Tests.Perf_BitArray.BitArrayByteArrayCtor(Size: 512)
0.94 0.95 0.94
0.95
System.MathBenchmarks.Single.SinCosPi
0.94 0.94 0.95
0.94
0.93
0.94
System.Collections.Tests.Perf_BitArray.BitArrayCopyToByteArray(Size: 512)
0.94 0.93 0.94
0.93
System.Memory.ReadOnlySequence.Slice_Repeat(Segment: Multiple)
0.94 0.94 0.94
0.94
System.Linq.Tests.Perf_Enumerable.SkipHalfTakeHalf(input: IEnumerable)
0.94 0.94 0.94
0.94
System.Linq.Tests.Perf_Enumerable.SelectToList(input: IEnumerable)
0.94 0.94 0.94
0.94
System.Collections.ContainsFalse(Int32).Span(Size: 512)
0.94 0.92 0.94
0.92
System.Collections.Tests.Perf_PriorityQueue(Int32, Int32).HeapSort(Size: 1000)
0.94 0.93 0.94
0.93
System.Collections.Perf_Frozen(ReferenceType).Contains_True(Count: 64)
0.93 0.95 0.93
0.95
System.Linq.Tests.Perf_Enumerable.Reverse(input: IEnumerable)
0.93 0.92 0.93
0.92
System.Linq.Tests.Perf_Enumerable.WhereAny_LastElementMatches(input: List)
0.93 0.94 0.93
0.94
System.Buffers.Tests.SearchValuesCharTests.LastIndexOfAny(Values: "abcdefABCDEF0123456789")
0.93 0.93 0.93
0.93
0.93
0.93
ByteMark.BenchIDEAEncryption
0.93 0.93 0.93
0.93
System.Linq.Tests.Perf_Enumerable.SingleWithPredicate_LastElementMatches(input: Array)
0.93 0.93 0.93
0.93
System.Collections.ContainsFalse(Int32).ImmutableSortedSet(Size: 512)
0.93 0.93 0.93
0.93
System.Linq.Tests.Perf_Enumerable.Select(input: List)
0.92 0.89 0.94
0.88
0.91
0.91
System.Text.Tests.Perf_Encoding.GetChars(size: 16, encName: "ascii")
0.92 0.93 0.92
0.93
System.Text.RegularExpressions.Tests.Perf_Regex_Common.IP_IsNotMatch(Options: IgnoreCase, Compiled)
0.92 0.92 0.90
0.91
0.94
0.94
System.Collections.IterateForEach(Int32).ImmutableList(Size: 512)
0.92 0.92 0.92
0.92
System.Buffers.Tests.ReadOnlySequenceTests(Char).IterateGetPositionMemory
0.92 0.93 0.92
0.93
System.Text.Encodings.Web.Tests.Perf_Encoders.EncodeUtf8(arguments: UnsafeRelaxed,hello "there",512)
0.92 0.92 0.92
0.92
System.Collections.Sort(IntStruct).LinqOrderByExtension(Size: 512)
0.92 0.91 0.89
0.89
0.94
0.94
System.Collections.Perf_LengthBucketsFrozenDictionary.TryGetValue_True_FrozenDictionary(Count: 100, ItemsPerBucket: 1)
0.92 0.92 0.92
0.92
System.Text.RegularExpressions.Tests.Perf_Regex_Common.IP_IsMatch(Options: Compiled)
0.91 0.91 0.91
0.91
System.Linq.Tests.Perf_Enumerable.Select(input: Array)
0.91 0.87 0.91
0.87
System.Buffers.Tests.SearchValuesCharTests.IndexOfAny(Values: "abcdefABCDEF0123456789Ü")
0.91 0.91 0.91
0.90
0.92
0.93
System.Text.Encodings.Web.Tests.Perf_Encoders.EncodeUtf8(arguments: UnsafeRelaxed,hello "there",16)
0.91 0.91 0.91
0.91
System.Linq.Tests.Perf_OrderBy.OrderByCustomComparer(NumberOfPeople: 512)
0.91 0.91 0.91
0.91
System.Numerics.Tests.Perf_BitOperations.Log2_ulong
0.91 0.90 0.91
0.90
System.Collections.Tests.Perf_PriorityQueue(Guid, Guid).Dequeue_And_Enqueue(Size: 100)
0.91 0.91 0.91
0.91
System.Collections.Sort(IntStruct).LinqQuery(Size: 512)
0.91 0.91 0.91
0.91
System.Linq.Tests.Perf_Enumerable.WhereLast_LastElementMatches(input: Array)
0.90 0.88 0.90
0.88
System.Text.Encodings.Web.Tests.Perf_Encoders.EncodeUtf8(arguments: JavaScript,&Hello+(World)!,512)
0.90 0.87 0.92
0.90
0.88
0.85
System.Text.Encodings.Web.Tests.Perf_Encoders.EncodeUtf8(arguments: JavaScript,&Hello+(World)!,16)
0.90 0.86 0.90
0.86
System.Collections.Perf_LengthBucketsFrozenDictionary.ToFrozenDictionary(Count: 10000, ItemsPerBucket: 1)
0.90 0.90 0.90
0.90
System.Linq.Tests.Perf_Enumerable.FirstWithPredicate_LastElementMatches(input: Array)
0.90 0.91 0.90
0.91
PerfLabTests.DelegatePerf.MulticastDelegateCombineInvoke
0.90 0.90 0.90
0.90
System.Linq.Tests.Perf_Enumerable.Concat_Once(input: IEnumerable)
0.90 0.74 0.81
0.83
0.80
0.80
1.12
0.60
System.Collections.Sort(IntStruct).List(Size: 512)
0.90 0.89 0.90
0.89
System.Collections.Perf_LengthBucketsFrozenDictionary.TryGetValue_True_FrozenDictionary(Count: 1000, ItemsPerBucket: 1)
0.89 0.86 0.89
0.86
System.Collections.TryGetValueTrue(Int32, Int32).ImmutableSortedDictionary(Size: 512)
0.89 0.91 0.89
0.91
System.Text.RegularExpressions.Tests.Perf_Regex_Industry_BoostDocs_Simple.IsMatch(Id: 11, Options: Compiled)
0.89 0.90 0.89
0.90
System.Collections.Tests.Perf_PriorityQueue(Int32, Int32).K_Max_Elements(Size: 1000)
0.88 0.89 0.88
0.89
BenchmarksGame.ReverseComplement_1.RunBench
0.88 0.89 0.88
0.89
System.Globalization.Tests.StringSearch.IsPrefix_FirstHalf(Options: (en-US, IgnoreNonSpace, False))
0.88 0.82 0.88
0.82
System.Linq.Tests.Perf_Enumerable.EmptyTakeSelectToArray
0.88 0.91 0.88
0.91
System.Threading.Tests.Perf_CancellationToken.RegisterAndUnregister_Serial
0.88 0.88 0.88
0.86
0.88
0.90
System.Linq.Tests.Perf_Enumerable.ElementAt(input: IEnumerable)
0.88 0.92 0.91
0.93
0.85
0.91
MicroBenchmarks.Serializers.Xml_ToStream(IndexViewModel).XmlSerializer_
0.88 0.88 0.88
0.88
System.Globalization.Tests.StringSearch.IsPrefix_FirstHalf(Options: (, IgnoreCase, False))
0.88 0.88 0.88
0.88
System.Globalization.Tests.StringSearch.IsPrefix_FirstHalf(Options: (en-US, IgnoreCase, False))
0.88 0.88 0.88
0.88
System.Globalization.Tests.StringSearch.IsPrefix_FirstHalf(Options: (en-US, None, False))
0.88 0.88 0.88
0.88
System.Buffers.Tests.ReadOnlySequenceTests(Byte).IterateGetPositionTenSegments
0.88 0.88 0.88
0.88
System.Globalization.Tests.StringSearch.IsPrefix_FirstHalf(Options: (, None, False))
0.88 0.88 0.88
0.88
0.88
0.88
ByteMark.BenchAssignJagged
0.88 0.88 0.88
0.88
System.Linq.Tests.Perf_Enumerable.Skip_One(input: IEnumerable)
0.88 0.86 0.83
0.89
1.01
0.88
0.81
0.81
System.Linq.Tests.Perf_Enumerable.Contains_ElementNotFound(input: ICollection)
0.88 0.88 0.88
0.88
System.Linq.Tests.Perf_Enumerable.ToList(input: IEnumerable)
0.87 0.87 0.87
0.87
System.Net.Primitives.Tests.IPAddressPerformanceTests.TryFormat(address: 143.24.20.36)
0.87 0.88 0.87
0.88
System.Collections.IterateForEachNonGeneric(Int32).SortedList(Size: 512)
0.86 0.85 0.88
0.84
0.85
0.87
System.Text.Encodings.Web.Tests.Perf_Encoders.EncodeUtf8(arguments: Url,&lorem ipsum=dolor sit amet,512)
0.86 0.85 0.86
0.85
System.Collections.AddGivenSize(String).Queue(Size: 512)
0.86 0.87 0.86
0.87
System.Buffers.Tests.SearchValuesByteTests.IndexOfAnyExcept(Values: "abcdefABCDEF0123456789Ü")
0.85 0.85 0.85
0.85
Benchstone.MDBenchI.MDLogicArray.Test
0.85 0.85 0.85
0.85
System.Numerics.Tests.Perf_BigInteger.Parse(numberString: 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012
0.84 0.84 0.77
0.76
0.92
0.93
System.Tests.Perf_Random.ctor_seeded
0.84 0.84 0.84
0.84
System.Collections.TryGetValueFalse(Int32, Int32).ImmutableSortedDictionary(Size: 512)
0.84 0.72 0.84
0.72
System.Collections.Perf_Frozen(NotKnownComparable).TryGetValue_True(Count: 512)
0.84 0.88 0.84
0.88
System.Memory.ReadOnlySequence.Slice_Repeat_StartPosition_And_EndPosition(Segment: Multiple)
0.84 0.83 0.76
0.75
0.92
0.92
System.Linq.Tests.Perf_Enumerable.LastWithPredicate_FirstElementMatches(input: IEnumerable)
0.84 0.84 0.84
0.84
System.Collections.IterateForEach(Int32).SortedList(Size: 512)
0.84 0.86 0.84
0.86
System.Buffers.Tests.ReadOnlySequenceTests(Char).IterateGetPositionSingleSegment
0.83 0.83 0.83
0.83
System.Numerics.Tests.Perf_BitOperations.PopCount_uint
0.83 0.83 0.83
0.83
System.Collections.IterateForEachNonGeneric(String).SortedList(Size: 512)
0.82 0.83 0.82
0.83
System.Collections.Sort(BigStruct).Array_ComparerClass(Size: 512)
0.82 0.82 0.82
0.82
System.Linq.Tests.Perf_Enumerable.SingleWithPredicate_LastElementMatches(input: List)
0.82 0.81 0.82
0.81
System.Numerics.Tests.Perf_BigInteger.Parse(numberString: -2147483648)
0.82 0.86 0.82
0.86
System.Memory.ReadOnlySequence.Slice_StartPosition_And_EndPosition(Segment: Multiple)
0.82 0.80 0.88
0.85
0.76
0.76
System.Text.Tests.Perf_Encoding.GetByteCount(size: 16, encName: "ascii")
0.81 0.79 0.81
0.79
System.Buffers.Tests.ReadOnlySequenceTests(Byte).IterateGetPositionArray
0.81 0.80 0.82
0.81
0.80
0.80
System.Text.Encodings.Web.Tests.Perf_Encoders.EncodeUtf8(arguments: Url,&lorem ipsum=dolor sit amet,16)
0.81 0.82 0.84
0.86
0.78
0.78
System.Buffers.Tests.SearchValuesCharTests.LastIndexOfAny(Values: "ßäöüÄÖÜ")
0.81 0.81 0.81
0.81
System.Globalization.Tests.StringEquality.Compare_DifferentFirstChar(Count: 1024, Options: (en-US, OrdinalIgnoreCase))
0.80 0.79 0.82
0.79
0.79
0.79
Interop.StructureToPtr.MarshalPtrToStructure
0.80 0.80 0.80
0.80
System.Buffers.Tests.ReadOnlySequenceTests(Byte).IterateGetPositionSingleSegment
0.80 0.82 0.80
0.82
System.Text.RegularExpressions.Tests.Perf_Regex_Industry_RustLang_Sherlock.Count(Pattern: "aei", Options: None)
0.80 0.80 0.80
0.80
System.Buffers.Tests.SearchValuesCharTests.IndexOfAnyExcept(Values: "abcdefABCDEF0123456789")
0.80 0.79 0.80
0.79
System.Text.RegularExpressions.Tests.Perf_Regex_Industry_RustLang_Sherlock.Count(Pattern: "aei", Options: NonBacktracking)
0.80 0.78 0.83
0.79
0.76
0.77
Interop.StructureToPtr.MarshalDestroyStructure
0.79 0.79 0.83
0.82
0.76
0.77
System.Text.Tests.Perf_Encoding.GetByteCount(size: 512, encName: "ascii")
0.79 0.79 0.72
0.73
0.87
0.86
System.Collections.IndexerSetReverse(String).List(Size: 512)
0.79 0.83 0.80
0.82
0.78
0.84
System.Collections.Sort(IntStruct).Array(Size: 512)
0.78 0.82 0.78
0.82
System.Collections.Sort(IntStruct).Array_ComparerClass(Size: 512)
0.78 0.90 0.78
0.90
System.Linq.Tests.Perf_Enumerable.Sum(input: IEnumerable)
0.78 0.78 0.78
0.78
System.Text.RegularExpressions.Tests.Perf_Regex_Industry_RustLang_Sherlock.Count(Pattern: "The", Options: Compiled)
0.77 0.86 0.77
0.86
System.Linq.Tests.Perf_Enumerable.Count(input: IEnumerable)
0.77 0.78 0.77
0.78
System.Linq.Tests.Perf_Enumerable.Max(input: IEnumerable)
0.77 0.89 0.77
0.89
System.Linq.Tests.Perf_Enumerable.Average(input: IEnumerable)
0.77 0.74 0.77
0.74
System.Memory.ReadOnlySequence.Slice_Start(Segment: Multiple)
0.77 0.77 0.77
0.77
System.Collections.ContainsTrue(Int32).SortedSet(Size: 512)
0.77 0.77 0.89
0.89
0.90
0.89
0.57
0.57
System.Linq.Tests.Perf_Enumerable.SingleWithPredicate_FirstElementMatches(input: IEnumerable)
0.77 0.80 0.77
0.80
System.Collections.Sort(IntStruct).Array_Comparison(Size: 512)
0.77 0.81 0.77
0.81
System.Collections.Sort(BigStruct).Array_Comparison(Size: 512)
0.76 0.76 0.76
0.76
System.Collections.ContainsTrueComparer(Int32).SortedSet(Size: 512)
0.75 0.75 0.75
0.75
System.Linq.Tests.Perf_Enumerable.AnyWithPredicate_LastElementMatches(input: IEnumerable)
0.75 0.75 0.74
0.75
0.75
0.76
System.Buffers.Tests.ReadOnlySequenceTests(Char).FirstSpanSingleSegment
0.75 0.74 0.62
0.62
0.89
0.89
System.Collections.IterateForEachNonGeneric(Int32).ArrayList(Size: 512)
0.75 0.74 0.75
0.74
System.Text.RegularExpressions.Tests.Perf_Regex_Industry_RustLang_Sherlock.Count(Pattern: "aqj", Options: None)
0.74 0.73 0.74
0.73
System.Linq.Tests.Perf_Enumerable.SequenceEqual(input1: IEnumerable, input2: IEnumerable)
0.73 0.73 0.68
0.69
0.78
0.78
System.Collections.IterateForEachNonGeneric(Int32).Queue(Size: 512)
0.73 0.73 0.73
0.73
System.Text.RegularExpressions.Tests.Perf_Regex_Industry_RustLang_Sherlock.Count(Pattern: "(?m)^Sherlock Holmes
0.73 0.89 0.73
0.89
System.Collections.Perf_Frozen(NotKnownComparable).TryGetValue_True(Count: 64)
0.73 0.72 0.72
0.72
0.73
0.73
System.Buffers.Tests.ReadOnlySequenceTests(Char).FirstSpanTenSegments
0.70 0.71 0.64
0.65
0.78
0.78
System.Buffers.Tests.ReadOnlySequenceTests(Byte).FirstSingleSegment
0.69 0.69 0.69
0.69
System.Buffers.Tests.ReadOnlySequenceTests(Byte).FirstSpanTenSegments
0.68 0.68 0.68
0.68
System.Collections.IterateForEachNonGeneric(String).Queue(Size: 512)
0.68 0.63 0.68
0.63
System.Memory.Span(Int32).Reverse(Size: 512)
0.66 0.66 0.66
0.66
System.Globalization.Tests.StringEquality.Compare_Same_Upper(Count: 1024, Options: (en-US, OrdinalIgnoreCase))
0.65 0.65 0.65
0.65
System.Buffers.Tests.ReadOnlySequenceTests(Byte).FirstSpanSingleSegment
0.63 0.63 0.63
0.63
System.Buffers.Tests.ReadOnlySequenceTests(Char).FirstSingleSegment
0.63 0.63 0.63
0.63
System.Collections.IterateFor(Int32).IList(Size: 512)
0.63 0.64 0.81
0.80
0.49
0.51
Interop.StructureToPtr.MarshalStructureToPtr
0.62 0.63 0.62
0.63
System.Text.RegularExpressions.Tests.Perf_Regex_Industry_Leipzig.Count(Pattern: "\p{Sm}", Options: NonBacktracking)
0.62 0.62 0.58
0.58
0.67
0.66
System.Buffers.Tests.ReadOnlySequenceTests(Byte).FirstTenSegments
0.62 0.62 0.56
0.56
0.69
0.69
System.Buffers.Tests.ReadOnlySequenceTests(Char).FirstTenSegments
0.62 0.62 0.62
0.62
System.Collections.IterateForEachNonGeneric(String).ArrayList(Size: 512)
0.60 0.60 0.77
0.79
0.46
0.46
System.Linq.Tests.Perf_Enumerable.Contains_ElementNotFound(input: IEnumerable)
0.59 0.59 0.75
0.75
0.46
0.46
System.Linq.Tests.Perf_Enumerable.CastToSameType(input: IEnumerable)
0.51 0.51 0.51
0.51
System.Linq.Tests.Perf_Enumerable.SingleWithPredicate_LastElementMatches(input: IEnumerable)

@github-actions github-actions bot locked and limited conversation to collaborators Jan 12, 2024
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.

3 participants