Skip to content
This repository was archived by the owner on Nov 1, 2020. It is now read-only.

Add compiler switches to enable optimizations and debug info generation#2572

Merged
MichalStrehovsky merged 2 commits intodotnet:masterfrom
MichalStrehovsky:optimizeSwitch
Jan 24, 2017
Merged

Add compiler switches to enable optimizations and debug info generation#2572
MichalStrehovsky merged 2 commits intodotnet:masterfrom
MichalStrehovsky:optimizeSwitch

Conversation

@MichalStrehovsky
Copy link
Member

By default, both options will be false (as opposed to true before 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 run build clean to 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.

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.
@MichalStrehovsky
Copy link
Member Author

Cc @sandreenko @dotnet/corert-contrib

jitFlagBuilder.Add(CorJitFlag.CORJIT_FLAG_SIZE_OPT);
break;

default:
Copy link
Member

Choose a reason for hiding this comment

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

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

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).

Copy link
Member Author

Choose a reason for hiding this comment

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

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.

Copy link
Member

Choose a reason for hiding this comment

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


public MethodDebugInformation GetDebugInfo(MethodIL methodIL)
{
if (!GenerateDebugInfo)
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the scenario for not generating debug info? On other runtimes, optimized builds are still debuggable to some extent.

Copy link
Member Author

Choose a reason for hiding this comment

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

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).

@MichalStrehovsky MichalStrehovsky merged commit 11af271 into dotnet:master Jan 24, 2017
@MichalStrehovsky MichalStrehovsky deleted the optimizeSwitch branch January 24, 2017 23:39
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.

command line flag to enable debug info output ilc.exe needs /debug command line option

4 participants