[llvm] 7a85559 - [BasicAA] Don't check whether GEP is sized (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Sun Sep 26 12:22:03 PDT 2021
Author: Nikita Popov
Date: 2021-09-26T21:21:54+02:00
New Revision: 7a855596c3a29ba7a9b0cc9bcc820f7f78d07afe
URL: https://github.com/llvm/llvm-project/commit/7a855596c3a29ba7a9b0cc9bcc820f7f78d07afe
DIFF: https://github.com/llvm/llvm-project/commit/7a855596c3a29ba7a9b0cc9bcc820f7f78d07afe.diff
LOG: [BasicAA] Don't check whether GEP is sized (NFC)
GEPs are required to have sized source element type, so we can
just assert that here.
Added:
Modified:
llvm/lib/Analysis/BasicAliasAnalysis.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Analysis/BasicAliasAnalysis.cpp b/llvm/lib/Analysis/BasicAliasAnalysis.cpp
index 8e53e7cb344d0..911ea6348274a 100644
--- a/llvm/lib/Analysis/BasicAliasAnalysis.cpp
+++ b/llvm/lib/Analysis/BasicAliasAnalysis.cpp
@@ -535,11 +535,7 @@ BasicAAResult::DecomposeGEPExpression(const Value *V, const DataLayout &DL,
else if (!GEPOp->isInBounds())
Decomposed.InBounds = false;
- // Don't attempt to analyze GEPs over unsized objects.
- if (!GEPOp->getSourceElementType()->isSized()) {
- Decomposed.Base = V;
- return Decomposed;
- }
+ assert(GEPOp->getSourceElementType()->isSized() && "GEP must be sized");
// Don't attempt to analyze GEPs if index scale is not a compile-time
// constant.
More information about the llvm-commits
mailing list