[llvm] [X86] Use plain load/store instead of cmpxchg16b for atomics with AVX (PR #74275)

James Y Knight via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 4 05:39:30 PST 2023


================
@@ -3831,17 +3831,14 @@ void DAGTypeLegalizer::ExpandIntRes_XROUND_XRINT(SDNode *N, SDValue &Lo,
 void DAGTypeLegalizer::ExpandIntRes_LOAD(LoadSDNode *N,
                                          SDValue &Lo, SDValue &Hi) {
   if (N->isAtomic()) {
-    // It's typical to have larger CAS than atomic load instructions.
----------------
jyknight wrote:

I think we don't need a check. Using LOAD instead of ATOMIC_LOAD was an optimization for unordered atomics only (see [SelectionDAGBuilder code](https://github.com/llvm/llvm-project/blob/110319f20bb837ba47220b11da104713566c1e7e/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp#L4861)); fallling back to ATOMIC_LOAD should always be fine.

https://github.com/llvm/llvm-project/pull/74275


More information about the llvm-commits mailing list