[polly] r256298 - Do not store scalar accesses in InstructionToAccess

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 22 15:25:12 PST 2015

Author: meinersbur
Date: Tue Dec 22 17:25:11 2015
New Revision: 256298

URL: http://llvm.org/viewvc/llvm-project?rev=256298&view=rev
Do not store scalar accesses in InstructionToAccess

At code generation, scalar reads are generated before the other
statement's instructions, respectively scalar writes after them, in
contrast to array accesses which are "executed" with the instructions
they are linked to. Therefore it makes sense to not map the scalar
accesses to a place of execution. Follow-up patches will also remove
some of the directs links from a scalar access to a single instruction,
such that only having array accesses in InstructionToAccess ensures

Differential Revision: http://reviews.llvm.org/D13676


Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=256298&r1=256297&r2=256298&view=diff
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Tue Dec 22 17:25:11 2015
@@ -904,9 +904,12 @@ void ScopStmt::buildAccessRelations() {
 void ScopStmt::addAccess(MemoryAccess *Access) {
   Instruction *AccessInst = Access->getAccessInstruction();
-  MemoryAccessList &MAL = InstructionToAccess[AccessInst];
-  MAL.emplace_front(Access);
-  MemAccs.push_back(MAL.front());
+  if (Access->isArrayKind()) {
+    MemoryAccessList &MAL = InstructionToAccess[AccessInst];
+    MAL.emplace_front(Access);
+  }
+  MemAccs.push_back(Access);
 void ScopStmt::realignParams() {

More information about the llvm-commits mailing list