aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/VectorUtils.cpp
diff options
context:
space:
mode:
authorArthur Eubanks <aeubanks@google.com>2021-05-14 14:01:05 -0700
committerArthur Eubanks <aeubanks@google.com>2021-05-17 18:35:44 -0700
commitcc64ece77dddfa7aa590b6d69fe026fcd64d00cf (patch)
treefe313439d6479bd8b76a64c8a87487551b57ceee /llvm/lib/Analysis/VectorUtils.cpp
parentfcffd087c6bc1364678c1549ffc7a26fd8bea930 (diff)
downloadllvm-cc64ece77dddfa7aa590b6d69fe026fcd64d00cf.zip
llvm-cc64ece77dddfa7aa590b6d69fe026fcd64d00cf.tar.gz
llvm-cc64ece77dddfa7aa590b6d69fe026fcd64d00cf.tar.bz2
[NFC][OpaquePtr] Avoid using PointerType::getElementType() in VectorUtils.cpp
Reviewed By: nikic Differential Revision: https://reviews.llvm.org/D102533
Diffstat (limited to 'llvm/lib/Analysis/VectorUtils.cpp')
-rw-r--r--llvm/lib/Analysis/VectorUtils.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/lib/Analysis/VectorUtils.cpp b/llvm/lib/Analysis/VectorUtils.cpp
index f7c3929..800cd3b 100644
--- a/llvm/lib/Analysis/VectorUtils.cpp
+++ b/llvm/lib/Analysis/VectorUtils.cpp
@@ -959,12 +959,11 @@ void InterleavedAccessInfo::collectConstStrideAccesses(
DFS.perform(LI);
for (BasicBlock *BB : make_range(DFS.beginRPO(), DFS.endRPO()))
for (auto &I : *BB) {
- auto *LI = dyn_cast<LoadInst>(&I);
- auto *SI = dyn_cast<StoreInst>(&I);
- if (!LI && !SI)
+ Value *Ptr = getLoadStorePointerOperand(&I);
+ if (!Ptr)
continue;
+ Type *ElementTy = getLoadStoreType(&I);
- Value *Ptr = getLoadStorePointerOperand(&I);
// We don't check wrapping here because we don't know yet if Ptr will be
// part of a full group or a group with gaps. Checking wrapping for all
// pointers (even those that end up in groups with no gaps) will be overly
@@ -976,8 +975,7 @@ void InterleavedAccessInfo::collectConstStrideAccesses(
/*Assume=*/true, /*ShouldCheckWrap=*/false);
const SCEV *Scev = replaceSymbolicStrideSCEV(PSE, Strides, Ptr);
- PointerType *PtrTy = cast<PointerType>(Ptr->getType());
- uint64_t Size = DL.getTypeAllocSize(PtrTy->getElementType());
+ uint64_t Size = DL.getTypeAllocSize(ElementTy);
AccessStrideInfo[&I] = StrideDescriptor(Stride, Scev, Size,
getLoadStoreAlignment(&I));
}