question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

C# code is not shown as optimized

See original GitHub issue

https://github.com/compiler-explorer/compiler-explorer/pull/3168 added support for C#, but as it looks the output isn’t optimized and looks more like a debug-output. Different compiler-flags as listed in the PR’s description and some comments don’t affect the output neither.

E.g. for https://godbolt.org/z/qdqdj5ffY expected output should be similar to

Foo:Bar(System.Span`1[System.Byte],long):ubyte:
    mov rax, [rcx]
    movzx eax, byte ptr [rax+rdx]
    ret

as for instance Sharplab shows.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
hez2010commented, Feb 6, 2022

@gfoidl Crossgen2 produces ReadyToRun quality of code which is less optimal than the JIT version. We want to improve the situation to produce the same JIT quality of code in future PRs.

/cc: @Egorbo for help with JIT compilation

@partouf Seems that some method signatures got removed unexpectedly in compiler explorer when both “Unused labels” and “Directives” filters enabled:

image

image

0reactions
partoufcommented, Feb 12, 2022

only the parser has been adjusted

--inputbubble --compilebubblegenerics makes the R2R codegen closer to JIT.

please comment in https://github.com/compiler-explorer/compiler-explorer/pull/3328 as that PR removes those parameters

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I "tell" to C compiler that the code shouldn't be ...
You have several options: Compile without optimisations. Unlike some compilers, GCC doesn't optimise by default so unless you tell it to ...
Read more >
Optimizing C and C++ code - EventHelix
In this article we will explore the following optimization techniques for C and C++ code developed for Real-time and Embedded Systems.
Read more >
Debug Optimized Code - Visual Studio (Windows)
However, a bug might appear only in an optimized version of a program. In that case, you must debug the optimized code.
Read more >
Optimization of Computer Programs in C
Describes C language techniques for source-level optimization of computer programs.
Read more >
How to prevent optimization of a variable
This will allow easier debugging and will keep variables in the code that might be eliminated under higher optimization levels. To do this:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found