Skip to content

Commit ef99325

Browse files
committed
[pmo] Debride more code that is still in PMO but was only used by DI.
1 parent 95e0c66 commit ef99325

File tree

2 files changed

+1
-45
lines changed

2 files changed

+1
-45
lines changed

lib/SILOptimizer/Mandatory/PMOMemoryUseCollector.cpp

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -135,35 +135,6 @@ PMOMemoryObjectInfo::getPathStringToElement(unsigned Element,
135135
return nullptr;
136136
}
137137

138-
/// If the specified value is a 'let' property in an initializer, return true.
139-
bool PMOMemoryObjectInfo::isElementLetProperty(unsigned Element) const {
140-
// If we aren't representing 'self' in a non-delegating initializer, then we
141-
// can't have 'let' properties.
142-
return IsLet;
143-
}
144-
145-
//===----------------------------------------------------------------------===//
146-
// PMOMemoryUse Implementation
147-
//===----------------------------------------------------------------------===//
148-
149-
/// onlyTouchesTrivialElements - Return true if all of the accessed elements
150-
/// have trivial type.
151-
bool PMOMemoryUse::onlyTouchesTrivialElements(
152-
const PMOMemoryObjectInfo &MI) const {
153-
auto &Module = Inst->getModule();
154-
155-
for (unsigned i = FirstElement, e = i + NumElements; i != e; ++i) {
156-
// Skip 'super.init' bit
157-
if (i == MI.getNumMemoryElements())
158-
return false;
159-
160-
auto EltTy = MI.getElementType(i);
161-
if (!EltTy.isTrivial(Module))
162-
return false;
163-
}
164-
return true;
165-
}
166-
167138
//===----------------------------------------------------------------------===//
168139
// Scalarization Logic
169140
//===----------------------------------------------------------------------===//

lib/SILOptimizer/Mandatory/PMOMemoryUseCollector.h

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,6 @@ class PMOMemoryObjectInfo {
7777
/// This is the base type of the memory allocation.
7878
SILType MemorySILType;
7979

80-
/// True if the memory object being analyzed represents a 'let', which is
81-
/// initialize-only (reassignments are not allowed).
82-
bool IsLet = false;
83-
8480
/// This is the count of elements being analyzed. For memory objects that are
8581
/// tuples, this is the flattened element count. For 'self' members in init
8682
/// methods, this is the local field count (+1 for derive classes).
@@ -108,11 +104,7 @@ class PMOMemoryObjectInfo {
108104
return dyn_cast<AllocBoxInst>(MemoryInst);
109105
}
110106

111-
/// getNumMemoryElements - Return the number of elements, without the extra
112-
/// "super.init" tracker in initializers of derived classes.
113-
unsigned getNumMemoryElements() const {
114-
return NumElements - unsigned(false);
115-
}
107+
unsigned getNumMemoryElements() const { return NumElements; }
116108

117109
/// getElementType - Return the swift type of the specified element.
118110
SILType getElementType(unsigned EltNo) const;
@@ -122,9 +114,6 @@ class PMOMemoryObjectInfo {
122114
/// be determined, return it. Otherwise, return null.
123115
ValueDecl *getPathStringToElement(unsigned Element,
124116
std::string &Result) const;
125-
126-
/// If the specified value is a 'let' property in an initializer, return true.
127-
bool isElementLetProperty(unsigned Element) const;
128117
};
129118

130119
enum PMOUseKind {
@@ -186,10 +175,6 @@ struct PMOMemoryUse {
186175
i < static_cast<unsigned>(FirstElement + NumElements);
187176
}
188177

189-
/// onlyTouchesTrivialElements - Return true if all of the accessed elements
190-
/// have trivial type.
191-
bool onlyTouchesTrivialElements(const PMOMemoryObjectInfo &MemoryInfo) const;
192-
193178
/// getElementBitmask - Return a bitmask with the touched tuple elements
194179
/// set.
195180
APInt getElementBitmask(unsigned NumMemoryTupleElements) const {

0 commit comments

Comments
 (0)