diff --git a/llvm/lib/Target/Mips/MipsISelLowering.cpp b/llvm/lib/Target/Mips/MipsISelLowering.cpp --- a/llvm/lib/Target/Mips/MipsISelLowering.cpp +++ b/llvm/lib/Target/Mips/MipsISelLowering.cpp @@ -493,6 +493,13 @@ setLibcallName(RTLIB::MULO_I128, nullptr); } + if (Subtarget.isGP64bit()) + setMaxAtomicSizeInBitsSupported(64); + else if (Subtarget.hasMips2()) + setMaxAtomicSizeInBitsSupported(32); + else + setMaxAtomicSizeInBitsSupported(0); + setMinFunctionAlignment(Subtarget.isGP64bit() ? Align(8) : Align(4)); // The arguments on the stack are defined in terms of 4-byte slots on O32