aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/ValueTracking.cpp
diff options
context:
space:
mode:
authorHuihui Zhang <huihuiz@quicinc.com>2020-03-17 11:31:19 -0700
committerHuihui Zhang <huihuiz@quicinc.com>2020-03-17 11:31:30 -0700
commit1bf0c9937583c344639f4c255cfed8478deecdb4 (patch)
treefd96d198c51b9472891f3bf8eb5b50f8e290c667 /llvm/lib/Analysis/ValueTracking.cpp
parentb6bcf728507ad8204343c4f276765b5d9ff6fff1 (diff)
downloadllvm-1bf0c9937583c344639f4c255cfed8478deecdb4.zip
llvm-1bf0c9937583c344639f4c255cfed8478deecdb4.tar.gz
llvm-1bf0c9937583c344639f4c255cfed8478deecdb4.tar.bz2
[ValueTracking][SVE] Fix isGEPKnownNonNull for scalable vector.
Summary: DataLayout::getTypeAllocSize() return TypeSize. For cases where the scalable property doesn't matter, we should explicitly call getKnownMinSize() to avoid implicit type conversion to uint64_t, which is not valid for scalable vector type. Reviewers: sdesmalen, efriedma, apazos, reames Reviewed By: efriedma Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D76260
Diffstat (limited to 'llvm/lib/Analysis/ValueTracking.cpp')
-rw-r--r--llvm/lib/Analysis/ValueTracking.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index 1a22530501..d4f4e6e 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -2084,7 +2084,7 @@ static bool isGEPKnownNonNull(const GEPOperator *GEP, unsigned Depth,
}
// If we have a zero-sized type, the index doesn't matter. Keep looping.
- if (Q.DL.getTypeAllocSize(GTI.getIndexedType()) == 0)
+ if (Q.DL.getTypeAllocSize(GTI.getIndexedType()).getKnownMinSize() == 0)
continue;
// Fast path the constant operand case both for efficiency and so we don't