Skip to content

Commit 0190f06

Browse files
committed
Revert "Merge pull request #40783 from gottesmm/release/5.6/move-function-defer-upstreaming"
This reverts commit 9f779f0, reversing changes made to ba3aa14. We don't actually need this in 5.6. I am also in a forthcoming commit, going to turn off _move since we don't need it in 5.6.
1 parent 93d7b6e commit 0190f06

16 files changed

+409
-3013
lines changed

include/swift/Basic/BlotSetVector.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ class BlotSetVector {
113113
return {index, true};
114114
}
115115

116-
bool count(const ValueT &value) const { return map.count(value); }
116+
bool count(const ValueT &value) { return map.count(value); }
117117

118118
/// Replace \p value1 with \p value2 placing \p value2 into the position in
119119
/// the array where value1 used to be. If \p value2 is already in the set,

include/swift/Demangling/Demangle.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ enum class FunctionSigSpecializationParamKind : unsigned {
108108
ClosureProp = 5,
109109
BoxToValue = 6,
110110
BoxToStack = 7,
111-
InOutToOut = 8,
112111

113112
// Option Set Flags use bits 6-31. This gives us 26 bits to use for option
114113
// flags.
@@ -145,7 +144,6 @@ enum class SpecializationPass : uint8_t {
145144
CapturePropagation,
146145
FunctionSignatureOpts,
147146
GenericSpecializer,
148-
MoveDiagnosticInOutToOut,
149147
};
150148

151149
static inline char encodeSpecializationPass(SpecializationPass Pass) {

include/swift/SIL/SILCloner.h

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,6 @@ class SILCloner : protected SILInstructionVisitor<ImplClass> {
128128
ArrayRef<SILValue> entryArgs,
129129
bool replaceOriginalFunctionInPlace = false);
130130

131-
/// The same as clone function body, except the caller can provide a callback
132-
/// that allows for an entry arg to be assigned to a custom old argument. This
133-
/// is useful if one re-arranges parameters when converting from inout to out.
134-
void
135-
cloneFunctionBody(SILFunction *F, SILBasicBlock *clonedEntryBB,
136-
ArrayRef<SILValue> entryArgs,
137-
llvm::function_ref<SILValue(SILValue)> entryArgToOldArgMap);
138-
139131
/// MARK: Callback utilities used from CRTP extensions during cloning.
140132
/// These should only be called from within an instruction cloning visitor.
141133

@@ -621,29 +613,6 @@ void SILCloner<ImplClass>::cloneFunctionBody(SILFunction *F,
621613
commonFixUp(F);
622614
}
623615

624-
template <typename ImplClass>
625-
void SILCloner<ImplClass>::cloneFunctionBody(
626-
SILFunction *F, SILBasicBlock *clonedEntryBB, ArrayRef<SILValue> entryArgs,
627-
llvm::function_ref<SILValue(SILValue)> entryArgIndexToOldArgIndex) {
628-
assert(F != clonedEntryBB->getParent() && "Must clone into a new function.");
629-
assert(BBMap.empty() && "This API does not allow clients to map blocks.");
630-
assert(ValueMap.empty() && "Stale ValueMap.");
631-
632-
assert(entryArgs.size() == F->getArguments().size());
633-
for (unsigned i = 0, e = entryArgs.size(); i != e; ++i) {
634-
ValueMap[entryArgIndexToOldArgIndex(entryArgs[i])] = entryArgs[i];
635-
}
636-
637-
BBMap.insert(std::make_pair(&*F->begin(), clonedEntryBB));
638-
639-
Builder.setInsertionPoint(clonedEntryBB);
640-
641-
// This will layout all newly cloned blocks immediate after clonedEntryBB.
642-
visitBlocksDepthFirst(&*F->begin());
643-
644-
commonFixUp(F);
645-
}
646-
647616
template<typename ImplClass>
648617
void SILCloner<ImplClass>::clonePhiArgs(SILBasicBlock *oldBB) {
649618
auto *mappedBB = BBMap[oldBB];

include/swift/SIL/SILFunction.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,19 +1029,6 @@ class SILFunction
10291029
/// generic.
10301030
SubstitutionMap getForwardingSubstitutionMap();
10311031

1032-
/// Returns true if this SILFunction must be a defer statement.
1033-
///
1034-
/// NOTE: This may return false for defer statements that have been
1035-
/// deserialized without a DeclContext. This means that this is guaranteed to
1036-
/// be correct for SILFunctions in Raw SIL that were not deserialized as
1037-
/// canonical. Thus one can use it for diagnostics.
1038-
bool isDefer() const {
1039-
if (auto *dc = getDeclContext())
1040-
if (auto *decl = dyn_cast_or_null<FuncDecl>(dc->getAsDecl()))
1041-
return decl->isDeferBody();
1042-
return false;
1043-
}
1044-
10451032
//===--------------------------------------------------------------------===//
10461033
// Block List Access
10471034
//===--------------------------------------------------------------------===//

include/swift/SILOptimizer/Utils/SpecializationMangler.h

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -62,24 +62,20 @@ class FunctionSignatureSpecializationMangler : public SpecializationMangler {
6262
using ArgumentModifierIntBase = uint16_t;
6363
enum class ArgumentModifier : ArgumentModifierIntBase {
6464
// Option Space 4 bits (i.e. 16 options).
65-
Unmodified = 0,
66-
ConstantProp = 1,
67-
ClosureProp = 2,
68-
BoxToValue = 3,
69-
BoxToStack = 4,
70-
InOutToOut = 5,
71-
72-
First_Option = 0,
73-
Last_Option = 31,
65+
Unmodified=0,
66+
ConstantProp=1,
67+
ClosureProp=2,
68+
BoxToValue=3,
69+
BoxToStack=4,
70+
First_Option=0, Last_Option=31,
7471

7572
// Option Set Space. 12 bits (i.e. 12 option).
76-
Dead = 32,
77-
OwnedToGuaranteed = 64,
78-
SROA = 128,
79-
GuaranteedToOwned = 256,
80-
ExistentialToGeneric = 512,
81-
First_OptionSetEntry = 32,
82-
LastOptionSetEntry = 32768,
73+
Dead=32,
74+
OwnedToGuaranteed=64,
75+
SROA=128,
76+
GuaranteedToOwned=256,
77+
ExistentialToGeneric=512,
78+
First_OptionSetEntry=32, LastOptionSetEntry=32768,
8379
};
8480

8581
using ArgInfo = std::pair<ArgumentModifierIntBase,
@@ -106,7 +102,6 @@ class FunctionSignatureSpecializationMangler : public SpecializationMangler {
106102
void setArgumentSROA(unsigned OrigArgIdx);
107103
void setArgumentBoxToValue(unsigned OrigArgIdx);
108104
void setArgumentBoxToStack(unsigned OrigArgIdx);
109-
void setArgumentInOutToOut(unsigned OrigArgIdx);
110105
void setReturnValueOwnedToUnowned();
111106

112107
std::string mangle();

lib/Demangling/Demangler.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2939,11 +2939,6 @@ NodePointer Demangler::demangleFuncSpecParam(Node::Kind Kind) {
29392939
return addChild(Param, createNode(
29402940
Node::Kind::FunctionSignatureSpecializationParamKind,
29412941
unsigned(FunctionSigSpecializationParamKind::BoxToStack)));
2942-
case 'r':
2943-
return addChild(
2944-
Param,
2945-
createNode(Node::Kind::FunctionSignatureSpecializationParamKind,
2946-
unsigned(FunctionSigSpecializationParamKind::InOutToOut)));
29472942
default:
29482943
return nullptr;
29492944
}

lib/Demangling/NodePrinter.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,6 @@ void NodePrinter::printFunctionSigSpecializationParams(NodePointer Node,
10121012
switch (K) {
10131013
case FunctionSigSpecializationParamKind::BoxToValue:
10141014
case FunctionSigSpecializationParamKind::BoxToStack:
1015-
case FunctionSigSpecializationParamKind::InOutToOut:
10161015
print(Node->getChild(Idx++), depth + 1);
10171016
break;
10181017
case FunctionSigSpecializationParamKind::ConstantPropFunction:
@@ -1583,9 +1582,6 @@ NodePointer NodePrinter::print(NodePointer Node, unsigned depth,
15831582
case FunctionSigSpecializationParamKind::BoxToStack:
15841583
Printer << "Stack Promoted from Box";
15851584
return nullptr;
1586-
case FunctionSigSpecializationParamKind::InOutToOut:
1587-
Printer << "InOut Converted to Out";
1588-
return nullptr;
15891585
case FunctionSigSpecializationParamKind::ConstantPropFunction:
15901586
Printer << "Constant Propagated Function";
15911587
return nullptr;

lib/Demangling/OldDemangler.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -645,11 +645,6 @@ class OldDemangler {
645645
if (!result)
646646
return nullptr;
647647
param->addChild(result, Factory);
648-
} else if (Mangled.nextIf("r_")) {
649-
auto result = FUNCSIGSPEC_CREATE_PARAM_KIND(InOutToOut);
650-
if (!result)
651-
return nullptr;
652-
param->addChild(result, Factory);
653648
} else {
654649
// Otherwise handle option sets.
655650
unsigned Value = 0;

lib/Demangling/Remangler.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,9 +1407,6 @@ Remangler::mangleFunctionSignatureSpecializationParam(Node *node,
14071407
case FunctionSigSpecializationParamKind::BoxToStack:
14081408
Buffer << 's';
14091409
break;
1410-
case FunctionSigSpecializationParamKind::InOutToOut:
1411-
Buffer << 'r';
1412-
break;
14131410
case FunctionSigSpecializationParamKind::SROA:
14141411
Buffer << 'x';
14151412
break;

0 commit comments

Comments
 (0)