[PATCH] D108048: [DependenceAnalysis] Conservatively exit on type mismatch

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 2 00:50:33 PDT 2021


nikic added inline comments.


================
Comment at: llvm/lib/Analysis/DependenceAnalysis.cpp:3602
+    const StoreInst *SI = dyn_cast<StoreInst>(I);
+    Type *IType = (LI) ? LI->getType() : SI->getValueOperand()->getType();
+    uint64_t Width = DL.getTypeStoreSize(IType);
----------------
getLoadStoreType() + getLoadStoreAlignment()


================
Comment at: llvm/lib/Analysis/DependenceAnalysis.cpp:3611-3616
+  Type *SrcOpType =
+      static_cast<PointerType *>(MemoryLocation::get(Src).Ptr->getType())
+          ->getElementType();
+  Type *DstOpType =
+      static_cast<PointerType *>(MemoryLocation::get(Dst).Ptr->getType())
+          ->getElementType();
----------------
Meinersbur wrote:
> `llvm::Type::getPointerElementType()` is a shortcut for `cast<PointerType>(...)->getElementType()`
This should use getLoadStoreType() for opaque pointer compatibility as well.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108048/new/

https://reviews.llvm.org/D108048



More information about the llvm-commits mailing list