forked from OSchip/llvm-project
[LoopAccesses] New API to query if memchecks are necessary after partitioning
This is used by Loop Distribution. llvm-svn: 234283
This commit is contained in:
parent
a1384912b2
commit
51870d16e4
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
///
|
||||
|
|
Loading…
Reference in New Issue