diff --git a/clang/lib/CodeGen/CGAtomic.cpp b/clang/lib/CodeGen/CGAtomic.cpp index cc85375f08dd..e5c5e5babf23 100644 --- a/clang/lib/CodeGen/CGAtomic.cpp +++ b/clang/lib/CodeGen/CGAtomic.cpp @@ -1730,11 +1730,6 @@ AtomicInfo::EmitAtomicCompareExchangeLibcall(llvm::Value *ExpectedAddr, std::pair AtomicInfo::EmitAtomicCompareExchange( RValue Expected, RValue Desired, llvm::AtomicOrdering Success, llvm::AtomicOrdering Failure, bool IsWeak) { - if (isStrongerThan(Failure, Success)) - // Don't assert on undefined behavior "failure argument shall be no stronger - // than the success argument". - Failure = llvm::AtomicCmpXchgInst::getStrongestFailureOrdering(Success); - // Check whether we should use a library call. if (shouldUseLibcall()) { // Produce a source address.