diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp --- a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp +++ b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp @@ -1371,12 +1371,12 @@ setLibcallName(RTLIB::MULO_I64, nullptr); } - if (!isPPC64) - setMaxAtomicSizeInBitsSupported(32); - else if (shouldInlineQuadwordAtomics()) + if (shouldInlineQuadwordAtomics()) setMaxAtomicSizeInBitsSupported(128); - else + else if (isPPC64) setMaxAtomicSizeInBitsSupported(64); + else + setMaxAtomicSizeInBitsSupported(32); setStackPointerRegisterToSaveRestore(isPPC64 ? PPC::X1 : PPC::R1);