diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp index c1230c6adeeb..771cf8d661b2 100644 --- a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp +++ b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp @@ -17651,10 +17651,7 @@ PPCTargetLowering::shouldExpandAtomicRMWInIR(AtomicRMWInst *AI) const { 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);