Skip to content

Commit 3e7ab04

Browse files
authored
Merge pull request #28993 from gottesmm/pr-cb357f04ae64bfa666fcb2bc03edb404150a00bc
2 parents 3090333 + 990af4b commit 3e7ab04

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

include/swift/SIL/SILInstruction.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7000,7 +7000,7 @@ class TermInst : public NonValueInstruction {
70007000
}
70017001

70027002
using SuccessorBlockArgumentListTy =
7003-
TransformRange<ConstSuccessorListTy, function_ref<SILPhiArgumentArrayRef(
7003+
TransformRange<ConstSuccessorListTy, function_ref<ArrayRef<SILArgument *>(
70047004
const SILSuccessor &)>>;
70057005

70067006
/// Return the range of Argument arrays for each successor of this

lib/SIL/OperandOwnership.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -466,16 +466,15 @@ OperandOwnershipKindClassifier::visitSwitchEnumInst(SwitchEnumInst *sei) {
466466
// and merge them.
467467
auto mergedKind = ValueOwnershipKind::merge(makeTransformRange(
468468
sei->getSuccessorBlockArgumentLists(),
469-
[&](SILPhiArgumentArrayRef array) -> ValueOwnershipKind {
469+
[&](ArrayRef<SILArgument *> array) -> ValueOwnershipKind {
470470
// If the array is empty, we have a non-payloaded case. Return any.
471471
if (array.empty())
472472
return ValueOwnershipKind::None;
473473

474474
// Otherwise, we should have a single element since a payload is
475475
// a tuple.
476476
assert(std::distance(array.begin(), array.end()) == 1);
477-
SILPhiArgument *arg = array.front();
478-
return arg->getOwnershipKind();
477+
return array.front()->getOwnershipKind();
479478
}));
480479

481480
// If we failed to merge, return an empty map so we will fail to pattern match

lib/SIL/SILInstructions.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,9 +1219,9 @@ bool TermInst::isProgramTerminating() const {
12191219

12201220
TermInst::SuccessorBlockArgumentListTy
12211221
TermInst::getSuccessorBlockArgumentLists() const {
1222-
function_ref<SILPhiArgumentArrayRef(const SILSuccessor &)> op;
1223-
op = [](const SILSuccessor &succ) -> SILPhiArgumentArrayRef {
1224-
return succ.getBB()->getSILPhiArguments();
1222+
function_ref<ArrayRef<SILArgument *>(const SILSuccessor &)> op;
1223+
op = [](const SILSuccessor &succ) -> ArrayRef<SILArgument *> {
1224+
return succ.getBB()->getArguments();
12251225
};
12261226
return SuccessorBlockArgumentListTy(getSuccessors(), op);
12271227
}

lib/SILOptimizer/Mandatory/ClosureLifetimeFixup.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ cleanupDeadTrivialPhiArgs(SILValue initialValue,
143143
if (ReverseInitialWorklist) {
144144
std::reverse(insertedPhis.begin(), insertedPhis.end());
145145
}
146-
SmallVector<SILPhiArgument *, 8> worklist(insertedPhis.begin(),
147-
insertedPhis.end());
146+
SmallVector<SILArgument *, 8> worklist(insertedPhis.begin(),
147+
insertedPhis.end());
148148
sortUnique(insertedPhis);
149149
SmallVector<SILValue, 8> incomingValues;
150150

@@ -189,7 +189,7 @@ cleanupDeadTrivialPhiArgs(SILValue initialValue,
189189
auto *termInst = cast<TermInst>(user);
190190
for (auto succBlockArgList : termInst->getSuccessorBlockArgumentLists()) {
191191
llvm::copy_if(succBlockArgList, std::back_inserter(worklist),
192-
[&](SILPhiArgument *succArg) -> bool {
192+
[&](SILArgument *succArg) -> bool {
193193
auto it = lower_bound(insertedPhis, succArg);
194194
return it != insertedPhis.end() && *it == succArg;
195195
});

lib/SILOptimizer/Mandatory/PredictableMemOpt.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -935,8 +935,9 @@ static bool
935935
terminatorHasAnyKnownPhis(TermInst *ti,
936936
ArrayRef<SILPhiArgument *> insertedPhiNodesSorted) {
937937
for (auto succArgList : ti->getSuccessorBlockArgumentLists()) {
938-
if (llvm::any_of(succArgList, [&](SILPhiArgument *arg) {
939-
return binary_search(insertedPhiNodesSorted, arg);
938+
if (llvm::any_of(succArgList, [&](SILArgument *arg) {
939+
return binary_search(insertedPhiNodesSorted,
940+
cast<SILPhiArgument>(arg));
940941
})) {
941942
return true;
942943
}

0 commit comments

Comments
 (0)