diff options
author | Florian Hahn <flo@fhahn.com> | 2024-07-14 17:23:31 +0100 |
---|---|---|
committer | Florian Hahn <flo@fhahn.com> | 2024-07-14 17:24:12 +0100 |
commit | 3ccda936710d55d819c56cf4f2cf307c2d632b63 (patch) | |
tree | b1ca394bfb4bf086eb837933b24ef7ab180bf8a9 /llvm/lib/Analysis/LoopAccessAnalysis.cpp | |
parent | 3aae4caffa3134d4edd1811fd2c35cbc95eb7441 (diff) | |
download | llvm-3ccda936710d55d819c56cf4f2cf307c2d632b63.zip llvm-3ccda936710d55d819c56cf4f2cf307c2d632b63.tar.gz llvm-3ccda936710d55d819c56cf4f2cf307c2d632b63.tar.bz2 |
[LAA] Update pointer-bounds cache to also consider access type.
The same pointer may be accessed with different types and the bound
includes the size of the accessed type to compute the end. Update the
cache to correctly disambiguate between different accessed types.
Diffstat (limited to 'llvm/lib/Analysis/LoopAccessAnalysis.cpp')
-rw-r--r-- | llvm/lib/Analysis/LoopAccessAnalysis.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/LoopAccessAnalysis.cpp b/llvm/lib/Analysis/LoopAccessAnalysis.cpp index 018861a..91994f3 100644 --- a/llvm/lib/Analysis/LoopAccessAnalysis.cpp +++ b/llvm/lib/Analysis/LoopAccessAnalysis.cpp @@ -206,12 +206,13 @@ RuntimeCheckingPtrGroup::RuntimeCheckingPtrGroup( static std::pair<const SCEV *, const SCEV *> getStartAndEndForAccess( const Loop *Lp, const SCEV *PtrExpr, Type *AccessTy, PredicatedScalarEvolution &PSE, - DenseMap<const SCEV *, std::pair<const SCEV *, const SCEV *>> - &PointerBounds) { + DenseMap<std::pair<const SCEV *, Type *>, + std::pair<const SCEV *, const SCEV *>> &PointerBounds) { ScalarEvolution *SE = PSE.getSE(); auto [Iter, Ins] = PointerBounds.insert( - {PtrExpr, {SE->getCouldNotCompute(), SE->getCouldNotCompute()}}); + {{PtrExpr, AccessTy}, + {SE->getCouldNotCompute(), SE->getCouldNotCompute()}}); if (!Ins) return Iter->second; |