LLVM 22.0.0git
InstCombineAtomicRMW.cpp File Reference

Go to the source code of this file.

Functions

static bool isIdempotentRMW (AtomicRMWInst &RMWI)
 Return true if and only if the given instruction does not modify the memory location referenced.
static bool isSaturating (AtomicRMWInst &RMWI)
 Return true if the given instruction always produces a value in memory equivalent to its value operand.

Function Documentation

◆ isIdempotentRMW()

bool isIdempotentRMW ( AtomicRMWInst & RMWI)
static

Return true if and only if the given instruction does not modify the memory location referenced.

Note that an idemptent atomicrmw may still have ordering effects on nearby instructions, or be volatile. TODO: Common w/ the version in AtomicExpandPass, and change the term used. Idemptotent is confusing in this context.

Definition at line 23 of file InstCombineAtomicRMW.cpp.

References llvm::AtomicRMWInst::Add, llvm::AtomicRMWInst::And, llvm::CallingConv::C, llvm::dyn_cast(), llvm::AtomicRMWInst::FAdd, llvm::AtomicRMWInst::FSub, llvm::AtomicRMWInst::getOperation(), llvm::AtomicRMWInst::getValOperand(), llvm::AtomicRMWInst::Max, llvm::AtomicRMWInst::Min, llvm::AtomicRMWInst::Or, llvm::AtomicRMWInst::Sub, llvm::AtomicRMWInst::UMax, llvm::AtomicRMWInst::UMin, and llvm::AtomicRMWInst::Xor.

Referenced by llvm::InstCombinerImpl::visitAtomicRMWInst().

◆ isSaturating()