diff options
author | Silviu Baranga <silviu.baranga@arm.com> | 2015-07-13 14:48:24 +0000 |
---|---|---|
committer | Silviu Baranga <silviu.baranga@arm.com> | 2015-07-13 14:48:24 +0000 |
commit | a647c30f886bcc82034479b4ad563ec91c4382cf (patch) | |
tree | 15b00926c12a1738d42e5eb96fa02c631b0b4c97 /llvm/lib/Analysis | |
parent | c1d63f7499df012a52672620da530f3b45f23d50 (diff) | |
download | bcm5719-llvm-a647c30f886bcc82034479b4ad563ec91c4382cf.tar.gz bcm5719-llvm-a647c30f886bcc82034479b4ad563ec91c4382cf.zip |
Cleanup after r241809 - remove uncessary call to std::sort
Summary:
The iteration order within a member of DepCands is deterministic
and therefore we don't have to sort the accesses within a member.
We also don't have to copy the indices of the pointers into a
vector, since we can iterate over the members of the class.
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D11145
llvm-svn: 242033
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r-- | llvm/lib/Analysis/LoopAccessAnalysis.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/llvm/lib/Analysis/LoopAccessAnalysis.cpp b/llvm/lib/Analysis/LoopAccessAnalysis.cpp index 78a8b20f78a..79dac048921 100644 --- a/llvm/lib/Analysis/LoopAccessAnalysis.cpp +++ b/llvm/lib/Analysis/LoopAccessAnalysis.cpp @@ -240,19 +240,14 @@ void LoopAccessInfo::RuntimePointerCheck::groupChecks( SmallVector<CheckingPtrGroup, 2> Groups; auto LeaderI = DepCands.findValue(DepCands.getLeaderValue(Access)); - SmallVector<unsigned, 2> MemberIndices; - - // Get all indeces of the members of this equivalence class and sort them. - // This will allow us to process all accesses in the order in which they - // were added to the RuntimePointerCheck. + // Because DepCands is constructed by visiting accesses in the order in + // which they appear in alias sets (which is deterministic) and the + // iteration order within an equivalence class member is only dependent on + // the order in which unions and insertions are performed on the + // equivalence class, the iteration order is deterministic. for (auto MI = DepCands.member_begin(LeaderI), ME = DepCands.member_end(); MI != ME; ++MI) { unsigned Pointer = PositionMap[MI->getPointer()]; - MemberIndices.push_back(Pointer); - } - std::sort(MemberIndices.begin(), MemberIndices.end()); - - for (unsigned Pointer : MemberIndices) { bool Merged = false; // Mark this pointer as seen. Seen.insert(Pointer); |