Control Crossgen2 optimizations with DebuggableAttribute (#44514)
authorSimon Nattress <nattress@gmail.com>
Fri, 8 Jan 2021 18:15:30 +0000 (10:15 -0800)
committerGitHub <noreply@github.com>
Fri, 8 Jan 2021 18:15:30 +0000 (10:15 -0800)
commitb9bb38363e457ce71d2cb6bb76cbf6cdd427e929
tree2a67c676e5217eacf975003b2c67c6846527aa05
parent805e288baff174a3d8cdd4bf4c7f1bc9985f4767
Control Crossgen2 optimizations with DebuggableAttribute (#44514)

* 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.
src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/AssemblyExtensions.cs [new file with mode: 0644]
src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/GCRefMapBuilder.cs
src/coreclr/tools/aot/ILCompiler.ReadyToRun/ILCompiler.ReadyToRun.csproj
src/coreclr/tools/aot/crossgen2/CommandLineOptions.cs
src/coreclr/tools/aot/crossgen2/Program.cs
src/coreclr/tools/aot/crossgen2/Properties/Resources.resx
src/tests/Common/CLRTest.CrossGen.targets