Skip to content

Commit 7cceaff

Browse files
committed
SIL: don't print operand types in textual SIL
Type annotations for instruction operands are omitted, e.g. ``` %3 = struct $S(%1, %2) ``` Operand types are redundant anyway and were only used for sanity checking in the SIL parser. But: operand types _are_ printed if the definition of the operand value was not printed yet. This happens: * if the block with the definition appears after the block where the operand's instruction is located * if a block or instruction is printed in isolation, e.g. in a debugger The old behavior can be restored with `-Xllvm -sil-print-types`. This option is added to many existing test files which check for operand types in their check-lines.
1 parent 5ef30e2 commit 7cceaff

File tree

978 files changed

+1344
-1282
lines changed

Some content is hidden

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

978 files changed

+1344
-1282
lines changed

include/swift/AST/DiagnosticsParse.def

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,8 @@ ERROR(sil_value_def_type_mismatch,none,
552552
"value '%0' used with mismatching type %1 (expected %2)", (StringRef, Type, Type))
553553
ERROR(sil_use_of_undefined_value,none,
554554
"use of undefined value '%0'", (StringRef))
555+
ERROR(sil_forward_ref_value_needs_type,none,
556+
"forward-referenced value '%0' needs a type annotation", (StringRef))
555557
NOTE(sil_prior_reference,none,
556558
"prior reference was here", ())
557559

lib/SIL/IR/SILPrinter.cpp

Lines changed: 74 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ llvm::cl::opt<bool>
7777
SILPrintSourceInfo("sil-print-sourceinfo", llvm::cl::init(false),
7878
llvm::cl::desc("Include source annotation in SIL output"));
7979

80+
llvm::cl::opt<bool>
81+
SILPrintTypes("sil-print-types", llvm::cl::init(false),
82+
llvm::cl::desc("always print type annotations for instruction operands in SIL output"));
83+
8084
llvm::cl::opt<bool> SILPrintGenericSpecializationInfo(
8185
"sil-print-generic-specialization-info", llvm::cl::init(false),
8286
llvm::cl::desc("Include generic specialization"
@@ -165,31 +169,34 @@ struct SILValuePrinterInfo {
165169
bool IsCapture = false;
166170
bool IsReborrow = false;
167171
bool IsEscaping = false;
172+
bool needPrintType = false;
168173

169174
SILValuePrinterInfo(ID ValueID) : ValueID(ValueID), Type(), OwnershipKind() {}
170-
SILValuePrinterInfo(ID ValueID, SILType Type)
171-
: ValueID(ValueID), Type(Type), OwnershipKind() {}
175+
SILValuePrinterInfo(ID ValueID, SILType Type, bool needPrintType)
176+
: ValueID(ValueID), Type(Type), OwnershipKind(), needPrintType(needPrintType) {}
172177
SILValuePrinterInfo(ID ValueID, SILType Type,
173178
ValueOwnershipKind OwnershipKind)
174179
: ValueID(ValueID), Type(Type), OwnershipKind(OwnershipKind) {}
175180
SILValuePrinterInfo(ID ValueID, SILType Type,
176181
ValueOwnershipKind OwnershipKind, bool IsNoImplicitCopy,
177182
LifetimeAnnotation Lifetime, bool IsCapture,
178-
bool IsReborrow, bool IsEscaping)
183+
bool IsReborrow, bool IsEscaping, bool needPrintType)
179184
: ValueID(ValueID), Type(Type), OwnershipKind(OwnershipKind),
180185
IsNoImplicitCopy(IsNoImplicitCopy), Lifetime(Lifetime),
181-
IsCapture(IsCapture), IsReborrow(IsReborrow), IsEscaping(IsEscaping) {}
186+
IsCapture(IsCapture), IsReborrow(IsReborrow), IsEscaping(IsEscaping),
187+
needPrintType(needPrintType){}
182188
SILValuePrinterInfo(ID ValueID, SILType Type, bool IsNoImplicitCopy,
183189
LifetimeAnnotation Lifetime, bool IsCapture,
184-
bool IsReborrow, bool IsEscaping)
190+
bool IsReborrow, bool IsEscaping, bool needPrintType)
185191
: ValueID(ValueID), Type(Type), OwnershipKind(),
186192
IsNoImplicitCopy(IsNoImplicitCopy), Lifetime(Lifetime),
187-
IsCapture(IsCapture), IsReborrow(IsReborrow), IsEscaping(IsEscaping) {}
193+
IsCapture(IsCapture), IsReborrow(IsReborrow), IsEscaping(IsEscaping),
194+
needPrintType(needPrintType) {}
188195
SILValuePrinterInfo(ID ValueID, SILType Type,
189196
ValueOwnershipKind OwnershipKind, bool IsReborrow,
190-
bool IsEscaping)
197+
bool IsEscaping, bool needPrintType)
191198
: ValueID(ValueID), Type(Type), OwnershipKind(OwnershipKind),
192-
IsReborrow(IsReborrow), IsEscaping(IsEscaping) {}
199+
IsReborrow(IsReborrow), IsEscaping(IsEscaping), needPrintType(needPrintType) {}
193200
};
194201

195202
/// Return the fully qualified dotted path for DeclContext.
@@ -656,6 +663,7 @@ class SILPrinter : public SILInstructionVisitor<SILPrinter> {
656663
} PrintState;
657664
LineComments lineComments;
658665
unsigned LastBufferID;
666+
llvm::DenseSet<const SILBasicBlock *> printedBlocks;
659667

660668
// Printers for the underlying stream.
661669
#define SIMPLE_PRINTER(TYPE) \
@@ -684,29 +692,57 @@ class SILPrinter : public SILInstructionVisitor<SILPrinter> {
684692
*this << i.ValueID;
685693
if (!i.Type)
686694
return *this;
687-
*this << " : ";
688-
if (i.IsNoImplicitCopy)
689-
*this << "@noImplicitCopy ";
695+
const char *separator = " : ";
696+
if (i.IsNoImplicitCopy) {
697+
*this << separator << "@noImplicitCopy";
698+
separator = " ";
699+
}
690700
switch (i.Lifetime) {
691701
case LifetimeAnnotation::EagerMove:
692-
*this << "@_eagerMove ";
702+
*this << separator << "@_eagerMove";
703+
separator = " ";
693704
break;
694705
case LifetimeAnnotation::None:
695706
break;
696707
case LifetimeAnnotation::Lexical:
697-
*this << "@_lexical ";
708+
*this << separator << "@_lexical";
709+
separator = " ";
698710
break;
699711
}
700-
if (i.IsCapture)
701-
*this << "@closureCapture ";
702-
if (i.IsReborrow)
703-
*this << "@reborrow ";
704-
if (i.IsEscaping)
705-
*this << "@pointer_escape ";
712+
if (i.IsCapture) {
713+
*this << separator << "@closureCapture";
714+
separator = " ";
715+
}
716+
if (i.IsReborrow) {
717+
*this << separator << "@reborrow";
718+
separator = " ";
719+
}
720+
if (i.IsEscaping) {
721+
*this << separator << "@pointer_escape";
722+
separator = " ";
723+
}
706724
if (!i.IsReborrow && i.OwnershipKind && *i.OwnershipKind != OwnershipKind::None) {
707-
*this << "@" << i.OwnershipKind.value() << " ";
725+
*this << separator << "@" << i.OwnershipKind.value() << " ";
726+
separator = " ";
727+
}
728+
if (i.needPrintType) {
729+
*this << separator << i.Type;
708730
}
709-
return *this << i.Type;
731+
return *this;
732+
}
733+
734+
bool needPrintTypeFor(SILValue V) {
735+
if (SILPrintTypes)
736+
return true;
737+
738+
if (!V)
739+
return false;
740+
741+
if (isa<SILUndef>(V))
742+
return true;
743+
744+
// Make sure to print the type if the operand's definition was not printed so far
745+
return printedBlocks.count(V->getParentBlock()) == 0;
710746
}
711747

712748
SILPrinter &operator<<(Type t) {
@@ -733,13 +769,20 @@ class SILPrinter : public SILInstructionVisitor<SILPrinter> {
733769
}
734770

735771
SILValuePrinterInfo getIDAndType(SILValue V) {
736-
return {Ctx.getID(V), V ? V->getType() : SILType()};
772+
return {Ctx.getID(V), V ? V->getType() : SILType(), needPrintTypeFor(V)};
737773
}
774+
SILValuePrinterInfo getIDAndForcedPrintedType(SILValue V) {
775+
return {Ctx.getID(V), V ? V->getType() : SILType(), /*needPrintType=*/true};
776+
}
777+
738778
SILValuePrinterInfo getIDAndType(SILFunctionArgument *arg) {
739779
return {Ctx.getID(arg), arg->getType(),
740780
arg->isNoImplicitCopy(), arg->getLifetimeAnnotation(),
741781
arg->isClosureCapture(), arg->isReborrow(),
742-
arg->hasPointerEscape()};
782+
arg->hasPointerEscape(), /*needPrintType=*/true};
783+
}
784+
SILValuePrinterInfo getIDAndType(SILArgument *arg) {
785+
return {Ctx.getID(arg), arg->getType(), /*needPrintType=*/true};
743786
}
744787

745788
SILValuePrinterInfo getIDAndTypeAndOwnership(SILValue V) {
@@ -753,11 +796,13 @@ class SILPrinter : public SILInstructionVisitor<SILPrinter> {
753796
arg->getLifetimeAnnotation(),
754797
arg->isClosureCapture(),
755798
arg->isReborrow(),
756-
arg->hasPointerEscape()};
799+
arg->hasPointerEscape(),
800+
/*needPrintType=*/true};
757801
}
758802
SILValuePrinterInfo getIDAndTypeAndOwnership(SILArgument *arg) {
759803
return {Ctx.getID(arg), arg->getType(), arg->getOwnershipKind(),
760-
arg->isReborrow(), arg->hasPointerEscape()};
804+
arg->isReborrow(), arg->hasPointerEscape(),
805+
/*needPrintType=*/true};
761806
}
762807

763808
//===--------------------------------------------------------------------===//
@@ -880,6 +925,8 @@ class SILPrinter : public SILInstructionVisitor<SILPrinter> {
880925
#endif
881926

882927
void print(const SILBasicBlock *BB) {
928+
printedBlocks.insert(BB);
929+
883930
// Output uses for BB arguments. These are put into place as comments before
884931
// the block header.
885932
printBlockArgumentUses(BB);
@@ -2464,7 +2511,7 @@ class SILPrinter : public SILInstructionVisitor<SILPrinter> {
24642511
PrintState.OS, QualifiedSILTypeOptions);
24652512
if (!WMI->getTypeDependentOperands().empty()) {
24662513
*this << ", ";
2467-
*this << getIDAndType(WMI->getTypeDependentOperands()[0].get());
2514+
*this << getIDAndForcedPrintedType(WMI->getTypeDependentOperands()[0].get());
24682515
}
24692516
*this << " : " << WMI->getType();
24702517
printConformances({WMI->getConformance()});
@@ -2505,7 +2552,7 @@ class SILPrinter : public SILInstructionVisitor<SILPrinter> {
25052552
printConformances(AEI->getConformances());
25062553
}
25072554
void visitInitExistentialRefInst(InitExistentialRefInst *AEI) {
2508-
*this << getIDAndType(AEI->getOperand()) << " : $"
2555+
*this << getIDAndForcedPrintedType(AEI->getOperand()) << " : $"
25092556
<< AEI->getFormalConcreteType() << ", " << AEI->getType();
25102557
printConformances(AEI->getConformances());
25112558
printForwardingOwnershipKind(AEI, AEI->getOperand());

lib/SIL/Parser/ParseSIL.cpp

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1504,14 +1504,23 @@ bool SILParser::parseTypedValueRef(SILValue &Result, SourceLoc &Loc,
15041504
Loc = P.Tok.getLoc();
15051505

15061506
UnresolvedValueName Name;
1507-
SILType Ty;
1508-
if (parseValueName(Name) ||
1509-
P.parseToken(tok::colon, diag::expected_sil_colon_value_ref) ||
1510-
parseSILType(Ty))
1507+
if (parseValueName(Name))
15111508
return true;
1512-
1513-
Result = getLocalValue(Name, Ty, RegularLocation(Loc), B);
1514-
return false;
1509+
1510+
if (P.consumeIf(tok::colon)) {
1511+
SILType Ty;
1512+
parseSILType(Ty);
1513+
Result = getLocalValue(Name, Ty, RegularLocation(Loc), B);
1514+
return false;
1515+
} else {
1516+
ValueBase *&Entry = LocalValues[Name.Name];
1517+
if (!Entry) {
1518+
P.diagnose(Name.NameLoc, diag::sil_forward_ref_value_needs_type, Name.Name);
1519+
return true;
1520+
}
1521+
Result = SILValue(Entry);
1522+
return false;
1523+
}
15151524
}
15161525

15171526
/// Look up whether the given string corresponds to a SIL opcode.
@@ -7432,6 +7441,15 @@ bool SILParserState::parseDeclSIL(Parser &P) {
74327441
}
74337442

74347443
FunctionState.F->setLinkage(resolveSILLinkage(FnLinkage, isDefinition));
7444+
switch (FunctionState.F->getLinkage()) {
7445+
case SILLinkage::PublicExternal:
7446+
case SILLinkage::PackageExternal:
7447+
if (!FunctionState.F->isExternalDeclaration() && !FunctionState.F->isAnySerialized())
7448+
FunctionState.F->getModule().setParsedAsSerializedSIL();
7449+
break;
7450+
default:
7451+
break;
7452+
}
74357453
}
74367454

74377455
if (FunctionState.diagnoseProblems())

test/AutoDiff/SIL/Parse/sildeclref.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-sil-opt %s -module-name=sildeclref_parse | %target-sil-opt -module-name=sildeclref_parse | %FileCheck %s
1+
// RUN: %target-sil-opt -sil-print-types %s -module-name=sildeclref_parse | %target-sil-opt -sil-print-types -module-name=sildeclref_parse | %FileCheck %s
22
// Parse AutoDiff derivative SILDeclRefs via `witness_method` and `class_method` instructions.
33

44
import Swift

test/AutoDiff/SIL/Serialization/differentiable_function_type.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-sil-opt %s -emit-sib -o %t/tmp.sib -module-name main
3-
// RUN: %target-sil-opt %t/tmp.sib -o %t/tmp.sil -module-name main
2+
// RUN: %target-sil-opt -sil-print-types %s -emit-sib -o %t/tmp.sib -module-name main
3+
// RUN: %target-sil-opt -sil-print-types %t/tmp.sib -o %t/tmp.sil -module-name main
44

55
// https://github.com/apple/swift/issues/54526
66
// Workaround because import declarations are not preserved in .sib files.
77
// RUN: sed -e 's/import Swift$/import Swift; import _Differentiation/' %t/tmp.sil > %t/tmp_fixed.sil
8-
// RUN: %target-sil-opt %t/tmp_fixed.sil -module-name main -emit-sorted-sil | %FileCheck %s
8+
// RUN: %target-sil-opt -sil-print-types %t/tmp_fixed.sil -module-name main -emit-sorted-sil | %FileCheck %s
99

1010
// `shell` is required only to run `sed` as a
1111
// https://github.com/apple/swift/issues/54526 workaround.

test/AutoDiff/SIL/differentiable_function_inst.sil

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
// Round-trip parsing/printing test.
22

3-
// RUN: %target-sil-opt %s -emit-sorted-sil | %FileCheck %s --check-prefix=CHECK-SIL
3+
// RUN: %target-sil-opt -sil-print-types %s -emit-sorted-sil | %FileCheck %s --check-prefix=CHECK-SIL
44

55
// Round-trip serialization-deserialization test.
66

77
// RUN: %empty-directory(%t)
8-
// RUN: %target-sil-opt %s -emit-sib -o %t/tmp.sib -module-name main
9-
// RUN: %target-sil-opt %t/tmp.sib -o %t/tmp.sil -module-name main
8+
// RUN: %target-sil-opt -sil-print-types %s -emit-sib -o %t/tmp.sib -module-name main
9+
// RUN: %target-sil-opt -sil-print-types %t/tmp.sib -o %t/tmp.sil -module-name main
1010

1111
// https://github.com/apple/swift/issues/54526
1212
// Workaround because import declarations are not preserved in .sib files.
1313
// RUN: sed -e 's/import Swift$/import Swift; import _Differentiation/' %t/tmp.sil > %t/tmp_fixed.sil
14-
// RUN: %target-sil-opt %t/tmp_fixed.sil -module-name main -emit-sorted-sil | %FileCheck %s --check-prefix=CHECK-SIL
14+
// RUN: %target-sil-opt -sil-print-types %t/tmp_fixed.sil -module-name main -emit-sorted-sil | %FileCheck %s --check-prefix=CHECK-SIL
1515

1616
// IRGen test.
1717

test/AutoDiff/SIL/linear_function_inst.sil

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
// Round-trip parsing/printing test.
22

3-
// RUN: %target-sil-opt %s -emit-sorted-sil | %FileCheck %s --check-prefix=CHECK-SIL
3+
// RUN: %target-sil-opt -sil-print-types %s -emit-sorted-sil | %FileCheck %s --check-prefix=CHECK-SIL
44

55
// Round-trip serialization-deserialization test.
66

77
// RUN: %empty-directory(%t)
8-
// RUN: %target-sil-opt %s -emit-sib -o %t/tmp.sib -module-name main
9-
// RUN: %target-sil-opt %t/tmp.sib -o %t/tmp.sil -module-name main
8+
// RUN: %target-sil-opt -sil-print-types %s -emit-sib -o %t/tmp.sib -module-name main
9+
// RUN: %target-sil-opt -sil-print-types %t/tmp.sib -o %t/tmp.sil -module-name main
1010

1111
// https://github.com/apple/swift/issues/54526
1212
// Workaround because import declarations are not preserved in .sib files.
1313
// RUN: sed -e 's/import Swift$/import Swift; import _Differentiation/' %t/tmp.sil > %t/tmp_fixed.sil
14-
// RUN: %target-sil-opt %t/tmp_fixed.sil -module-name main -emit-sorted-sil | %FileCheck %s --check-prefix=CHECK-SIL
14+
// RUN: %target-sil-opt -sil-print-types %t/tmp_fixed.sil -module-name main -emit-sorted-sil | %FileCheck %s --check-prefix=CHECK-SIL
1515

1616

1717
sil_stage raw

test/AutoDiff/SILGen/autodiff_builtins.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -parse-stdlib -emit-silgen %s | %FileCheck %s
1+
// RUN: %target-swift-frontend -parse-stdlib -Xllvm -sil-print-types -emit-silgen %s | %FileCheck %s
22

33
import _Differentiation
44
import Swift

test/AutoDiff/SILGen/differentiable_function.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -emit-silgen %s | %FileCheck %s
1+
// RUN: %target-swift-frontend -Xllvm -sil-print-types -emit-silgen %s | %FileCheck %s
22

33
// Test SILGen for `@differentiable` function typed values.
44

test/AutoDiff/SILGen/nil_coalescing.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -emit-sil -verify %s | %FileCheck %s
1+
// RUN: %target-swift-frontend -Xllvm -sil-print-types -emit-sil -verify %s | %FileCheck %s
22

33
import _Differentiation
44

test/AutoDiff/SILGen/reabstraction.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -emit-silgen %s | %FileCheck %s
1+
// RUN: %target-swift-frontend -Xllvm -sil-print-types -emit-silgen %s | %FileCheck %s
22

33
import _Differentiation
44

test/AutoDiff/SILGen/vtable.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -emit-silgen %s | %FileCheck %s
1+
// RUN: %target-swift-frontend -Xllvm -sil-print-types -emit-silgen %s | %FileCheck %s
22

33
// Test derivative function vtable entries for `@differentiable` class members:
44
// - Methods.

test/AutoDiff/SILOptimizer/closure_specialization.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-sil-opt -test-runner %s -o /dev/null 2>&1 | %FileCheck %s
1+
// RUN: %target-sil-opt -sil-print-types -test-runner %s -o /dev/null 2>&1 | %FileCheck %s
22

33
// REQUIRES: swift_in_compiler
44

test/AutoDiff/SILOptimizer/derivative_sil.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -emit-sil -enable-experimental-forward-mode-differentiation -verify -Xllvm -sil-print-after=differentiation -o /dev/null 2>&1 %s | %FileCheck %s -check-prefix=CHECK-SIL
1+
// RUN: %target-swift-frontend -Xllvm -sil-print-types -emit-sil -enable-experimental-forward-mode-differentiation -verify -Xllvm -sil-print-after=differentiation -o /dev/null 2>&1 %s | %FileCheck %s -check-prefix=CHECK-SIL
22
// REQUIRES: asserts
33

44
// Simple generated derivative code FileCheck tests.

test/AutoDiff/SILOptimizer/differentiation_control_flow_sil.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: %target-swift-frontend -emit-sil -verify -Xllvm -debug-only=differentiation 2>&1 %s | %FileCheck %s -check-prefix=CHECK-DATA-STRUCTURES
2-
// RUN: %target-swift-frontend -emit-sil -verify -Xllvm -sil-print-after=differentiation -o /dev/null 2>&1 %s | %FileCheck %s -check-prefix=CHECK-SIL
1+
// RUN: %target-swift-frontend -Xllvm -sil-print-types -emit-sil -verify -Xllvm -debug-only=differentiation 2>&1 %s | %FileCheck %s -check-prefix=CHECK-DATA-STRUCTURES
2+
// RUN: %target-swift-frontend -Xllvm -sil-print-types -emit-sil -verify -Xllvm -sil-print-after=differentiation -o /dev/null 2>&1 %s | %FileCheck %s -check-prefix=CHECK-SIL
33
// REQUIRES: asserts
44

55
// TODO: Add FileCheck tests.

test/AutoDiff/SILOptimizer/differentiation_function_canonicalization.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-sil-opt -differentiation %s | %FileCheck %s
1+
// RUN: %target-sil-opt -sil-print-types -differentiation %s | %FileCheck %s
22

33
sil_stage raw
44

test/AutoDiff/SILOptimizer/differentiation_sil.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: %target-swift-frontend -emit-silgen %s | %FileCheck %s --check-prefix=CHECK-SILGEN
2-
// RUN: %target-swift-frontend -enable-experimental-forward-mode-differentiation -emit-sil %s | %FileCheck %s --check-prefix=CHECK-SIL
1+
// RUN: %target-swift-frontend -Xllvm -sil-print-types -emit-silgen %s | %FileCheck %s --check-prefix=CHECK-SILGEN
2+
// RUN: %target-swift-frontend -enable-experimental-forward-mode-differentiation -Xllvm -sil-print-types -emit-sil %s | %FileCheck %s --check-prefix=CHECK-SIL
33

44
// Simple differentiation transform test: check SIL before and after the transform.
55

test/AutoDiff/SILOptimizer/differentiation_subset_parameters_thunk.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-swift-frontend -emit-sil -Xllvm -sil-disable-pass=OnoneSimplification %s | %FileCheck %s
1+
// RUN: %target-swift-frontend -Xllvm -sil-print-types -emit-sil -Xllvm -sil-disable-pass=OnoneSimplification %s | %FileCheck %s
22

33
import _Differentiation
44

test/AutoDiff/SILOptimizer/linear_function_canonicalization.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-sil-opt -differentiation -enable-experimental-linear-map-transposition %s | %FileCheck %s
1+
// RUN: %target-sil-opt -sil-print-types -differentiation -enable-experimental-linear-map-transposition %s | %FileCheck %s
22

33
sil_stage raw
44

0 commit comments

Comments
 (0)