Skip to content
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

Fix optimization of action methods for coreclr #1935

Merged
merged 1 commit into from
Mar 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 62 additions & 2 deletions src/BenchmarkDotNet/Templates/BenchmarkType.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@

private BenchmarkDotNet.Engines.Consumer consumer = new BenchmarkDotNet.Engines.Consumer();

#if NETCOREAPP3_0_OR_GREATER
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveOptimization)]
#endif
private void OverheadActionUnroll(System.Int64 invokeCount)
{
$LoadArguments$
Expand All @@ -122,6 +125,9 @@
}
}

#if NETCOREAPP3_0_OR_GREATER
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveOptimization)]
#endif
private void OverheadActionNoUnroll(System.Int64 invokeCount)
{
$LoadArguments$
Expand All @@ -131,6 +137,9 @@
}
}

#if NETCOREAPP3_0_OR_GREATER
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveOptimization)]
#endif
private void WorkloadActionUnroll(System.Int64 invokeCount)
{
$LoadArguments$
Expand All @@ -140,6 +149,9 @@
}
}

#if NETCOREAPP3_0_OR_GREATER
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveOptimization)]
#endif
private void WorkloadActionNoUnroll(System.Int64 invokeCount)
{
$LoadArguments$
Expand All @@ -163,6 +175,9 @@

#elif RETURNS_NON_CONSUMABLE_STRUCT_$ID$

#if NETCOREAPP3_0_OR_GREATER
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveOptimization)]
#endif
private void OverheadActionUnroll(System.Int64 invokeCount)
{
$LoadArguments$
Expand All @@ -174,6 +189,9 @@
BenchmarkDotNet.Engines.DeadCodeEliminationHelper.KeepAliveWithoutBoxing(result);
}

#if NETCOREAPP3_0_OR_GREATER
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveOptimization)]
#endif
private void OverheadActionNoUnroll(System.Int64 invokeCount)
{
$LoadArguments$
Expand All @@ -185,6 +203,9 @@
BenchmarkDotNet.Engines.DeadCodeEliminationHelper.KeepAliveWithoutBoxing(result);
}

#if NETCOREAPP3_0_OR_GREATER
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveOptimization)]
#endif
private void WorkloadActionUnroll(System.Int64 invokeCount)
{
$LoadArguments$
Expand All @@ -196,6 +217,9 @@
NonGenericKeepAliveWithoutBoxing(result);
}

#if NETCOREAPP3_0_OR_GREATER
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveOptimization)]
#endif
private void WorkloadActionNoUnroll(System.Int64 invokeCount)
{
$LoadArguments$
Expand Down Expand Up @@ -226,6 +250,9 @@

#elif RETURNS_BYREF_$ID$

#if NETCOREAPP3_0_OR_GREATER
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveOptimization)]
#endif
private void OverheadActionUnroll(System.Int64 invokeCount)
{
$LoadArguments$
Expand All @@ -237,6 +264,9 @@
BenchmarkDotNet.Engines.DeadCodeEliminationHelper.KeepAliveWithoutBoxing(value);
}

#if NETCOREAPP3_0_OR_GREATER
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveOptimization)]
#endif
private void OverheadActionNoUnroll(System.Int64 invokeCount)
{
$LoadArguments$
Expand All @@ -250,6 +280,9 @@

private $WorkloadMethodReturnType$ workloadDefaultValueHolder = default($WorkloadMethodReturnType$);

#if NETCOREAPP3_0_OR_GREATER
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveOptimization)]
#endif
private void WorkloadActionUnroll(System.Int64 invokeCount)
{
$LoadArguments$
Expand All @@ -260,7 +293,10 @@
}
BenchmarkDotNet.Engines.DeadCodeEliminationHelper.KeepAliveWithoutBoxing(ref alias);
}


#if NETCOREAPP3_0_OR_GREATER
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveOptimization)]
#endif
private void WorkloadActionNoUnroll(System.Int64 invokeCount)
{
$LoadArguments$
Expand All @@ -285,6 +321,9 @@
}
#elif RETURNS_BYREF_READONLY_$ID$

#if NETCOREAPP3_0_OR_GREATER
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveOptimization)]
#endif
private void OverheadActionUnroll(System.Int64 invokeCount)
{
$LoadArguments$
Expand All @@ -296,6 +335,9 @@
BenchmarkDotNet.Engines.DeadCodeEliminationHelper.KeepAliveWithoutBoxing(value);
}

#if NETCOREAPP3_0_OR_GREATER
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveOptimization)]
#endif
private void OverheadActionNoUnroll(System.Int64 invokeCount)
{
$LoadArguments$
Expand All @@ -309,6 +351,9 @@

private $WorkloadMethodReturnType$ workloadDefaultValueHolder = default($WorkloadMethodReturnType$);

#if NETCOREAPP3_0_OR_GREATER
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveOptimization)]
#endif
private void WorkloadActionUnroll(System.Int64 invokeCount)
{
$LoadArguments$
Expand All @@ -319,7 +364,10 @@
}
BenchmarkDotNet.Engines.DeadCodeEliminationHelper.KeepAliveWithoutBoxingReadonly(alias);
}


#if NETCOREAPP3_0_OR_GREATER
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveOptimization)]
#endif
private void WorkloadActionNoUnroll(System.Int64 invokeCount)
{
$LoadArguments$
Expand All @@ -344,6 +392,9 @@
}
#elif RETURNS_VOID_$ID$

#if NETCOREAPP3_0_OR_GREATER
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveOptimization)]
#endif
private void OverheadActionUnroll(System.Int64 invokeCount)
{
$LoadArguments$
Expand All @@ -353,6 +404,9 @@
}
}

#if NETCOREAPP3_0_OR_GREATER
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveOptimization)]
#endif
private void OverheadActionNoUnroll(System.Int64 invokeCount)
{
$LoadArguments$
Expand All @@ -362,6 +416,9 @@
}
}

#if NETCOREAPP3_0_OR_GREATER
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveOptimization)]
#endif
private void WorkloadActionUnroll(System.Int64 invokeCount)
{
$LoadArguments$
Expand All @@ -371,6 +428,9 @@
}
}

#if NETCOREAPP3_0_OR_GREATER
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveOptimization)]
#endif
private void WorkloadActionNoUnroll(System.Int64 invokeCount)
{
$LoadArguments$
Expand Down