-
Notifications
You must be signed in to change notification settings - Fork 5.5k
JIT: bail on flipping post-layout JTRUE when reversal needs new IR #127746
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
Open
Copilot
wants to merge
6
commits into
main
Choose a base branch
from
copilot/fix-assertion-failure-jit
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
678b988
Initial plan
Copilot 07f7c2f
JIT: bail on flipping post-layout JTRUE when reversal needs new IR
Copilot fa6d907
Update gtReverseCond/gtTryReverseCond function headers to new style
Copilot fcf6910
Merge branch 'main' into copilot/fix-assertion-failure-jit
jakobbotsch b17798b
Merge branch 'main' into copilot/fix-assertion-failure-jit
jakobbotsch 2183a1e
Add JIT regression test for Runtime_127745 (optOptimizePostLayout LIR…
Copilot 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
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
99 changes: 99 additions & 0 deletions
99
src/tests/JIT/Regression/JitBlue/Runtime_127745/Runtime_127745.cs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| // Regression test: optOptimizePostLayout could assert "found use of a node that | ||
| // is not in the LIR sequence" on arm32 when LSRA inserted a RELOAD on top of | ||
| // a SETCC result under a JTRUE. gtReverseCond then returned a newly-allocated | ||
| // EQ(reload, 0) tree whose CNS_INT 0 child was never threaded into LIR. | ||
|
|
||
| namespace Runtime_127745; | ||
|
|
||
| using System; | ||
| using System.Runtime.CompilerServices; | ||
| using Xunit; | ||
|
|
||
| public class Runtime_127745 | ||
| { | ||
| public static IRuntime127745 s_rt; | ||
| public static short[][][] s_15; | ||
| public static uint[,] s_34; | ||
| public static byte[] s_53; | ||
| public static int s_62; | ||
| public static long[][] s_90; | ||
| public static int s_108; | ||
| public static int[] s_110; | ||
| public static long s_114; | ||
| public static ushort s_130; | ||
|
|
||
| [Fact] | ||
| public static void TestEntryPoint() | ||
| { | ||
| // Calling M96 forces the JIT to compile it. The regression was a | ||
| // compile-time assertion rather than wrong output. The static fields are | ||
| // all null, so execution throws NullReferenceException immediately. | ||
| try | ||
| { | ||
| RunM96(); | ||
| } | ||
| catch (NullReferenceException) | ||
| { | ||
| } | ||
| } | ||
|
|
||
| [MethodImpl(MethodImplOptions.NoInlining)] | ||
| static void RunM96() | ||
| { | ||
| M96(s_90); | ||
| } | ||
|
|
||
| [MethodImpl(MethodImplOptions.NoInlining)] | ||
| static ref byte M96(long[][] arg0) | ||
| { | ||
| byte lvar0 = default(byte); | ||
| do | ||
| { | ||
| s_rt.WriteLine("c_677", 0); | ||
| } | ||
| while (++lvar0 < 252); | ||
| try | ||
| { | ||
| var vr2 = new short[] { 1 }; | ||
| M100(ref arg0[0][0], ref arg0[0][0], vr2); | ||
| } | ||
| finally | ||
| { | ||
| arg0[0] = arg0[0]; | ||
| } | ||
|
|
||
| var vr1 = s_15[0][0][0]; | ||
| if ((1 <= s_114) | (0 > M97(vr1))) | ||
| { | ||
| arg0[0][0] >>= 1; | ||
| } | ||
| else | ||
| { | ||
| s_62 = s_110[0]; | ||
| } | ||
|
|
||
| s_rt.WriteLine("c_715", arg0[0][0]); | ||
| s_rt.WriteLine("c_716", s_108); | ||
| return ref s_53[0]; | ||
| } | ||
|
|
||
| [MethodImpl(MethodImplOptions.NoInlining)] | ||
| static ushort M97(short arg0) | ||
| { | ||
| bool vr0 = 0 > s_34[0, 0]; | ||
| return s_130; | ||
| } | ||
|
|
||
| [MethodImpl(MethodImplOptions.NoInlining)] | ||
| static void M100(ref long arg0, ref long arg1, short[] arg2) | ||
| { | ||
| } | ||
| } | ||
|
|
||
| public interface IRuntime127745 | ||
| { | ||
| void WriteLine<T>(string site, T value); | ||
| } |
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
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.
I think it is unlikely that this test reproduces the original problem. Fuzzlyn found that we need a collectible ALC for the test (that impacts our codegen for static access), and that's a bit of a pain to set up correctly in the regression tests. I would probably just skip the regression test and rely on the Fuzzlyn testing.
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.
sounds good, change LGTM, if you need another signoff after presumably removing the cs and csproj changes let me know