-
Notifications
You must be signed in to change notification settings - Fork 110
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
[CIR] Atomic builtins with non-const memory order #736
[CIR] Atomic builtins with non-const memory order #736
Conversation
Fix llvm#731 Implement atomic built-in operations where the memory order argument is a runtime value rather than a compile-time constant. This is necessary to support std::atomic. The ClangIR atomic operations don't support runtime memory orders, so this is implemented during CodeGen by generating a switch statement that effectively converts the runtime memory order into a compile-time memory order. A new file, atomic-runtime.cpp, was added to the ClangIR CodeGen tests to cover this situation.
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.
Great, some minor changes and should be good. Thanks for fixing this
This is the response to code review comments for PR llvm#736. Don't use `auto` declarations in a couple places. Add a test for LLVM lowering of atomic_load_n with a non-const memory order.
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.
Approved too fast, some minor nit remaining.
Change the lowering test atomic-runtime.cpp to check the LLVM IR rather than the LLVM MLIR dialect. LLVM IR will be more stable over time.
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.
Great, LGTM
Fix llvm#731 Implement atomic built-in operations where the memory order argument is a runtime value rather than a compile-time constant. This is necessary to support `std::atomic`. The ClangIR atomic operations don't support runtime memory orders, so this is implemented during CodeGen by generating a switch statement that effectively converts the runtime memory order into a compile-time memory order. A new file, atomic-runtime.cpp, was added to the ClangIR CodeGen tests to cover this situation.
Fix llvm#731 Implement atomic built-in operations where the memory order argument is a runtime value rather than a compile-time constant. This is necessary to support `std::atomic`. The ClangIR atomic operations don't support runtime memory orders, so this is implemented during CodeGen by generating a switch statement that effectively converts the runtime memory order into a compile-time memory order. A new file, atomic-runtime.cpp, was added to the ClangIR CodeGen tests to cover this situation.
Fix llvm#731 Implement atomic built-in operations where the memory order argument is a runtime value rather than a compile-time constant. This is necessary to support `std::atomic`. The ClangIR atomic operations don't support runtime memory orders, so this is implemented during CodeGen by generating a switch statement that effectively converts the runtime memory order into a compile-time memory order. A new file, atomic-runtime.cpp, was added to the ClangIR CodeGen tests to cover this situation.
Fix llvm#731 Implement atomic built-in operations where the memory order argument is a runtime value rather than a compile-time constant. This is necessary to support `std::atomic`. The ClangIR atomic operations don't support runtime memory orders, so this is implemented during CodeGen by generating a switch statement that effectively converts the runtime memory order into a compile-time memory order. A new file, atomic-runtime.cpp, was added to the ClangIR CodeGen tests to cover this situation.
Fix #731 Implement atomic built-in operations where the memory order argument is a runtime value rather than a compile-time constant. This is necessary to support `std::atomic`. The ClangIR atomic operations don't support runtime memory orders, so this is implemented during CodeGen by generating a switch statement that effectively converts the runtime memory order into a compile-time memory order. A new file, atomic-runtime.cpp, was added to the ClangIR CodeGen tests to cover this situation.
Fix #731
Implement atomic built-in operations where the memory order argument is a runtime value rather than a compile-time constant. This is necessary to support
std::atomic
. The ClangIR atomic operations don't support runtime memory orders, so this is implemented during CodeGen by generating a switch statement that effectively converts the runtime memory order into a compile-time memory order.A new file, atomic-runtime.cpp, was added to the ClangIR CodeGen tests to cover this situation.