Skip to content

Commit

Permalink
[LoopVersioning] Update setAliasChecks to take ArrayRef argument (NFC).
Browse files Browse the repository at this point in the history
This cleanup was suggested as part of D78458.
  • Loading branch information
fhahn committed Apr 30, 2020
1 parent b74c6d2 commit 19ab53f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion llvm/include/llvm/Transforms/Utils/LoopVersioning.h
Expand Up @@ -30,6 +30,8 @@ typedef std::pair<const RuntimeCheckingPtrGroup *,
const RuntimeCheckingPtrGroup *>
RuntimePointerCheck;

template <typename T> class ArrayRef;

/// This class emits a version of the loop where run-time checks ensure
/// that may-alias pointers can't overlap.
///
Expand Down Expand Up @@ -74,7 +76,7 @@ class LoopVersioning {
Loop *getNonVersionedLoop() { return NonVersionedLoop; }

/// Sets the runtime alias checks for versioning the loop.
void setAliasChecks(SmallVector<RuntimePointerCheck, 4> Checks);
void setAliasChecks(ArrayRef<RuntimePointerCheck> Checks);

/// Sets the runtime SCEV checks for versioning the loop.
void setSCEVChecks(SCEVUnionPredicate Check);
Expand Down
6 changes: 3 additions & 3 deletions llvm/lib/Transforms/Utils/LoopVersioning.cpp
Expand Up @@ -13,6 +13,7 @@
//===----------------------------------------------------------------------===//

#include "llvm/Transforms/Utils/LoopVersioning.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/Analysis/LoopAccessAnalysis.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/ScalarEvolutionExpander.h"
Expand Down Expand Up @@ -44,9 +45,8 @@ LoopVersioning::LoopVersioning(const LoopAccessInfo &LAI, Loop *L, LoopInfo *LI,
}
}

void LoopVersioning::setAliasChecks(
SmallVector<RuntimePointerCheck, 4> Checks) {
AliasChecks = std::move(Checks);
void LoopVersioning::setAliasChecks(ArrayRef<RuntimePointerCheck> Checks) {
AliasChecks = {Checks.begin(), Checks.end()};
}

void LoopVersioning::setSCEVChecks(SCEVUnionPredicate Check) {
Expand Down

0 comments on commit 19ab53f

Please sign in to comment.