A cmpxchg's new value type is the same as the pointer operand's pointee type.
TargetLowering::AtomicExpansionKind
PPCTargetLowering::shouldExpandAtomicCmpXchgInIR(AtomicCmpXchgInst *AI) const {
- unsigned Size = AI->getPointerOperand()
- ->getType()
- ->getPointerElementType()
- ->getPrimitiveSizeInBits();
+ unsigned Size = AI->getNewValOperand()->getType()->getPrimitiveSizeInBits();
if (EnableQuadwordAtomics && Subtarget.hasQuadwordAtomics() && Size == 128)
return AtomicExpansionKind::MaskedIntrinsic;
return TargetLowering::shouldExpandAtomicCmpXchgInIR(AI);