Skip to content

Control Crossgen2 optimizations with DebuggableAttribute#44514

Merged
nattress merged 2 commits intodotnet:masterfrom
nattress:AssemblyDebuggableAttribute
Jan 8, 2021
Merged

Control Crossgen2 optimizations with DebuggableAttribute#44514
nattress merged 2 commits intodotnet:masterfrom
nattress:AssemblyDebuggableAttribute

Conversation

@nattress
Copy link
Contributor

  • Assemblies compiled in debug configuration use the System.Diagnostics.DebuggableAttribute to indicate optimizations are disabled.
  • Match Crossgen 1's behavior and respect this setting if no explicit optimization arguments are passed in.
  • Add -Od switch to disable optimizations since now the default behavior of Crossgen2 is to optimize release-built assemblies.

cc @dotnet/crossgen-contrib

@nattress nattress requested a review from trylek November 11, 2020 08:50
@nattress
Copy link
Contributor Author

Addresses #44324

Copy link
Member

@trylek trylek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@davidwrighton
Copy link
Member

Should we change our test scripts to not explicitly pass -O?

@nattress
Copy link
Contributor Author

I'll remove the explicit -O from the CoreCLR tests though we only use Check and Release flavors in CI so the assemblies won't have debug enabled typically. Libraries tests using Crossgen2 will be more interesting since they do Debug test runs. The Crossgen comparison runs are release only so I'll leave those alone.

@ViktorHofer
Copy link
Member

// Auto-generated message

69e114c which was merged 12/7 removed the intermediate src/coreclr/src/ folder. This PR needs to be updated as it touches files in that directory which causes conflicts.

To update your commits you can use this bash script: https://gist.github.com/ViktorHofer/6d24f62abdcddb518b4966ead5ef3783. Feel free to use the comment section of the gist to improve the script for others.

@nattress nattress force-pushed the AssemblyDebuggableAttribute branch 3 times, most recently from f9de9e2 to 89b0d9b Compare December 18, 2020 21:58
* Assemblies compiled in debug configuration use the `System.Diagnostics.DebuggableAttribute` to indicate optimizations are disabled.
* Match Crossgen 1's behavior and respect this setting if no explicit optimization arguments are passed in.
* Add `-Od` switch to disable optimizations since now the default behavior of Crossgen2 is to optimize release-built assemblies.
Fix runtime assert when checking the GC ref map for multi-dimensional array's intrinsic `Address` method on x86. `Address` has a custom calling convention which always requires the extra param type in the signature. The extra shared generic check is too restrictive and doesn't match what we tell the JIT the signature is in https://github.com/dotnet/runtime/blob/4b8d10154c39b1f56424d4ba2068a3150d90d475/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs#L500.
@nattress nattress force-pushed the AssemblyDebuggableAttribute branch from 89b0d9b to 7e59dad Compare January 8, 2021 00:09
@nattress nattress merged commit b9bb383 into dotnet:master Jan 8, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Feb 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants