diff options
author | Tobias Grosser <tobias@grosser.es> | 2015-12-15 23:50:04 +0000 |
---|---|---|
committer | Tobias Grosser <tobias@grosser.es> | 2015-12-15 23:50:04 +0000 |
commit | 35ec5fbb8cdd125ae52b2199fbbc308e066784db (patch) | |
tree | 50aac1234e98dd72dfa4a6f0cf2ae498632d92d4 | |
parent | 184a4926b3f6740ecf4caa97b965ecf883ddf0eb (diff) | |
download | bcm5719-llvm-35ec5fbb8cdd125ae52b2199fbbc308e066784db.tar.gz bcm5719-llvm-35ec5fbb8cdd125ae52b2199fbbc308e066784db.zip |
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.
llvm-svn: 255716
-rw-r--r-- | polly/lib/Analysis/ScopInfo.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp index 78b3d847e87..b24c1d31fb7 100644 --- a/polly/lib/Analysis/ScopInfo.cpp +++ b/polly/lib/Analysis/ScopInfo.cpp @@ -1323,10 +1323,10 @@ void ScopStmt::collectCandiateReductionLoads( // 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 |