Repository navigation
Workaround for slow codegen on x86 atomic load - #2110
Stephan T. Lavavej (StephanTLavavej) merged 1 commit into
Conversation
Compiler emits jumptable or jcc sequence that prevents inlining of atomic load; separation of order check and barrier condition helps
|
Not sure if it should be applied, or the compiler should be fixed instead. |
|
Send feedback to the Visual Studio compiler team via visual studio feedback |
|
The feedback was already sent by Christian Fersch (@Chronial) , see DevCom-1491677 I'm not really sure if there should be workaround in code. There are at least three optimizer issues:
Fixing just one of them would help. The workaround is a particular solutiin for wider problems. |
|
Proof that it works: https://godbolt.org/z/5e7re6bGY |
Stephan T. Lavavej (StephanTLavavej)
left a comment
There was a problem hiding this comment.
Looks good! The behavior is equivalent, and the code is simpler, so this is a good perma-workaround (no TRANSITION comment).
Charlie Barto (barcharcraz)
left a comment
There was a problem hiding this comment.
I also like the "workaround" code better than the old code.
|
I'm mirroring this to an MSVC-internal PR. Please notify me if any further changes are pushed. |
|
Changed the title to say "slow codegen", as the compiler back-end team conventionally uses "bad codegen" to mean incorrect codegen. |
|
Thanks... for... improving... this... slow... codegen... ! 🐌 😹 🐇 |
Compiler emits jumptable or jcc sequence that prevents inlining
of atomic load; separation of order check and barrier condition helps