llvm.org GIT mirror llvm / d69942c
[LV] Rename StrideAccesses to AccessStrideInfo (NFC) We now collect all accesses with a constant stride, not just the ones with a stride greater than one. This change was requested in the review of D19984. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275473 91177308-0d34-0410-b5e6-96231b3b80d8 Matthew Simpson 4 years ago
1 changed file(s) with 13 addition(s) and 13 deletion(s). Raw diff Collapse all Expand all
936936 }
937937
938938 /// \brief Collect all the accesses with a constant stride in program order.
939 void collectConstStridedAccesses(
940 MapVector &StrideAccesses,
939 void collectConstStrideAccesses(
940 MapVector &AccessStrideInfo,
941941 const ValueToValueMap &Strides);
942942
943943 /// \brief Returns true if \p Stride is allowed in an interleaved group.
49264926 return true;
49274927 }
49284928
4929 void InterleavedAccessInfo::collectConstStridedAccesses(
4930 MapVector &StrideAccesses,
4929 void InterleavedAccessInfo::collectConstStrideAccesses(
4930 MapVector &AccessStrideInfo,
49314931 const ValueToValueMap &Strides) {
49324932
49334933 auto &DL = TheLoop->getHeader()->getModule()->getDataLayout();
49374937 // blocks in the loop in reverse postorder (i.e., in a topological order).
49384938 // Such an ordering will ensure that any load/store that may be executed
49394939 // before a second load/store will precede the second load/store in
4940 // StrideAccesses.
4940 // AccessStrideInfo.
49414941 LoopBlocksDFS DFS(TheLoop);
49424942 DFS.perform(LI);
49434943 for (BasicBlock *BB : make_range(DFS.beginRPO(), DFS.endRPO()))
49594959 if (!Align)
49604960 Align = DL.getABITypeAlignment(PtrTy->getElementType());
49614961
4962 StrideAccesses[&I] = StrideDescriptor(Stride, Scev, Size, Align);
4962 AccessStrideInfo[&I] = StrideDescriptor(Stride, Scev, Size, Align);
49634963 }
49644964 }
49654965
50035003 const ValueToValueMap &Strides) {
50045004 DEBUG(dbgs() << "LV: Analyzing interleaved accesses...\n");
50055005
5006 // Holds all the stride accesses.
5007 MapVector StrideAccesses;
5008 collectConstStridedAccesses(StrideAccesses, Strides);
5009
5010 if (StrideAccesses.empty())
5006 // Holds all accesses with a constant stride.
5007 MapVector AccessStrideInfo;
5008 collectConstStrideAccesses(AccessStrideInfo, Strides);
5009
5010 if (AccessStrideInfo.empty())
50115011 return;
50125012
50135013 // Collect the dependences in the loop.
50235023 // 1. A and B have the same stride.
50245024 // 2. A and B have the same memory object size.
50255025 // 3. B belongs to the group according to the distance.
5026 for (auto AI = StrideAccesses.rbegin(), E = StrideAccesses.rend(); AI != E;
5027 ++AI) {
5026 for (auto AI = AccessStrideInfo.rbegin(), E = AccessStrideInfo.rend();
5027 AI != E; ++AI) {
50285028 Instruction *A = AI->first;
50295029 StrideDescriptor DesA = AI->second;
50305030