Skip to content

Commit ed623d7

Browse files
committed
[NFC] Shortened SIL [init] flag.
Instead of writing out [initalization] for some instructions, use [init] everywhere.
1 parent b0de482 commit ed623d7

File tree

247 files changed

+1527
-1527
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

247 files changed

+1527
-1527
lines changed

docs/DifferentiableProgrammingImplementation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,7 @@ sil hidden [ossa] @$s4main7genericyxxlF : $@convention(thin) <T> (@in_guaranteed
885885
// %1 // users: %3, %2
886886
bb0(%0 : $*T, %1 : $*T):
887887
debug_value_addr %1 : $*T, let, name "x", argno 1 // id: %2
888-
copy_addr %1 to [initialization] %0 : $*T // id: %3
888+
copy_addr %1 to [init] %0 : $*T // id: %3
889889
%4 = tuple () // user: %5
890890
return %4 : $() // id: %5
891891
} // end sil function '$s4main7genericyxxlF'

docs/SIL.rst

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4169,7 +4169,7 @@ assign_by_wrapper
41694169

41704170
sil-instruction ::= 'assign_by_wrapper' sil-operand 'to' mode? sil-operand ',' 'init' sil-operand ',' 'set' sil-operand
41714171

4172-
mode ::= '[initialization]' | '[assign]' | '[assign_wrapped_value]'
4172+
mode ::= '[init]' | '[assign]' | '[assign_wrapped_value]'
41734173

41744174
assign_by_wrapper %0 : $S to %1 : $*T, init %2 : $F, set %3 : $G
41754175
// $S can be a value or address type
@@ -4286,9 +4286,9 @@ copy_addr
42864286
::
42874287

42884288
sil-instruction ::= 'copy_addr' '[take]'? sil-value
4289-
'to' '[initialization]'? sil-operand
4289+
'to' '[init]'? sil-operand
42904290

4291-
copy_addr [take] %0 to [initialization] %1 : $*T
4291+
copy_addr [take] %0 to [init] %1 : $*T
42924292
// %0 and %1 must be of the same $*T address type
42934293

42944294
Loads the value at address ``%0`` from memory and assigns a copy of it back into
@@ -4307,11 +4307,11 @@ is equivalent to::
43074307

43084308
except that ``copy_addr`` may be used even if ``%0`` is of an address-only
43094309
type. The ``copy_addr`` may be given one or both of the ``[take]`` or
4310-
``[initialization]`` attributes:
4310+
``[init]`` attributes:
43114311

43124312
* ``[take]`` destroys the value at the source address in the course of the
43134313
copy.
4314-
* ``[initialization]`` indicates that the destination address is uninitialized.
4314+
* ``[init]`` indicates that the destination address is uninitialized.
43154315
Without the attribute, the destination address is treated as already
43164316
initialized, and the existing value will be destroyed before the new value
43174317
is stored.
@@ -4329,15 +4329,15 @@ operations::
43294329
store %new to %1 : $*T
43304330

43314331
// copy-initialization
4332-
copy_addr %0 to [initialization] %1 : $*T
4332+
copy_addr %0 to [init] %1 : $*T
43334333
// is equivalent to:
43344334
%new = load %0 : $*T
43354335
strong_retain %new : $T
43364336
// no load/release of %old!
43374337
store %new to %1 : $*T
43384338

43394339
// take-initialization
4340-
copy_addr [take] %0 to [initialization] %1 : $*T
4340+
copy_addr [take] %0 to [init] %1 : $*T
43414341
// is equivalent to:
43424342
%new = load %0 : $*T
43434343
// no retain of %new!
@@ -4355,9 +4355,9 @@ explicit_copy_addr
43554355
::
43564356

43574357
sil-instruction ::= 'explicit_copy_addr' '[take]'? sil-value
4358-
'to' '[initialization]'? sil-operand
4358+
'to' '[init]'? sil-operand
43594359

4360-
explicit_copy_addr [take] %0 to [initialization] %1 : $*T
4360+
explicit_copy_addr [take] %0 to [init] %1 : $*T
43614361
// %0 and %1 must be of the same $*T address type
43624362

43634363
This instruction is exactly the same as `copy_addr`_ except that it has special
@@ -4789,14 +4789,14 @@ store_weak
47894789

47904790
::
47914791

4792-
sil-instruction ::= 'store_weak' sil-value 'to' '[initialization]'? sil-operand
4792+
sil-instruction ::= 'store_weak' sil-value 'to' '[init]'? sil-operand
47934793

4794-
store_weak %0 to [initialization] %1 : $*@sil_weak Optional<T>
4794+
store_weak %0 to [init] %1 : $*@sil_weak Optional<T>
47954795
// $T must be an optional wrapping a reference type
47964796

47974797
Initializes or reassigns a weak reference. The operand may be ``nil``.
47984798

4799-
If ``[initialization]`` is given, the weak reference must currently either be
4799+
If ``[init]`` is given, the weak reference must currently either be
48004800
uninitialized or destroyed. If it is not given, the weak reference must
48014801
currently be initialized. After the evaluation:
48024802

@@ -6019,7 +6019,7 @@ an `inject_enum_addr`_ instruction::
60196019
entry(%0 : $*AddressOnlyEnum, %1 : $*AddressOnlyType):
60206020
// Store the data argument for the case.
60216021
%2 = init_enum_data_addr %0 : $*AddressOnlyEnum, #AddressOnlyEnum.HasData!enumelt
6022-
copy_addr [take] %2 to [initialization] %1 : $*AddressOnlyType
6022+
copy_addr [take] %2 to [init] %1 : $*AddressOnlyType
60236023
// Inject the tag.
60246024
inject_enum_addr %0 : $*AddressOnlyEnum, #AddressOnlyEnum.HasData!enumelt
60256025
return

docs/proposals/InoutCOWOptimization.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ To work with opaque types, ``copy_addr`` must also be able to perform an
202202
an original value. This can be an additional attribute on the source, mutually
203203
exclusive with ``[take]``::
204204

205-
copy_addr [inout] %a to [initialization] %b
205+
copy_addr [inout] %a to [init] %b
206206

207207
This implies that value witness tables will need witnesses for
208208
inout-initialization and inout-reassignment.

lib/SIL/IR/SILPrinter.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1706,7 +1706,7 @@ class SILPrinter : public SILInstructionVisitor<SILPrinter> {
17061706
case AssignByWrapperInst::Unknown:
17071707
break;
17081708
case AssignByWrapperInst::Initialization:
1709-
*this << "[initialization] ";
1709+
*this << "[init] ";
17101710
break;
17111711
case AssignByWrapperInst::Assign:
17121712
*this << "[assign] ";
@@ -1771,7 +1771,7 @@ class SILPrinter : public SILInstructionVisitor<SILPrinter> {
17711771
void visitStore##Name##Inst(Store##Name##Inst *SI) { \
17721772
*this << Ctx.getID(SI->getSrc()) << " to "; \
17731773
if (SI->isInitializationOfDest()) \
1774-
*this << "[initialization] "; \
1774+
*this << "[init] "; \
17751775
*this << getIDAndType(SI->getDest()); \
17761776
}
17771777
#include "swift/AST/ReferenceStorage.def"
@@ -1781,7 +1781,7 @@ class SILPrinter : public SILInstructionVisitor<SILPrinter> {
17811781
*this << "[take] ";
17821782
*this << Ctx.getID(CI->getSrc()) << " to ";
17831783
if (CI->isInitializationOfDest())
1784-
*this << "[initialization] ";
1784+
*this << "[init] ";
17851785
*this << getIDAndType(CI->getDest());
17861786
}
17871787

@@ -1790,7 +1790,7 @@ class SILPrinter : public SILInstructionVisitor<SILPrinter> {
17901790
*this << "[take] ";
17911791
*this << Ctx.getID(CI->getSrc()) << " to ";
17921792
if (CI->isInitializationOfDest())
1793-
*this << "[initialization] ";
1793+
*this << "[init] ";
17941794
*this << getIDAndType(CI->getDest());
17951795
}
17961796

lib/SIL/Parser/ParseSIL.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2241,7 +2241,7 @@ static bool parseAssignByWrapperMode(AssignByWrapperInst::Mode &Result,
22412241
// Then try to parse one of our other initialization kinds. We do not support
22422242
// parsing unknown here so we use that as our fail value.
22432243
auto Tmp = llvm::StringSwitch<AssignByWrapperInst::Mode>(Str)
2244-
.Case("initialization", AssignByWrapperInst::Initialization)
2244+
.Case("init", AssignByWrapperInst::Initialization)
22452245
.Case("assign", AssignByWrapperInst::Assign)
22462246
.Case("assign_wrapped_value", AssignByWrapperInst::AssignWrappedValue)
22472247
.Default(AssignByWrapperInst::Unknown);
@@ -4403,7 +4403,7 @@ bool SILParser::parseSpecificSILInstruction(SILBuilder &B,
44034403
if (parseValueName(from) ||
44044404
parseSILIdentifier(toToken, toLoc, diag::expected_tok_in_sil_instr,
44054405
"to") ||
4406-
(isRefStorage && parseSILOptional(isInit, *this, "initialization")) ||
4406+
(isRefStorage && parseSILOptional(isInit, *this, "init")) ||
44074407
parseTypedValueRef(addrVal, addrLoc, B) ||
44084408
parseSILDebugLocation(InstLoc, B))
44094409
return true;
@@ -5011,7 +5011,7 @@ bool SILParser::parseSpecificSILInstruction(SILBuilder &B,
50115011
if (parseSILOptional(IsTake, *this, "take") || parseValueName(SrcLName) ||
50125012
parseSILIdentifier(ToToken, ToLoc, diag::expected_tok_in_sil_instr,
50135013
"to") ||
5014-
parseSILOptional(IsInit, *this, "initialization") ||
5014+
parseSILOptional(IsInit, *this, "init") ||
50155015
parseTypedValueRef(DestLVal, DestLoc, B) ||
50165016
parseSILDebugLocation(InstLoc, B))
50175017
return true;
@@ -5041,7 +5041,7 @@ bool SILParser::parseSpecificSILInstruction(SILBuilder &B,
50415041
if (parseSILOptional(IsTake, *this, "take") || parseValueName(SrcLName) ||
50425042
parseSILIdentifier(ToToken, ToLoc, diag::expected_tok_in_sil_instr,
50435043
"to") ||
5044-
parseSILOptional(IsInit, *this, "initialization") ||
5044+
parseSILOptional(IsInit, *this, "init") ||
50455045
parseTypedValueRef(DestLVal, DestLoc, B) ||
50465046
parseSILDebugLocation(InstLoc, B))
50475047
return true;

lib/SILOptimizer/Differentiation/PullbackCloner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2289,7 +2289,7 @@ void PullbackCloner::Implementation::accumulateAdjointForOptional(
22892289
// #Optional.some!enumelt
22902290
auto *enumAddr = builder.createInitEnumDataAddr(
22912291
pbLoc, optArgBuf, someEltDecl, wrappedTanType.getAddressType());
2292-
// copy_addr %wrappedAdjoint to [initialization] %enumAddr
2292+
// copy_addr %wrappedAdjoint to [init] %enumAddr
22932293
builder.createCopyAddr(pbLoc, wrappedAdjoint, enumAddr, IsNotTake,
22942294
IsInitialization);
22952295
// inject_enum_addr %optArgBuf : $*Optional<T.TangentVector>,

lib/SILOptimizer/FunctionSignatureTransforms/ExistentialTransform.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ void ExistentialSpecializerCloner::cloneArguments(
198198
/// bb0(%0 : $*T):
199199
/// %3 = alloc_stack $P
200200
/// %4 = init_existential_addr %3 : $*P, $T
201-
/// copy_addr [take] %0 to [initialization] %4 : $*T
201+
/// copy_addr [take] %0 to [init] %4 : $*T
202202
/// %7 = open_existential_addr immutable_access %3 : $*P to
203203
/// $*@opened P
204204
auto *ASI =

lib/SILOptimizer/Mandatory/AddressLowering.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1581,9 +1581,9 @@ namespace {
15811581
// br bb3(val0, val1)
15821582
// bb2:
15831583
// temp = alloc_stack
1584-
// copy_addr [take] addr0 to [initialization] temp
1585-
// copy_addr [take] addr1 to [initialization] addr0
1586-
// copy_addr [take] temp to [initialization] addr1
1584+
// copy_addr [take] addr0 to [init] temp
1585+
// copy_addr [take] addr1 to [init] addr0
1586+
// copy_addr [take] temp to [init] addr1
15871587
// dealloc_stack temp
15881588
// br bb3(val1, val1)
15891589
// bb3(phi0, phi1):

lib/SILOptimizer/Transforms/CopyForwarding.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
// Useless copies of address-only types look like this:
2727
//
2828
// %copy = alloc_stack $T
29-
// copy_addr %arg to [initialization] %copy : $*T
29+
// copy_addr %arg to [init] %copy : $*T
3030
// %ret = apply %callee<T>(%copy) : $@convention(thin) <τ_0_0> (@in τ_0_0) -> ()
3131
// dealloc_stack %copy : $*T
3232
// destroy_addr %arg : $*T
@@ -927,7 +927,7 @@ static DeallocStackInst *getSingleDealloc(AllocStackInst *ASI) {
927927
/// %copy = alloc_stack $T
928928
/// ...
929929
/// CurrentBlock:
930-
/// copy_addr %arg to [initialization] %copy : $*T
930+
/// copy_addr %arg to [init] %copy : $*T
931931
/// ...
932932
/// %ret = apply %callee<T>(%copy) : $@convention(thin) <τ_0_0> (@in τ_0_0) -> ()
933933
/// \endcode
@@ -1252,7 +1252,7 @@ void CopyForwarding::forwardCopiesOf(SILValue Def, SILFunction *F) {
12521252
/// %2 = alloc_stack $T
12531253
/// ... // arbitrary control flow, but no other uses of %0
12541254
/// bbN:
1255-
/// copy_addr [take] %2 to [initialization] %0 : $*T
1255+
/// copy_addr [take] %2 to [init] %0 : $*T
12561256
/// ... // no writes
12571257
/// return
12581258
static bool canNRVO(CopyAddrInst *CopyInst) {
@@ -1264,7 +1264,7 @@ static bool canNRVO(CopyAddrInst *CopyInst) {
12641264
// bb0(%in : $*T, %out : $T):
12651265
// %local = alloc_stack $T
12661266
// store %in to %local : $*T
1267-
// copy_addr %local to [initialization] %out : $*T
1267+
// copy_addr %local to [init] %out : $*T
12681268
if (!CopyInst->isTakeOfSrc())
12691269
return false;
12701270

@@ -1350,7 +1350,7 @@ class CopyForwardingPass : public SILFunctionTransform
13501350
// %ref = load %objaddr : $*AnyObject
13511351
// %alloc2 = alloc_stack $ObjWrapper
13521352
// # The in-memory reference is destroyed before retaining the loaded ref.
1353-
// copy_addr [take] %alloc1 to [initialization] %alloc2 : $*ObjWrapper
1353+
// copy_addr [take] %alloc1 to [init] %alloc2 : $*ObjWrapper
13541354
// retain_value %ref : $AnyObject
13551355
// destroy_addr %alloc2 : $*ObjWrapper
13561356
if (!getFunction()->hasOwnership())

lib/SILOptimizer/Transforms/SILLowerAggregateInstrs.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ static bool shouldExpandShim(SILFunction *fn, SILType type) {
8787
/// strong_release %old : $T
8888
/// store %new to %1 : $*T
8989
///
90-
/// copy_addr %0 to [initialization] %1 : $*T
90+
/// copy_addr %0 to [init] %1 : $*T
9191
/// ->
9292
/// %new = load [copy] %0 : $*T
9393
/// store %new to [init] %1 : $*T
@@ -97,7 +97,7 @@ static bool shouldExpandShim(SILFunction *fn, SILType type) {
9797
/// // no load/release of %old!
9898
/// store %new to %1 : $*T
9999
///
100-
/// copy_addr [take] %0 to [initialization] %1 : $*T
100+
/// copy_addr [take] %0 to [init] %1 : $*T
101101
/// ->
102102
/// %new = load [take] %0 : $*T
103103
/// store %new to [init] %1 : $*T

lib/SILOptimizer/Transforms/SSADestroyHoisting.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -943,7 +943,7 @@ void SSADestroyHoisting::run() {
943943
// instruction into
944944
//
945945
// destroy_addr
946-
// copy_addr to [initialization]
946+
// copy_addr to [init]
947947
//
948948
// sequences to create still more destroy_addrs to hoist.
949949
//

lib/SILOptimizer/Transforms/TempRValueElimination.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ namespace {
5555
/// are emitted as copies...
5656
///
5757
/// %temp = alloc_stack $T
58-
/// copy_addr %src to [initialization] %temp : $*T
58+
/// copy_addr %src to [init] %temp : $*T
5959
/// // no writes to %src or %temp
6060
/// destroy_addr %temp : $*T
6161
/// dealloc_stack %temp : $*T
@@ -70,7 +70,7 @@ namespace {
7070
/// a simple form of redundant-load-elimination (RLE).
7171
///
7272
/// %temp = alloc_stack $T
73-
/// store %src to [initialization] %temp : $*T
73+
/// store %src to [init] %temp : $*T
7474
/// // no writes to %temp
7575
/// %v = load [take] %temp : $*T
7676
/// dealloc_stack %temp : $*T
@@ -379,7 +379,7 @@ SILInstruction *TempRValueOptPass::getLastUseWhileSourceIsNotModified(
379379
/// of the temporary. For example:
380380
///
381381
/// %a = begin_access %src
382-
/// copy_addr %a to [initialization] %temp : $*T
382+
/// copy_addr %a to [init] %temp : $*T
383383
/// end_access %a
384384
/// use %temp
385385
///
@@ -586,8 +586,8 @@ void TempRValueOptPass::tryOptimizeCopyIntoTemp(CopyAddrInst *copyInst) {
586586
// re-initialized by exactly this instruction.
587587
// This is a corner case, but can happen if lastLoadInst is a copy_addr.
588588
// Example:
589-
// copy_addr [take] %copySrc to [initialization] %tempObj // copyInst
590-
// copy_addr [take] %tempObj to [initialization] %copySrc // lastLoadInst
589+
// copy_addr [take] %copySrc to [init] %tempObj // copyInst
590+
// copy_addr [take] %tempObj to [init] %copySrc // lastLoadInst
591591
if (needToInsertDestroy && lastLoadInst != copyInst &&
592592
!isa<DestroyAddrInst>(lastLoadInst) &&
593593
aa->mayWriteToMemory(lastLoadInst, copySrc))

lib/SILOptimizer/Utils/ConstExpr.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1531,9 +1531,9 @@ ConstExprFunctionState::initializeAddressFromSingleWriter(SILValue addr) {
15311531
// Try finding a writer among the users of `teai`. For example:
15321532
// %179 = alloc_stack $(Int32, Int32, Int32, Int32)
15331533
// %183 = tuple_element_addr %179 : $*(Int32, Int32, Int32, Int32), 3
1534-
// copy_addr %114 to [initialization] %183 : $*Int32
1534+
// copy_addr %114 to [init] %183 : $*Int32
15351535
// %191 = tuple_element_addr %179 : $*(Int32, Int32, Int32, Int32), 3
1536-
// copy_addr [take] %191 to [initialization] %178 : $*Int32
1536+
// copy_addr [take] %191 to [init] %178 : $*Int32
15371537
//
15381538
// The workflow is: when const-evaluating %178, we const-evaluate %191,
15391539
// which in turn triggers const-evaluating %179, thereby enter this

lib/SILOptimizer/Utils/Existential.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ using namespace swift;
2727
/// %5 = alloc_ref $SomeC
2828
/// store %5 to %4 : $*SomeC
2929
/// %8 = alloc_stack $SomeP
30-
/// copy_addr %3 to [initialization] %8 : $*SomeP
30+
/// copy_addr %3 to [init] %8 : $*SomeP
3131
/// %10 = apply %9(%3) : $@convention(thin) (@in_guaranteed SomeP)
3232
/// Assumptions: Insn is a direct user of GAI (e.g., copy_addr or
3333
/// apply pattern shown above) and that a valid init_existential_addr

test/AutoDiff/SIL/sil_differentiability_witness.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ sil_differentiability_witness [reverse] [parameters 0] [results 0] @foo : $@conv
137137

138138
sil hidden [ossa] @generic : $@convention(thin) <T> (@in_guaranteed T, Float) -> @out T {
139139
bb0(%0 : $*T, %1 : $*T, %2 : $Float):
140-
copy_addr %1 to [initialization] %0 : $*T
140+
copy_addr %1 to [init] %0 : $*T
141141
%void = tuple ()
142142
return %void : $()
143143
}

test/AutoDiff/SILGen/autodiff_builtins.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func applyDerivative_f1_vjp<T: AdditiveArithmetic & Differentiable>(t0: T) -> (T
8181
// CHECK: [[D_RESULT_BUFFER_0_FOR_LOAD:%.*]] = tuple_element_addr [[D_RESULT_BUFFER]] : ${{.*}}, 0
8282
// CHECK: [[D_RESULT_BUFFER_1_FOR_LOAD:%.*]] = tuple_element_addr [[D_RESULT_BUFFER]] : ${{.*}}, 1
8383
// CHECK: [[PULLBACK:%.*]] = load [take] [[D_RESULT_BUFFER_1_FOR_LOAD]]
84-
// CHECK: copy_addr [take] [[D_RESULT_BUFFER_0_FOR_LOAD]] to [initialization] [[ORIG_RESULT_OUT_PARAM]]
84+
// CHECK: copy_addr [take] [[D_RESULT_BUFFER_0_FOR_LOAD]] to [init] [[ORIG_RESULT_OUT_PARAM]]
8585
// CHECK: return [[PULLBACK]]
8686

8787
struct ExamplePullbackStruct<T: Differentiable> {

test/AutoDiff/SILOptimizer/differentiation_control_flow_sil.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ func enum_addr_notactive<T>(_ e: AddressOnlyEnum<T>, _ x: Float) -> Float {
199199
// CHECK-SIL-LABEL: sil hidden [ossa] @enum_addr_notactivelTJrUSpSr : $@convention(thin) <τ_0_0> (@in_guaranteed AddressOnlyEnum<τ_0_0>, Float) -> (Float, @owned @callee_guaranteed (Float) -> Float) {
200200
// CHECK-SIL: bb0([[ENUM_ARG:%.*]] : $*AddressOnlyEnum<τ_0_0>, [[X_ARG:%.*]] : $Float):
201201
// CHECK-SIL: [[ENUM_ADDR:%.*]] = alloc_stack $AddressOnlyEnum<τ_0_0>
202-
// CHECK-SIL: copy_addr [[ENUM_ARG]] to [initialization] [[ENUM_ADDR]] : $*AddressOnlyEnum<τ_0_0>
202+
// CHECK-SIL: copy_addr [[ENUM_ARG]] to [init] [[ENUM_ADDR]] : $*AddressOnlyEnum<τ_0_0>
203203
// CHECK-SIL: [[BB0_PB_STRUCT:%.*]] = struct $_AD__enum_addr_notactive_bb0__PB__src_0_wrt_1_l<τ_0_0> ()
204204
// CHECK-SIL: switch_enum_addr [[ENUM_ADDR]] : $*AddressOnlyEnum<τ_0_0>, case #AddressOnlyEnum.none!enumelt: bb1, case #AddressOnlyEnum.some!enumelt: bb2
205205

test/AutoDiff/SILOptimizer/differentiation_function_canonicalization.sil

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ bb0(%0 : $*T):
8484
// CHECK: bb0([[ARG:%.*]] : $*T):
8585
// CHECK: [[ORIG_FN:%.*]] = witness_method $T, #Protocol.method
8686
// CHECK: [[ARGCOPY1:%.*]] = alloc_stack $T
87-
// CHECK: copy_addr [[ARG]] to [initialization] [[ARGCOPY1]] : $*T
87+
// CHECK: copy_addr [[ARG]] to [init] [[ARGCOPY1]] : $*T
8888
// CHECK: [[ARGCOPY2:%.*]] = alloc_stack $T
89-
// CHECK: copy_addr [[ARG]] to [initialization] [[ARGCOPY2]] : $*T
89+
// CHECK: copy_addr [[ARG]] to [init] [[ARGCOPY2]] : $*T
9090
// CHECK: [[ORIG_FN_PARTIALLY_APPLIED:%.*]] = partial_apply [callee_guaranteed] [[ORIG_FN]]<T>([[ARG]])
9191
// CHECK: [[JVP_FN:%.*]] = witness_method $T, #Protocol.method!jvp.SU
9292
// CHECK: [[JVP_FN_PARTIALLY_APPLIED:%.*]] = partial_apply [callee_guaranteed] [[JVP_FN]]<T>([[ARGCOPY1]])

0 commit comments

Comments
 (0)