-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Workaround for slow codegen on x86 atomic load #2110
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 @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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! The behavior is equivalent, and the code is simpler, so this is a good perma-workaround (no TRANSITION comment).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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