[polly] r255716 - ScopInfo: Use getArrayAccessFor in reduction detection

Tobias Grosser via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 15 15:50:05 PST 2015


Author: grosser
Date: Tue Dec 15 17:50:04 2015
New Revision: 255716

URL: http://llvm.org/viewvc/llvm-project?rev=255716&view=rev
Log:
ScopInfo: Use getArrayAccessFor in reduction detection

Load instructions may possibly be related to multiple memory accesses, but we
are only interested in the array read access that describes the memory location
the load instructions loads from. By using getArrayAccessfor we ensure to always
obtain the right memory access.

This issue was found by inspection without having a failing test case.

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=255716&r1=255715&r2=255716&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Tue Dec 15 17:50:04 2015
@@ -1323,10 +1323,10 @@ void ScopStmt::collectCandiateReductionL
   // A load is only a candidate if it cannot escape (thus has only this use)
   if (PossibleLoad0 && PossibleLoad0->getNumUses() == 1)
     if (PossibleLoad0->getParent() == Store->getParent())
-      Loads.push_back(lookupAccessFor(PossibleLoad0));
+      Loads.push_back(&getArrayAccessFor(PossibleLoad0));
   if (PossibleLoad1 && PossibleLoad1->getNumUses() == 1)
     if (PossibleLoad1->getParent() == Store->getParent())
-      Loads.push_back(lookupAccessFor(PossibleLoad1));
+      Loads.push_back(&getArrayAccessFor(PossibleLoad1));
 }
 
 /// @brief Check for reductions in this ScopStmt




More information about the llvm-commits mailing list