diff --git a/llvm/lib/CheerpUtils/IdenticalCodeFolding.cpp b/llvm/lib/CheerpUtils/IdenticalCodeFolding.cpp index b0f682614c45..12646b8cc5c3 100644 --- a/llvm/lib/CheerpUtils/IdenticalCodeFolding.cpp +++ b/llvm/lib/CheerpUtils/IdenticalCodeFolding.cpp @@ -512,6 +512,15 @@ bool IdenticalCodeFolding::equivalentInstruction(const llvm::Instruction* A, con equivalentOperand(A->getOperand(0), B->getOperand(0)) && equivalentOperand(A->getOperand(1), B->getOperand(1))); } + case Instruction::AtomicRMW: + { + const AtomicRMWInst* a = cast(A); + const AtomicRMWInst* b = cast(B); + return CacheAndReturn(equivalentType(a->getType(), b->getType()) && + a->getOperation() == b->getOperation() && + equivalentOperand(a->getPointerOperand(), b->getPointerOperand()) && + equivalentOperand(a->getValOperand(), b->getValOperand())); + } default: { #ifndef NDEBUG