diff options
| author | Adam Nemet <anemet@apple.com> | 2015-04-07 03:35:26 +0000 |
|---|---|---|
| committer | Adam Nemet <anemet@apple.com> | 2015-04-07 03:35:26 +0000 |
| commit | 51870d16e4663a79cf8ebf6b2d860c2695b3d091 (patch) | |
| tree | fba2dac3b7de8161ccda1167f334fab3e6852fc7 | |
| parent | a1384912b212bc743f95a7240ebe9bdce339c952 (diff) | |
| download | bcm5719-llvm-51870d16e4663a79cf8ebf6b2d860c2695b3d091.tar.gz bcm5719-llvm-51870d16e4663a79cf8ebf6b2d860c2695b3d091.zip | |
[LoopAccesses] New API to query if memchecks are necessary after partitioning
This is used by Loop Distribution.
llvm-svn: 234283
| -rw-r--r-- | llvm/include/llvm/Analysis/LoopAccessAnalysis.h | 4 | ||||
| -rw-r--r-- | llvm/lib/Analysis/LoopAccessAnalysis.cpp | 11 |
2 files changed, 15 insertions, 0 deletions
diff --git a/llvm/include/llvm/Analysis/LoopAccessAnalysis.h b/llvm/include/llvm/Analysis/LoopAccessAnalysis.h index 0a9dc07102e..19b400900c5 100644 --- a/llvm/include/llvm/Analysis/LoopAccessAnalysis.h +++ b/llvm/include/llvm/Analysis/LoopAccessAnalysis.h @@ -339,6 +339,10 @@ public: bool needsChecking(unsigned I, unsigned J, const SmallVectorImpl<int> *PtrPartition) const; + /// \brief Return true if any pointer requires run-time checking according + /// to needsChecking. + bool needsAnyChecking(const SmallVectorImpl<int> *PtrPartition) const; + /// \brief Print the list run-time memory checks necessary. /// /// If \p PtrPartition is set, it contains the partition number for diff --git a/llvm/lib/Analysis/LoopAccessAnalysis.cpp b/llvm/lib/Analysis/LoopAccessAnalysis.cpp index 159efff1a70..ae561d7a26a 100644 --- a/llvm/lib/Analysis/LoopAccessAnalysis.cpp +++ b/llvm/lib/Analysis/LoopAccessAnalysis.cpp @@ -177,6 +177,17 @@ void LoopAccessInfo::RuntimePointerCheck::print( } } +bool LoopAccessInfo::RuntimePointerCheck::needsAnyChecking( + const SmallVectorImpl<int> *PtrPartition) const { + unsigned NumPointers = Pointers.size(); + + for (unsigned I = 0; I < NumPointers; ++I) + for (unsigned J = I + 1; J < NumPointers; ++J) + if (needsChecking(I, J, PtrPartition)) + return true; + return false; +} + namespace { /// \brief Analyses memory accesses in a loop. /// |

