diff options
author | Matthew Simpson <mssimpso@codeaurora.org> | 2016-06-06 14:15:41 +0000 |
---|---|---|
committer | Matthew Simpson <mssimpso@codeaurora.org> | 2016-06-06 14:15:41 +0000 |
commit | e3e3b994ae93dea9cc5dfb40bb5e74d8f16476f7 (patch) | |
tree | 96c8ddcc2986a25123ca4667bc20967ca98d29c5 /llvm/lib/Analysis/LoopAccessAnalysis.cpp | |
parent | c0ece9b67e222d8842acb8cb0f5954a4dca5cae7 (diff) | |
download | bcm5719-llvm-e3e3b994ae93dea9cc5dfb40bb5e74d8f16476f7.tar.gz bcm5719-llvm-e3e3b994ae93dea9cc5dfb40bb5e74d8f16476f7.zip |
[LAA] Use load and store vectors (NFC)
Contributed-by: Aditya Kumar <hiraditya@msn.com>
Differential Revision: http://reviews.llvm.org/D20953
llvm-svn: 271895
Diffstat (limited to 'llvm/lib/Analysis/LoopAccessAnalysis.cpp')
-rw-r--r-- | llvm/lib/Analysis/LoopAccessAnalysis.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/llvm/lib/Analysis/LoopAccessAnalysis.cpp b/llvm/lib/Analysis/LoopAccessAnalysis.cpp index 895c47e759f..a0df64b4d0a 100644 --- a/llvm/lib/Analysis/LoopAccessAnalysis.cpp +++ b/llvm/lib/Analysis/LoopAccessAnalysis.cpp @@ -1480,12 +1480,11 @@ bool LoopAccessInfo::canAnalyzeLoop() { void LoopAccessInfo::analyzeLoop(const ValueToValueMap &Strides) { - typedef SmallVector<Value*, 16> ValueVector; typedef SmallPtrSet<Value*, 16> ValueSet; - // Holds the Load and Store *instructions*. - ValueVector Loads; - ValueVector Stores; + // Holds the Load and Store instructions. + SmallVector<LoadInst *, 16> Loads; + SmallVector<StoreInst *, 16> Stores; // Holds all the different accesses in the loop. unsigned NumReads = 0; @@ -1580,10 +1579,8 @@ void LoopAccessInfo::analyzeLoop(const ValueToValueMap &Strides) { // writes and between reads and writes, but not between reads and reads. ValueSet Seen; - ValueVector::iterator I, IE; - for (I = Stores.begin(), IE = Stores.end(); I != IE; ++I) { - StoreInst *ST = cast<StoreInst>(*I); - Value* Ptr = ST->getPointerOperand(); + for (StoreInst *ST : Stores) { + Value *Ptr = ST->getPointerOperand(); // Check for store to loop invariant address. StoreToLoopInvariantAddress |= isUniform(Ptr); // If we did *not* see this pointer before, insert it to the read-write @@ -1610,9 +1607,8 @@ void LoopAccessInfo::analyzeLoop(const ValueToValueMap &Strides) { return; } - for (I = Loads.begin(), IE = Loads.end(); I != IE; ++I) { - LoadInst *LD = cast<LoadInst>(*I); - Value* Ptr = LD->getPointerOperand(); + for (LoadInst *LD : Loads) { + Value *Ptr = LD->getPointerOperand(); // If we did *not* see this pointer before, insert it to the // read list. If we *did* see it before, then it is already in // the read-write list. This allows us to vectorize expressions |