[PATCH] D50554: [ValueTracking] Accept vector of pointer in GetUnderlyingObject utility
Serguei Katkov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 10 00:31:22 PDT 2018
skatkov created this revision.
skatkov added reviewers: ABataev, ashahid, craig.topper.
GEP and BitCast instructions may produce a pointer of vectors from
underlying object. So it is valid for GetUnderlyingObject utility to
accept vector of pointers and detect underlying object which might be
instruction of vector or non-vector type.
https://reviews.llvm.org/D50554
Files:
lib/Analysis/ValueTracking.cpp
Index: lib/Analysis/ValueTracking.cpp
===================================================================
--- lib/Analysis/ValueTracking.cpp
+++ lib/Analysis/ValueTracking.cpp
@@ -3488,7 +3488,7 @@
Value *llvm::GetUnderlyingObject(Value *V, const DataLayout &DL,
unsigned MaxLookup) {
- if (!V->getType()->isPointerTy())
+ if (!V->getType()->isPtrOrPtrVectorTy())
return V;
for (unsigned Count = 0; MaxLookup == 0 || Count < MaxLookup; ++Count) {
if (GEPOperator *GEP = dyn_cast<GEPOperator>(V)) {
@@ -3530,7 +3530,7 @@
return V;
}
- assert(V->getType()->isPointerTy() && "Unexpected operand type!");
+ assert(V->getType()->isPtrOrPtrVectorTy() && "Unexpected operand type!");
}
return V;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50554.160067.patch
Type: text/x-patch
Size: 770 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180810/fe82dd9a/attachment.bin>
More information about the llvm-commits
mailing list