Just a small thing, the Roslyn compiler (or any C# compiler) does very few optimisations, see https://blogs.msdn.microsoft.com/ericlippert/2009/06/11/what... for some details.
Almost all of the 'compiler' optimisations are done by the JIT at run-time when it converts the IL code into machine/assembly code