aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/LoopAccessAnalysis.cpp
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2020-10-02 13:53:21 +0100
committerSimon Pilgrim <llvm-dev@redking.me.uk>2020-10-02 13:56:30 +0100
commit71b89b14934d99f32da150f62042aa9e09113b5f (patch)
tree5f285fdb2f9f0189d0993cfb529cddb35b2809a4 /llvm/lib/Analysis/LoopAccessAnalysis.cpp
parentbb448a248371b48dbca8d647b7aaf9393154cf3d (diff)
downloadllvm-71b89b14934d99f32da150f62042aa9e09113b5f.zip
llvm-71b89b14934d99f32da150f62042aa9e09113b5f.tar.gz
llvm-71b89b14934d99f32da150f62042aa9e09113b5f.tar.bz2
LoopAccessAnalysis.cpp - use const reference in for-range loops. NFCI.
Diffstat (limited to 'llvm/lib/Analysis/LoopAccessAnalysis.cpp')
-rw-r--r--llvm/lib/Analysis/LoopAccessAnalysis.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/LoopAccessAnalysis.cpp b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
index 4d3de1e..9d74060 100644
--- a/llvm/lib/Analysis/LoopAccessAnalysis.cpp
+++ b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
@@ -730,7 +730,7 @@ bool AccessAnalysis::canCheckPtrAtRT(RuntimePointerChecking &RtCheck,
// First, count how many write and read accesses are in the alias set. Also
// collect MemAccessInfos for later.
SmallVector<MemAccessInfo, 4> AccessInfos;
- for (auto A : AS) {
+ for (const auto &A : AS) {
Value *Ptr = A.getValue();
bool IsWrite = Accesses.count(MemAccessInfo(Ptr, true));
@@ -864,7 +864,7 @@ void AccessAnalysis::processMemAccesses() {
// compatibility and potential for underlying-object overlap. As a result, we
// only need to check for potential pointer dependencies within each alias
// set.
- for (auto &AS : AST) {
+ for (const auto &AS : AST) {
// Note that both the alias-set tracker and the alias sets themselves used
// linked lists internally and so the iteration order here is deterministic
// (matching the original instruction order within each set).
@@ -884,12 +884,12 @@ void AccessAnalysis::processMemAccesses() {
bool UseDeferred = SetIteration > 0;
PtrAccessSet &S = UseDeferred ? DeferredAccesses : Accesses;
- for (auto AV : AS) {
+ for (const auto &AV : AS) {
Value *Ptr = AV.getValue();
// For a single memory access in AliasSetTracker, Accesses may contain
// both read and write, and they both need to be handled for CheckDeps.
- for (auto AC : S) {
+ for (const auto &AC : S) {
if (AC.getPointer() != Ptr)
continue;