[X86] Use LoadInst->getType() instead of LoadInst->getPointerOperandType()->getElemen...
authorCraig Topper <craig.topper@intel.com>
Thu, 21 Mar 2019 21:37:18 +0000 (21:37 +0000)
committerCraig Topper <craig.topper@intel.com>
Thu, 21 Mar 2019 21:37:18 +0000 (21:37 +0000)
For the future day when the pointer's don't have element types, we shoudl just use the type of the load result instead.

llvm-svn: 356721

llvm/lib/Target/X86/X86ISelLowering.cpp

index db56df6e914b61dc02a4d067f64d924e6e143010..9f02d2fcca56b373680943710c723a17982fd5e9 100644 (file)
@@ -25497,9 +25497,8 @@ bool X86TargetLowering::shouldExpandAtomicStoreInIR(StoreInst *SI) const {
 // FIXME: On 32 bits x86, fild/movq might be faster than lock cmpxchg8b.
 TargetLowering::AtomicExpansionKind
 X86TargetLowering::shouldExpandAtomicLoadInIR(LoadInst *LI) const {
-  auto PTy = cast<PointerType>(LI->getPointerOperandType());
-  return needsCmpXchgNb(PTy->getElementType()) ? AtomicExpansionKind::CmpXChg
-                                               : AtomicExpansionKind::None;
+  return needsCmpXchgNb(LI->getType()) ? AtomicExpansionKind::CmpXChg
+                                       : AtomicExpansionKind::None;
 }
 
 TargetLowering::AtomicExpansionKind