arm64: Fold negative variable eq/ne to 0#124332
Open
jonathandavies-arm wants to merge 5 commits intodotnet:mainfrom
Open
arm64: Fold negative variable eq/ne to 0#124332jonathandavies-arm wants to merge 5 commits intodotnet:mainfrom
jonathandavies-arm wants to merge 5 commits intodotnet:mainfrom
Conversation
i.e. Fold: (-(x)) == 0 -> x == 0
Contributor
Author
|
@dotnet/arm64-contrib |
Contributor
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
Member
|
@jonathandavies-arm, please check the test failures. |
| </Compile> | ||
| <CLRTestEnvironmentVariable Include="DOTNET_TieredCompilation" Value="0" /> | ||
| <CLRTestEnvironmentVariable Include="DOTNET_JITMinOpts" Value="0" /> | ||
| <CLRTestEnvironmentVariable Include="DOTNET_JitStressProcedureSplitting" Value="0" /> |
Contributor
There was a problem hiding this comment.
Is this needed? I think the default is 0
Contributor
|
Hi Jonathan, the change LGTM aside from the nits. |
- Moved comment on what tree we are matching on - Removed setting DOTNET_JitStressProcedureSplitting=0
This was referenced Mar 16, 2026
dhartglassMSFT
approved these changes
Mar 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
i.e. Fold: (-(x)) == 0 -> x == 0
arm64 asmdiffs
Diffs are based on 436,095 contexts (26,618 MinOpts, 409,477 FullOpts).
Overall (-40 bytes)
FullOpts (-40 bytes)
Example diffs
libraries_tests_no_tiered_compilation.run.linux.arm64.Release.mch
-4 (-1.27%) : 142473.dasm - System.IO.Pipelines.Tests.BufferSegmentPoolTest:GetSegments(System.IO.Pipelines.ReadResult):System.Collections.Generic.List`1[System.Buffers.ReadOnlySequenceSegment`1[byte]] (FullOpts)
-4 (-0.27%) : 162917.dasm - System.Memory.Tests.ReadOnlySequenceTryGetTests:Ctor_Memory():this (FullOpts)
-4 (-0.26%) : 162915.dasm - System.Memory.Tests.ReadOnlySequenceTryGetTests:Ctor_Memory_String():this (FullOpts)
+0 (0.00%) : 223365.dasm - System.Resources.Extensions.DeserializingResourceReader:CompareStringEqualsName(System.String):bool:this (FullOpts)
-4 (-0.02%) : 106573.dasm - System.Data.Tests.DataTableTest2:Select_ByFilter():this (FullOpts)
-4 (-0.16%) : 141855.dasm - System.IO.Pipelines.Tests.PipePoolTests:GetMemoryOverMaxPoolSizeAllocatesArray():this (FullOpts)
benchmarks.run.linux.arm64.checked.mch
+0 (0.00%) : 3177.dasm - System.Resources.ResourceReader:CompareStringEqualsName(System.String):bool:this (FullOpts)
smoke_tests.nativeaot.linux.arm64.checked.mch
+0 (0.00%) : 18583.dasm - Generics+TestAsyncGVMScenarios:RunAsync() (FullOpts)
No diffs found?
+0 (0.00%) : 18730.dasm - Generics+TestAsyncGVMScenarios:AsyncGvm1[System.__Canon]():this (FullOpts)
No diffs found?
+0 (0.00%) : 18865.dasm - Generics+TestAsyncGVMScenarios:AsyncGvm2[System.__Canon]():this (FullOpts)
No diffs found?
+0 (0.00%) : 18873.dasm - System.Threading.Tasks.Task:get_CompletedTask() (FullOpts)
No diffs found?
Details
Size improvements/regressions per collection
PerfScore improvements/regressions per collection
Context information
jit-analyze output
libraries_tests_no_tiered_compilation.run.linux.arm64.Release.mch
Detail diffs
benchmarks.run.linux.arm64.checked.mch
Detail diffs
x64 asmdiffs
Diffs are based on 2,787,549 contexts (1,078,277 MinOpts, 1,709,272 FullOpts).
Overall (-116 bytes)
MinOpts (-14 bytes)
FullOpts (-102 bytes)
Example diffs
coreclr_tests.run.linux.x64.checked.mch
-8 (-29.63%) : 199901.dasm - TestNeg.Program:NegsBinOpSingleLine(int,int):bool (FullOpts)
-7 (-29.17%) : 199894.dasm - TestNeg.Program:NegsLSR(uint):int (FullOpts)
-7 (-29.17%) : 199896.dasm - TestNeg.Program:NegsLargeShift(uint):int (FullOpts)
-5 (-1.71%) : 531325.dasm - ILGEN_CLASS:ILGEN_METHOD(bool,char,short,int):char (Tier0)
-2 (-4.17%) : 181410.dasm - ldc_neg_i4._neg:i4_3(int,int):int (MinOpts)
-3 (-5.77%) : 181421.dasm - ldc_neg_i8._neg:i8_3(long,long):int (MinOpts)
libraries_tests_no_tiered_compilation.run.linux.x64.Release.mch
-2 (-0.01%) : 124444.dasm - System.Data.Tests.DataTableTest2:Select_ByFilter():this (FullOpts)
libraries_tests.run.linux.x64.Release.mch
-4 (-0.03%) : 314396.dasm - System.Data.Tests.DataTableTest2:Select_ByFilter():this (Instrumented Tier0)
Details
Size improvements/regressions per collection
PerfScore improvements/regressions per collection
Context information
jit-analyze output