-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug fixes from dead code elimination (#69897)
* Track if unreachable blocks were detected squash: Update test case name * Unreachable one-by-one unreachable to squash * Add test cases * add test description * Check if there were any unreachable blocks * review feedback * jit format * Fix a case for isBBCallAlwaysPairTail for Arm
- Loading branch information
1 parent
308dedf
commit 54cf23c
Showing
5 changed files
with
139 additions
and
4 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
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> |