-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Bug fixes from dead code elimination #69897
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
401e822
Track if unreachable blocks were detected
kunalspathak b231919
Unreachable one-by-one
kunalspathak 37955fe
Add test cases
kunalspathak 2dc4c51
add test description
kunalspathak 4d2857e
Check if there were any unreachable blocks
kunalspathak 2b1fe08
review feedback
kunalspathak 223b8e1
jit format
kunalspathak dbccb51
Fix a case for isBBCallAlwaysPairTail for Arm
kunalspathak File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
35 changes: 35 additions & 0 deletions
35
src/tests/JIT/Regression/JitBlue/GitHub_69659/GitHub_69659_1.cs
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,35 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// | ||
// In this issue, although we were not removing an unreachable block, we were removing all the code | ||
// inside it and as such should update the liveness information. Since we were not updating the liveness | ||
// information for such scenarios, we were hitting an assert during register allocation. | ||
public class Program | ||
{ | ||
public static ulong[] s_14; | ||
public static uint s_34; | ||
public static int Main() | ||
{ | ||
var vr2 = new ulong[][]{new ulong[]{0}}; | ||
M27(s_34, vr2); | ||
return 100; | ||
} | ||
|
||
public static void M27(uint arg4, ulong[][] arg5) | ||
{ | ||
arg5[0][0] = arg5[0][0]; | ||
for (int var7 = 0; var7 < 1; var7++) | ||
{ | ||
return; | ||
} | ||
|
||
try | ||
{ | ||
s_14 = arg5[0]; | ||
} | ||
finally | ||
{ | ||
arg4 = arg4; | ||
} | ||
} | ||
} | ||
13 changes: 13 additions & 0 deletions
13
src/tests/JIT/Regression/JitBlue/GitHub_69659/GitHub_69659_1.csproj
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,13 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<DebugType>PdbOnly</DebugType> | ||
<Optimize>True</Optimize> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="$(MSBuildProjectName).cs" /> | ||
</ItemGroup> | ||
</Project> |
46 changes: 46 additions & 0 deletions
46
src/tests/JIT/Regression/JitBlue/GitHub_69659/GitHub_69659_2.cs
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,46 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// | ||
// In this issue, we were not removing all the unreachable blocks and that led us to expect that | ||
// there should be an IG label for one of the unreachable block, but we were not creating it leading | ||
// to an assert failure. | ||
public class _65659_2 | ||
{ | ||
public static bool[][,] s_2; | ||
public static short[,][] s_8; | ||
public static bool[] s_10; | ||
public static ushort[][] s_29; | ||
public static int Main() | ||
{ | ||
bool vr1 = M47(); | ||
return 100; | ||
} | ||
|
||
public static bool M47() | ||
{ | ||
bool var0 = default(bool); | ||
try | ||
{ | ||
if (var0) | ||
{ | ||
try | ||
{ | ||
if (s_10[0]) | ||
{ | ||
return s_2[0][0, 0]; | ||
} | ||
} | ||
finally | ||
{ | ||
s_8[0, 0][0] = 0; | ||
} | ||
} | ||
} | ||
finally | ||
{ | ||
s_29 = s_29; | ||
} | ||
|
||
return true; | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/tests/JIT/Regression/JitBlue/GitHub_69659/GitHub_69659_2.csproj
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,13 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<DebugType>PdbOnly</DebugType> | ||
<Optimize>True</Optimize> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="$(MSBuildProjectName).cs" /> | ||
</ItemGroup> | ||
</Project> |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the late review, but GitHub_XYZ refers to the dotnet/coreclr repo, so this should have been named Runtime_69659. Also it would be nice to name the class something like
Runtime_69659
, it makes it easier to track the test down on failures.It seems there are a few tests incorrectly filed under GitHub_XYZ tag, so maybe something to consider cleaning up as part of a future change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, didn't realize that. I named them
_1
and_2
because there were 2 separate issues that were filed in #69659. I think I forgot to have the right class name in one of those files.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah sorry,
Runtime_69569_1
etc. sounds right then.