Add compiler switches to enable optimizations and debug info generation#2572
Conversation
After dotnet#2403 got fixed there's nothing preventing us from finally implementing this. Includes piping in the driver EXE, Compilation and RyuJIT compilation, and build integration. Fixes dotnet#696. Fixes dotnet#383.
|
Cc @sandreenko @dotnet/corert-contrib |
| jitFlagBuilder.Add(CorJitFlag.CORJIT_FLAG_SIZE_OPT); | ||
| break; | ||
|
|
||
| default: |
There was a problem hiding this comment.
The RyuJIT default is to not have either of these two flags set. It generates blend of speed and size opts. It may be a good idea to make it the default because it is how it is used everywhere else.
There was a problem hiding this comment.
That does sound like a good default. We might want to expose optimizing for size in some way in order to enable size comparisons with NUTC for size-sensitive scenarios (maybe speed for the same reason).
There was a problem hiding this comment.
The RyuJIT default is to not have either of these two flags set. It generates blend of speed and size opts
I need a new name for that in the OptimizationMode enum then. If there are no suggestions, I'm going to call it OptimizationMode.Random.
There was a problem hiding this comment.
It is called "Blended" in RyuJIT
https://github.com/dotnet/coreclr/search?utf8=%E2%9C%93&q=BLENDED_CODE&type=Code
|
|
||
| public MethodDebugInformation GetDebugInfo(MethodIL methodIL) | ||
| { | ||
| if (!GenerateDebugInfo) |
There was a problem hiding this comment.
What's the scenario for not generating debug info? On other runtimes, optimized builds are still debuggable to some extent.
There was a problem hiding this comment.
What's the scenario for not generating debug info?
"Optimizing" and "generating debug info" are two separate things on most compilers (Roslyn, gcc, VC++, etc.), controlled by separate compiler switches (that are off by default). This was also requested by the JIT team (see the issue in the pull request).
By default, both options will be
false(as opposed totruebefore this change). This is a breaking change that makes us behave the same as pretty much every other major compiler in the world. Make sure to runbuild cleanto regenerate rsp files for the repro project.After #2403 got fixed there's nothing preventing us from finally
implementing this.
Includes piping in the driver EXE, Compilation and RyuJIT compilation,
and build integration.
Fixes #696. Fixes #383.