[llvm] 19ab53f - [LoopVersioning] Update setAliasChecks to take ArrayRef argument (NFC).

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 30 14:22:21 PDT 2020


Author: Florian Hahn
Date: 2020-04-30T22:17:12+01:00
New Revision: 19ab53f1e2c3e459f2844b76b08a22806423798c

URL: https://github.com/llvm/llvm-project/commit/19ab53f1e2c3e459f2844b76b08a22806423798c
DIFF: https://github.com/llvm/llvm-project/commit/19ab53f1e2c3e459f2844b76b08a22806423798c.diff

LOG: [LoopVersioning] Update setAliasChecks to take ArrayRef argument (NFC).

This cleanup was suggested as part of D78458.

Added: 
    

Modified: 
    llvm/include/llvm/Transforms/Utils/LoopVersioning.h
    llvm/lib/Transforms/Utils/LoopVersioning.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Transforms/Utils/LoopVersioning.h b/llvm/include/llvm/Transforms/Utils/LoopVersioning.h
index 650d3ab0c920..1efdcc65b39a 100644
--- a/llvm/include/llvm/Transforms/Utils/LoopVersioning.h
+++ b/llvm/include/llvm/Transforms/Utils/LoopVersioning.h
@@ -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.
 ///
@@ -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);

diff  --git a/llvm/lib/Transforms/Utils/LoopVersioning.cpp b/llvm/lib/Transforms/Utils/LoopVersioning.cpp
index 2ed54d55552c..ce0fb62603ec 100644
--- a/llvm/lib/Transforms/Utils/LoopVersioning.cpp
+++ b/llvm/lib/Transforms/Utils/LoopVersioning.cpp
@@ -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"
@@ -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) {


        


More information about the llvm-commits mailing list