Skip to content

Commit 0a6ccd8

Browse files
authored
Merge pull request #30327 from rintaro/revert-30289
Revert "[semantic-arc-opts] Implement @owned phi web elimination for phi webs with a single phi node that only have copy_value introducers"
2 parents 7c5d74e + fad1b43 commit 0a6ccd8

File tree

5 files changed

+57
-964
lines changed

5 files changed

+57
-964
lines changed

include/swift/Basic/FrozenMultiMap.h

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -91,17 +91,11 @@ class FrozenMultiMap {
9191
frozen = true;
9292
}
9393

94-
/// Reset the frozen multimap in an unfrozen state with its storage cleared.
95-
void reset() {
96-
storage.clear();
97-
frozen = false;
98-
}
99-
10094
unsigned size() const { return storage.size(); }
10195
bool empty() const { return storage.empty(); }
10296

10397
struct iterator : std::iterator<std::forward_iterator_tag,
104-
std::pair<Key, PairToSecondEltRange>> {
98+
std::pair<Key, ArrayRef<Value>>> {
10599
using base_iterator = typename decltype(storage)::iterator;
106100

107101
FrozenMultiMap &map;
@@ -165,11 +159,9 @@ class FrozenMultiMap {
165159
}
166160
};
167161

168-
using RangeType = llvm::iterator_range<iterator>;
169-
170162
/// Return a range of (key, ArrayRef<Value>) pairs. The keys are guaranteed to
171163
/// be in key sorted order and the ArrayRef<Value> are in insertion order.
172-
RangeType getRange() const {
164+
llvm::iterator_range<iterator> getRange() const {
173165
assert(isFrozen() &&
174166
"Can not create range until data structure is frozen?!");
175167
auto *self = const_cast<FrozenMultiMap *>(this);

include/swift/SIL/OwnershipUtils.h

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -598,28 +598,6 @@ struct OwnedValueIntroducer {
598598
return OwnedValueIntroducer(value, *kind);
599599
}
600600

601-
/// Returns true if this owned introducer is able to be converted into a
602-
/// guaranteed form if none of its uses are consuming uses (looking through
603-
/// forwarding uses).
604-
bool isConvertableToGuaranteed() const {
605-
switch (kind) {
606-
case OwnedValueIntroducerKind::Copy:
607-
case OwnedValueIntroducerKind::LoadCopy:
608-
return true;
609-
case OwnedValueIntroducerKind::Apply:
610-
case OwnedValueIntroducerKind::BeginApply:
611-
case OwnedValueIntroducerKind::TryApply:
612-
case OwnedValueIntroducerKind::LoadTake:
613-
case OwnedValueIntroducerKind::Phi:
614-
case OwnedValueIntroducerKind::FunctionArgument:
615-
case OwnedValueIntroducerKind::PartialApplyInit:
616-
case OwnedValueIntroducerKind::AllocBoxInit:
617-
case OwnedValueIntroducerKind::AllocRefInit:
618-
return false;
619-
}
620-
llvm_unreachable("Covered switch isn't covered?!");
621-
}
622-
623601
bool operator==(const OwnedValueIntroducer &other) const {
624602
return value == other.value;
625603
}

0 commit comments

Comments
 (0)