aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/DataLayout.cpp
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2021-10-23 22:50:24 +0200
committerNikita Popov <nikita.ppv@gmail.com>2021-11-07 18:56:11 +0100
commita8c318b50eccc922bc76f22e1791b0420574187d (patch)
treec2d6c1ed8bcf502fed4a02765565ca474e2fb697 /llvm/lib/IR/DataLayout.cpp
parentaee86f9b6cbb262a83f9f31371b047eb5bcd0a2b (diff)
downloadllvm-a8c318b50eccc922bc76f22e1791b0420574187d.zip
llvm-a8c318b50eccc922bc76f22e1791b0420574187d.tar.gz
llvm-a8c318b50eccc922bc76f22e1791b0420574187d.tar.bz2
[BasicAA] Use index size instead of pointer size
When accumulating the GEP offset in BasicAA, we should use the pointer index size rather than the pointer size. Differential Revision: https://reviews.llvm.org/D112370
Diffstat (limited to 'llvm/lib/IR/DataLayout.cpp')
-rw-r--r--llvm/lib/IR/DataLayout.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/IR/DataLayout.cpp b/llvm/lib/IR/DataLayout.cpp
index 5edff7a..2ace180 100644
--- a/llvm/lib/IR/DataLayout.cpp
+++ b/llvm/lib/IR/DataLayout.cpp
@@ -707,12 +707,12 @@ unsigned DataLayout::getPointerSize(unsigned AS) const {
return getPointerAlignElem(AS).TypeByteWidth;
}
-unsigned DataLayout::getMaxPointerSize() const {
- unsigned MaxPointerSize = 0;
+unsigned DataLayout::getMaxIndexSize() const {
+ unsigned MaxIndexSize = 0;
for (auto &P : Pointers)
- MaxPointerSize = std::max(MaxPointerSize, P.TypeByteWidth);
+ MaxIndexSize = std::max(MaxIndexSize, P.IndexWidth);
- return MaxPointerSize;
+ return MaxIndexSize;
}
unsigned DataLayout::getPointerTypeSizeInBits(Type *Ty) const {