[NFC] Avoid using pointee types in PPCISelLowering
authorArthur Eubanks <aeubanks@google.com>
Mon, 13 Sep 2021 00:36:46 +0000 (17:36 -0700)
committerArthur Eubanks <aeubanks@google.com>
Mon, 13 Sep 2021 00:37:35 +0000 (17:37 -0700)
A cmpxchg's new value type is the same as the pointer operand's pointee type.

llvm/lib/Target/PowerPC/PPCISelLowering.cpp

index c1230c6..771cf8d 100644 (file)
@@ -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);