mirror of
https://github.com/RPCS3/llvm.git
synced 2025-04-13 03:21:07 +00:00
[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
This commit is contained in:
parent
843f7ad617
commit
d69942c12d
@ -937,8 +937,8 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// \brief Collect all the accesses with a constant stride in program order.
|
/// \brief Collect all the accesses with a constant stride in program order.
|
||||||
void collectConstStridedAccesses(
|
void collectConstStrideAccesses(
|
||||||
MapVector<Instruction *, StrideDescriptor> &StrideAccesses,
|
MapVector<Instruction *, StrideDescriptor> &AccessStrideInfo,
|
||||||
const ValueToValueMap &Strides);
|
const ValueToValueMap &Strides);
|
||||||
|
|
||||||
/// \brief Returns true if \p Stride is allowed in an interleaved group.
|
/// \brief Returns true if \p Stride is allowed in an interleaved group.
|
||||||
@ -4927,8 +4927,8 @@ bool LoopVectorizationLegality::blockCanBePredicated(
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void InterleavedAccessInfo::collectConstStridedAccesses(
|
void InterleavedAccessInfo::collectConstStrideAccesses(
|
||||||
MapVector<Instruction *, StrideDescriptor> &StrideAccesses,
|
MapVector<Instruction *, StrideDescriptor> &AccessStrideInfo,
|
||||||
const ValueToValueMap &Strides) {
|
const ValueToValueMap &Strides) {
|
||||||
|
|
||||||
auto &DL = TheLoop->getHeader()->getModule()->getDataLayout();
|
auto &DL = TheLoop->getHeader()->getModule()->getDataLayout();
|
||||||
@ -4938,7 +4938,7 @@ void InterleavedAccessInfo::collectConstStridedAccesses(
|
|||||||
// blocks in the loop in reverse postorder (i.e., in a topological order).
|
// blocks in the loop in reverse postorder (i.e., in a topological order).
|
||||||
// Such an ordering will ensure that any load/store that may be executed
|
// Such an ordering will ensure that any load/store that may be executed
|
||||||
// before a second load/store will precede the second load/store in
|
// before a second load/store will precede the second load/store in
|
||||||
// StrideAccesses.
|
// AccessStrideInfo.
|
||||||
LoopBlocksDFS DFS(TheLoop);
|
LoopBlocksDFS DFS(TheLoop);
|
||||||
DFS.perform(LI);
|
DFS.perform(LI);
|
||||||
for (BasicBlock *BB : make_range(DFS.beginRPO(), DFS.endRPO()))
|
for (BasicBlock *BB : make_range(DFS.beginRPO(), DFS.endRPO()))
|
||||||
@ -4960,7 +4960,7 @@ void InterleavedAccessInfo::collectConstStridedAccesses(
|
|||||||
if (!Align)
|
if (!Align)
|
||||||
Align = DL.getABITypeAlignment(PtrTy->getElementType());
|
Align = DL.getABITypeAlignment(PtrTy->getElementType());
|
||||||
|
|
||||||
StrideAccesses[&I] = StrideDescriptor(Stride, Scev, Size, Align);
|
AccessStrideInfo[&I] = StrideDescriptor(Stride, Scev, Size, Align);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5004,11 +5004,11 @@ void InterleavedAccessInfo::analyzeInterleaving(
|
|||||||
const ValueToValueMap &Strides) {
|
const ValueToValueMap &Strides) {
|
||||||
DEBUG(dbgs() << "LV: Analyzing interleaved accesses...\n");
|
DEBUG(dbgs() << "LV: Analyzing interleaved accesses...\n");
|
||||||
|
|
||||||
// Holds all the stride accesses.
|
// Holds all accesses with a constant stride.
|
||||||
MapVector<Instruction *, StrideDescriptor> StrideAccesses;
|
MapVector<Instruction *, StrideDescriptor> AccessStrideInfo;
|
||||||
collectConstStridedAccesses(StrideAccesses, Strides);
|
collectConstStrideAccesses(AccessStrideInfo, Strides);
|
||||||
|
|
||||||
if (StrideAccesses.empty())
|
if (AccessStrideInfo.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Collect the dependences in the loop.
|
// Collect the dependences in the loop.
|
||||||
@ -5024,8 +5024,8 @@ void InterleavedAccessInfo::analyzeInterleaving(
|
|||||||
// 1. A and B have the same stride.
|
// 1. A and B have the same stride.
|
||||||
// 2. A and B have the same memory object size.
|
// 2. A and B have the same memory object size.
|
||||||
// 3. B belongs to the group according to the distance.
|
// 3. B belongs to the group according to the distance.
|
||||||
for (auto AI = StrideAccesses.rbegin(), E = StrideAccesses.rend(); AI != E;
|
for (auto AI = AccessStrideInfo.rbegin(), E = AccessStrideInfo.rend();
|
||||||
++AI) {
|
AI != E; ++AI) {
|
||||||
Instruction *A = AI->first;
|
Instruction *A = AI->first;
|
||||||
StrideDescriptor DesA = AI->second;
|
StrideDescriptor DesA = AI->second;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user