[llvm] f94a118 - [NFC] Avoid using pointee types in PPCISelLowering

Arthur Eubanks via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 12 17:38:01 PDT 2021


Author: Arthur Eubanks
Date: 2021-09-12T17:37:35-07:00
New Revision: f94a118a6eb381454c658f62958678c6a442eefb

URL: https://github.com/llvm/llvm-project/commit/f94a118a6eb381454c658f62958678c6a442eefb
DIFF: https://github.com/llvm/llvm-project/commit/f94a118a6eb381454c658f62958678c6a442eefb.diff

LOG: [NFC] Avoid using pointee types in PPCISelLowering

A cmpxchg's new value type is the same as the pointer operand's pointee type.

Added: 
    

Modified: 
    llvm/lib/Target/PowerPC/PPCISelLowering.cpp

Removed: 
    


################################################################################
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);


        


More information about the llvm-commits mailing list