diff --git a/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp b/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp --- a/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp +++ b/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp @@ -357,6 +357,11 @@ // condition branches. setJumpIsExpensive(true); + // Force atomics to be expanded if the ISA doesn't support them: PR4219 + setMinCmpXchgSizeInBits(32); + setMaxAtomicSizeInBitsSupported(64); + setSupportsUnalignedAtomics(false); + // Wide divides are _very_ slow. Try to reduce the width of the divide if // possible. addBypassSlowDiv(64, 32);