[pmo] Eliminate dead flat namespace tuple numbering from PMOMemoryUseCollector.

TLDR: This does not eliminate the struct/tuple flat namespace from Predictable
Mem Opts. Just the tuple specific flat namespace code from PMOMemoryUseCollector
that we were computing and then throwing away. I explain below in more detail.

First note that this is cruft from when def-init and pmo were one pass. What we
were doing here was maintaing a flattened tuple namespace while we were
collecting uses in PMOMemoryUseCollector. We never actually used them for
anything since we recomputed this information including information about
structs in PMO itself! So this information was truly completely dead.

This commit removes that and related logic and from a maintenance standpoint
makes PMOMemoryUseCollector a simple visitor that doesn't have any real special
logic in it beyond the tuple scalarization.
This commit is contained in:
Michael Gottesman
2019-01-04 11:50:14 -08:00
parent 480b433ba4
commit 7175e1790a
3 changed files with 55 additions and 115 deletions

View File

@@ -516,8 +516,7 @@ SILValue AvailableValueAggregator::handlePrimitiveValue(SILType LoadTy,
if (!Val) {
auto *Load =
B.createLoad(Loc, Address, LoadOwnershipQualifier::Unqualified);
Uses.push_back(PMOMemoryUse(Load, PMOUseKind::Load, FirstElt,
getNumSubElements(Load->getType(), M)));
Uses.emplace_back(Load, PMOUseKind::Load);
return Load;
}