-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix some issues with null check handling (#84523)
* Fix some issues with null check handling Code assumed that, given a non-null address, it must have no side effects. This is not correct. Fix by centralizing the logic for no-op null check removal in morph instead of spreading it over to places that create null checks. This is both a CQ and TP win. * Add a test * Fix early prop bug
- Loading branch information
1 parent
966d36a
commit 2032a59
Showing
10 changed files
with
106 additions
and
62 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
52 changes: 52 additions & 0 deletions
52
src/tests/JIT/Regression/JitBlue/Runtime_84522/Runtime_84522.il
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
.assembly extern System.Runtime { } | ||
.assembly extern xunit.core { } | ||
.assembly Runtime_84522 { } | ||
|
||
.class sealed StructWithInt extends [System.Runtime]System.ValueType | ||
{ | ||
.field public int32 Value | ||
} | ||
|
||
.class Runtime_84522 extends [System.Runtime]System.Object | ||
{ | ||
.method public static int32 Main() | ||
{ | ||
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( | ||
01 00 00 00 | ||
) | ||
.entrypoint | ||
|
||
.try | ||
{ | ||
ldc.i4 0 | ||
newarr StructWithInt | ||
call void .this::UnusedLdelem(valuetype StructWithInt[]) | ||
leave FAIL | ||
} | ||
catch [System.Runtime]System.IndexOutOfRangeException | ||
{ | ||
pop | ||
leave SUCCESS | ||
} | ||
|
||
FAIL: | ||
ldc.i4 0 | ||
ret | ||
|
||
SUCCESS: | ||
ldc.i4 100 | ||
ret | ||
} | ||
|
||
.method private static void UnusedLdelem(valuetype StructWithInt[] arr) noinlining | ||
{ | ||
ldarg arr | ||
ldc.i4 0 | ||
ldelem valuetype StructWithInt | ||
pop | ||
ret | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
src/tests/JIT/Regression/JitBlue/Runtime_84522/Runtime_84522.ilproj
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.IL"> | ||
<PropertyGroup> | ||
<DebugType>None</DebugType> | ||
<Optimize>True</Optimize> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="$(MSBuildProjectName).il" /> | ||
</ItemGroup> | ||
</Project> |