-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
JIT: Evaluate GDV call args early #75634
Merged
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
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
63 changes: 63 additions & 0 deletions
63
src/tests/JIT/Regression/JitBlue/Runtime_75607/Runtime_75607.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,63 @@ | ||
using System; | ||
using System.Runtime.CompilerServices; | ||
using System.Threading; | ||
|
||
public class Program | ||
{ | ||
private static int s_result; | ||
public static int Main() | ||
{ | ||
C c = new(); | ||
for (int i = 0; i < 100; i++) | ||
{ | ||
Foo(c); | ||
Thread.Sleep(15); | ||
} | ||
|
||
s_result = -1; | ||
try | ||
{ | ||
Foo(null); | ||
Console.WriteLine("FAIL: No exception thrown"); | ||
return -2; | ||
} | ||
catch (NullReferenceException) | ||
{ | ||
if (s_result == 100) | ||
{ | ||
Console.WriteLine("PASS"); | ||
} | ||
else | ||
{ | ||
Console.WriteLine("FAIL: Result is {0}", s_result); | ||
} | ||
|
||
return s_result; | ||
} | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
private static void Foo(Base b) | ||
{ | ||
b.Test(SideEffect(10)); | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
private static long SideEffect(long i) | ||
{ | ||
s_result = 100; | ||
return i; | ||
} | ||
} | ||
|
||
public interface Base | ||
{ | ||
void Test(long arg); | ||
} | ||
|
||
public class C : Base | ||
{ | ||
public void Test(long arg) | ||
{ | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/tests/JIT/Regression/JitBlue/Runtime_75607/Runtime_75607.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,24 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<DebugType>None</DebugType> | ||
<Optimize>True</Optimize> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<CLRTestBatchPreCommands><![CDATA[ | ||
$(CLRTestBatchPreCommands) | ||
set COMPlus_TieredPGO=1 | ||
set COMPlus_TC_QuickJitForLoops=1 | ||
]]></CLRTestBatchPreCommands> | ||
<BashCLRTestPreCommands><![CDATA[ | ||
$(BashCLRTestPreCommands) | ||
export COMPlus_TieredPGO=1 | ||
export COMPlus_TC_QuickJitForLoops=1 | ||
]]></BashCLRTestPreCommands> | ||
</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.
This isn't sufficient. We also have to spill all args with
GTF_GLOB_REF
before we spill these. Unfortunately I don't thinkGTF_GLOB_REF
is accurate at this point.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.
((argNode->gtFlags & GTF_GLOB_REF) != 0) || gtHasLocalsWithAddrOp(argNode)
?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.
Yeah, unfortunately I suppose that's going to be on the expensive side TP and CQ wise, but I'll try it out.