[polly] r294655 - [ScopInfo] Use MemoryAccess::getScopArrayInfo() interface to access Array [NFC]
Tobias Grosser via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 9 15:24:57 PST 2017
Author: grosser
Date: Thu Feb 9 17:24:57 2017
New Revision: 294655
URL: http://llvm.org/viewvc/llvm-project?rev=294655&view=rev
Log:
[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.
Modified:
polly/trunk/lib/Analysis/ScopInfo.cpp
Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=294655&r1=294654&r2=294655&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Thu Feb 9 17:24:57 2017
@@ -3332,9 +3332,8 @@ void Scop::updateAccessDimensionality()
if (!Access->isArrayKind())
continue;
ScopArrayInfo *Array =
- ScopArrayInfoMap[std::make_pair(Access->getBaseAddr(),
- MemoryKind::Array)]
- .get();
+ const_cast<ScopArrayInfo *>(Access->getScopArrayInfo());
+
if (Array->getNumberOfDimensions() != 1)
continue;
unsigned DivisibleSize = Array->getElemSizeInBytes();
More information about the llvm-commits
mailing list