From e24b7b929d3d11660c0e5141d367f713cea6f6d3 Mon Sep 17 00:00:00 2001 From: Tobias Grosser Date: Thu, 9 Feb 2017 23:24:57 +0000 Subject: [PATCH] [ScopInfo] Use MemoryAccess::getScopArrayInfo() interface to access Array [NFC] By using the public interface MemoryAccess::getScopArrayInfo() we avoid the direct access to the ScopArrayInfoMap and as a result also do not need to use the BasePtr as key. This change makes the code cleaner. The const-cast we introduce is a little ugly. We may consider to drop const correctness for getScopArrayInfo() at some point. This change removes unnecessary uses of MemoryAddress::getBaseAddr() in preparation for https://reviews.llvm.org/D28518. llvm-svn: 294655 --- polly/lib/Analysis/ScopInfo.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp index 97b27da58938..e9d7b508fa15 100644 --- a/polly/lib/Analysis/ScopInfo.cpp +++ b/polly/lib/Analysis/ScopInfo.cpp @@ -3332,9 +3332,8 @@ void Scop::updateAccessDimensionality() { if (!Access->isArrayKind()) continue; ScopArrayInfo *Array = - ScopArrayInfoMap[std::make_pair(Access->getBaseAddr(), - MemoryKind::Array)] - .get(); + const_cast(Access->getScopArrayInfo()); + if (Array->getNumberOfDimensions() != 1) continue; unsigned DivisibleSize = Array->getElemSizeInBytes();