Skip to content

AutoDiff: Workaround for performing generic signature queries on the wrong signature #39416

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 56 additions & 16 deletions lib/SIL/IR/SILFunctionType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "swift/AST/Module.h"
#include "swift/AST/ModuleLoader.h"
#include "swift/AST/ProtocolConformance.h"
#include "swift/AST/TypeCheckRequests.h"
#include "swift/ClangImporter/ClangImporter.h"
#include "swift/SIL/SILModule.h"
#include "swift/SIL/SILType.h"
Expand Down Expand Up @@ -360,6 +361,41 @@ getSemanticResults(SILFunctionType *functionType, IndexSubset *parameterIndices,
IndexSubset::get(C, parameterIndices->getCapacity(), inoutParamIndices);
}

static CanGenericSignature buildDifferentiableGenericSignature(CanGenericSignature sig,
CanType tanType) {
if (!sig)
return sig;

llvm::DenseSet<CanType> types;

auto &ctx = tanType->getASTContext();

(void) tanType.findIf([&](Type t) -> bool {
if (auto *dmt = t->getAs<DependentMemberType>()) {
if (dmt->getName() == ctx.Id_TangentVector)
types.insert(dmt->getBase()->getCanonicalType());
}

return false;
});

SmallVector<Requirement, 2> reqs;
auto *proto = ctx.getProtocol(KnownProtocolKind::Differentiable);
assert(proto != nullptr);

for (auto type : types) {
if (!sig->requiresProtocol(type, proto)) {
reqs.push_back(Requirement(RequirementKind::Conformance, type,
proto->getDeclaredInterfaceType()));
}
}

return evaluateOrDefault(
ctx.evaluator,
AbstractGenericSignatureRequest{sig.getPointer(), {}, reqs},
GenericSignature()).getCanonicalSignature();
}

/// Returns the differential type for the given original function type,
/// parameter indices, and result index.
static CanSILFunctionType getAutoDiffDifferentialType(
Expand All @@ -371,10 +407,11 @@ static CanSILFunctionType getAutoDiffDifferentialType(
auto getTangentParameterConvention =
[&](CanType tanType,
ParameterConvention origParamConv) -> ParameterConvention {
tanType =
tanType->getCanonicalType(originalFnTy->getSubstGenericSignature());
AbstractionPattern pattern(originalFnTy->getSubstGenericSignature(),
tanType);
auto sig = buildDifferentiableGenericSignature(
originalFnTy->getSubstGenericSignature(), tanType);

tanType = tanType->getCanonicalType(sig);
AbstractionPattern pattern(sig, tanType);
auto &tl =
TC.getTypeLowering(pattern, tanType, TypeExpansionContext::minimal());
// When the tangent type is address only, we must ensure that the tangent
Expand All @@ -398,10 +435,11 @@ static CanSILFunctionType getAutoDiffDifferentialType(
auto getTangentResultConvention =
[&](CanType tanType,
ResultConvention origResConv) -> ResultConvention {
tanType =
tanType->getCanonicalType(originalFnTy->getSubstGenericSignature());
AbstractionPattern pattern(originalFnTy->getSubstGenericSignature(),
tanType);
auto sig = buildDifferentiableGenericSignature(
originalFnTy->getSubstGenericSignature(), tanType);

tanType = tanType->getCanonicalType(sig);
AbstractionPattern pattern(sig, tanType);
auto &tl =
TC.getTypeLowering(pattern, tanType, TypeExpansionContext::minimal());
// When the tangent type is address only, we must ensure that the tangent
Expand Down Expand Up @@ -530,10 +568,11 @@ static CanSILFunctionType getAutoDiffPullbackType(
auto getTangentParameterConventionForOriginalResult =
[&](CanType tanType,
ResultConvention origResConv) -> ParameterConvention {
tanType =
tanType->getCanonicalType(originalFnTy->getSubstGenericSignature());
AbstractionPattern pattern(originalFnTy->getSubstGenericSignature(),
tanType);
auto sig = buildDifferentiableGenericSignature(
originalFnTy->getSubstGenericSignature(), tanType);

tanType = tanType->getCanonicalType(sig);
AbstractionPattern pattern(sig, tanType);
auto &tl =
TC.getTypeLowering(pattern, tanType, TypeExpansionContext::minimal());
ParameterConvention conv;
Expand All @@ -560,10 +599,11 @@ static CanSILFunctionType getAutoDiffPullbackType(
auto getTangentResultConventionForOriginalParameter =
[&](CanType tanType,
ParameterConvention origParamConv) -> ResultConvention {
tanType =
tanType->getCanonicalType(originalFnTy->getSubstGenericSignature());
AbstractionPattern pattern(originalFnTy->getSubstGenericSignature(),
tanType);
auto sig = buildDifferentiableGenericSignature(
originalFnTy->getSubstGenericSignature(), tanType);

tanType = tanType->getCanonicalType(sig);
AbstractionPattern pattern(sig, tanType);
auto &tl =
TC.getTypeLowering(pattern, tanType, TypeExpansionContext::minimal());
ResultConvention conv;
Expand Down
1 change: 0 additions & 1 deletion stdlib/private/DifferentiationUnittest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ add_swift_target_library(swiftDifferentiationUnittest ${SWIFT_STDLIB_LIBRARY_BUI
GYB_SOURCES DifferentiationUnittest.swift.gyb

SWIFT_MODULE_DEPENDS _Differentiation StdlibUnittest
SWIFT_COMPILE_FLAGS -Xfrontend -requirement-machine=off
INSTALL_IN_COMPONENT stdlib-experimental
DARWIN_INSTALL_NAME_DIR "${SWIFT_DARWIN_STDLIB_PRIVATE_INSTALL_NAME_DIR}")
1 change: 0 additions & 1 deletion stdlib/public/Differentiation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,5 @@ add_swift_target_library(swift_Differentiation ${SWIFT_STDLIB_LIBRARY_BUILD_TYPE
SWIFT_COMPILE_FLAGS
${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS}
-parse-stdlib
-Xfrontend -requirement-machine=off
LINK_FLAGS "${SWIFT_RUNTIME_SWIFT_LINK_FLAGS}"
INSTALL_IN_COMPONENT stdlib)
2 changes: 1 addition & 1 deletion test/AutoDiff/IRGen/differentiable_function_type.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %target-swift-frontend -emit-ir -g %s -requirement-machine=off
// RUN: %target-swift-frontend -emit-ir -g %s

import _Differentiation

Expand Down
8 changes: 4 additions & 4 deletions test/AutoDiff/IRGen/loadable_by_address.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// RUN: %target-swift-frontend -c -Xllvm -sil-verify-after-pass=loadable-address %s -requirement-machine=off
// RUN: %target-swift-frontend -emit-sil %s -requirement-machine=off | %FileCheck %s -check-prefix=CHECK-SIL
// RUN: %target-swift-frontend -c -Xllvm -sil-print-after=loadable-address %s -requirement-machine=off 2>&1 | %FileCheck %s -check-prefix=CHECK-LBA-SIL
// RUN: %target-run-simple-swift(-Xfrontend -requirement-machine=off)
// RUN: %target-swift-frontend -c -Xllvm -sil-verify-after-pass=loadable-address %s
// RUN: %target-swift-frontend -emit-sil %s | %FileCheck %s -check-prefix=CHECK-SIL
// RUN: %target-swift-frontend -c -Xllvm -sil-print-after=loadable-address %s 2>&1 | %FileCheck %s -check-prefix=CHECK-LBA-SIL
// RUN: %target-run-simple-swift
// REQUIRES: executable_test

// `isLargeLoadableType` depends on the ABI and differs between architectures.
Expand Down
14 changes: 7 additions & 7 deletions test/AutoDiff/IRGen/loadable_by_address_cross_module.swift
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
// First, check that LBA actually modifies the function, so that this test is useful.

// RUN: %target-swift-frontend -emit-sil %S/Inputs/loadable_by_address_cross_module.swift -requirement-machine=off | %FileCheck %s -check-prefix=CHECK-MODULE-PRE-LBA
// RUN: %target-swift-frontend -c -Xllvm -sil-print-after=loadable-address %S/Inputs/loadable_by_address_cross_module.swift -requirement-machine=off 2>&1 | %FileCheck %s -check-prefix=CHECK-MODULE-POST-LBA
// RUN: %target-swift-frontend -emit-sil %S/Inputs/loadable_by_address_cross_module.swift | %FileCheck %s -check-prefix=CHECK-MODULE-PRE-LBA
// RUN: %target-swift-frontend -c -Xllvm -sil-print-after=loadable-address %S/Inputs/loadable_by_address_cross_module.swift 2>&1 | %FileCheck %s -check-prefix=CHECK-MODULE-POST-LBA

// CHECK-MODULE-PRE-LBA: sil {{.*}}LBAModifiedFunction{{.*}} $@convention(method) <T> (Float, LargeLoadableType<T>) -> Float
// CHECK-MODULE-POST-LBA: sil {{.*}}LBAModifiedFunction{{.*}} $@convention(method) <T> (Float, @in_constant LargeLoadableType<T>) -> Float

// Compile the module.

// RUN: %empty-directory(%t)
// RUN: %target-build-swift-dylib(%t/%target-library-name(external)) %S/Inputs/loadable_by_address_cross_module.swift -emit-module -emit-module-path %t/external.swiftmodule -module-name external -Xfrontend -requirement-machine=off
// RUN: %target-build-swift-dylib(%t/%target-library-name(external)) %S/Inputs/loadable_by_address_cross_module.swift -emit-module -emit-module-path %t/external.swiftmodule -module-name external

// Next, check that differentiability_witness_functions in the client get
// correctly modified by LBA.

// RUN: %target-swift-frontend -emit-sil -I%t %s -requirement-machine=off
// RUN: %target-swift-frontend -emit-sil -I%t %s -requirement-machine=off | %FileCheck %s -check-prefix=CHECK-CLIENT-PRE-LBA
// RUN: %target-swift-frontend -c -I%t %s -Xllvm -sil-print-after=loadable-address -requirement-machine=off 2>&1 | %FileCheck %s -check-prefix=CHECK-CLIENT-POST-LBA
// RUN: %target-swift-frontend -emit-sil -I%t %s
// RUN: %target-swift-frontend -emit-sil -I%t %s | %FileCheck %s -check-prefix=CHECK-CLIENT-PRE-LBA
// RUN: %target-swift-frontend -c -I%t %s -Xllvm -sil-print-after=loadable-address 2>&1 | %FileCheck %s -check-prefix=CHECK-CLIENT-POST-LBA

// CHECK-CLIENT-PRE-LBA: differentiability_witness_function [jvp] [reverse] [parameters 0 1] [results 0] <T> @${{.*}}LBAModifiedFunction{{.*}} : $@convention(method) <τ_0_0> (Float, LargeLoadableType<τ_0_0>) -> Float
// CHECK-CLIENT-PRE-LBA: differentiability_witness_function [vjp] [reverse] [parameters 0 1] [results 0] <T> @${{.*}}LBAModifiedFunction{{.*}} : $@convention(method) <τ_0_0> (Float, LargeLoadableType<τ_0_0>) -> Float
Expand All @@ -26,7 +26,7 @@

// Finally, execute the test.

// RUN: %target-build-swift -I%t -L%t %s -o %t/a.out %target-rpath(%t) -L%t -lexternal -Xfrontend -requirement-machine=off
// RUN: %target-build-swift -I%t -L%t %s -o %t/a.out %target-rpath(%t) -L%t -lexternal
// RUN: %target-codesign %t/a.out
// RUN: %target-codesign %t/%target-library-name(external)
// RUN: %target-run %t/a.out %t/%target-library-name(external)
Expand Down
2 changes: 1 addition & 1 deletion test/AutoDiff/SIL/Parse/sildeclref.sil
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %target-sil-opt %s -module-name=sildeclref_parse -requirement-machine off | %target-sil-opt -module-name=sildeclref_parse -requirement-machine off | %FileCheck %s
// RUN: %target-sil-opt %s -module-name=sildeclref_parse -requirement-machine=off | %target-sil-opt -module-name=sildeclref_parse -requirement-machine=off | %FileCheck %s
// Parse AutoDiff derivative SILDeclRefs via `witness_method` and `class_method` instructions.

import Swift
Expand Down
2 changes: 1 addition & 1 deletion test/AutoDiff/SILGen/autodiff_builtins.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %target-swift-frontend -parse-stdlib -emit-silgen %s -requirement-machine=off | %FileCheck %s
// RUN: %target-swift-frontend -parse-stdlib -emit-silgen %s | %FileCheck %s

import _Differentiation
import Swift
Expand Down
2 changes: 1 addition & 1 deletion test/AutoDiff/SILGen/reabstraction.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %target-swift-frontend -emit-silgen %s -requirement-machine=off | %FileCheck %s
// RUN: %target-swift-frontend -emit-silgen %s | %FileCheck %s

import _Differentiation

Expand Down
2 changes: 1 addition & 1 deletion test/AutoDiff/SILOptimizer/generics.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %target-swift-emit-sil -verify %s -requirement-machine=off | %FileCheck %s -check-prefix=CHECK-SIL
// RUN: %target-swift-emit-sil -verify %s | %FileCheck %s -check-prefix=CHECK-SIL

import _Differentiation

Expand Down
2 changes: 1 addition & 1 deletion test/AutoDiff/SILOptimizer/property_wrappers.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %target-swift-frontend -emit-sil -verify %s %S/Inputs/nontrivial_loadable_type.swift -requirement-machine=off
// RUN: %target-swift-frontend -emit-sil -verify %s %S/Inputs/nontrivial_loadable_type.swift
// REQUIRES: asserts

// Test property wrapper differentiation coverage for a variety of property
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: %target-build-swift %s -Xfrontend -requirement-machine=off
// RUN: %target-swift-frontend -c -g -Xllvm -verify-di-holes=true %s -requirement-machine=off
// RUN: %target-build-swift %s
// RUN: %target-swift-frontend -c -g -Xllvm -verify-di-holes=true %s

// rdar://74087329 (DI verification failure with trampoline blocks in VJP)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %target-swift-frontend -enable-resilience -emit-sil -verify %s -requirement-machine=off
// RUN: %target-swift-frontend -enable-resilience -emit-sil -verify %s

// SR-12641: SILGen verification error regarding `ImmutableAddressUseVerifier` and AutoDiff-generated code.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %target-swift-frontend -emit-sil -verify %s -requirement-machine=off
// RUN: %target-swift-frontend -emit-sil -verify -requirement-machine=off %s

// SR-12744: Pullback generation crash for unhandled indirect result.
// May be due to inconsistent derivative function type calculation logic in
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %target-build-swift %s -Xfrontend -requirement-machine=off
// RUN: %target-build-swift %s

// SR-13933: Fix "multiple consuming users" ownership error caused by
// `VJPCloner::visitApply` related to `@differentiable`-function-typed callees.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift -emit-module -module-name tf1202 -emit-module-path %t/tf1202.swiftmodule %S/Inputs/tf1202-differentiability-witness-dead-function-elimination.swift -Xfrontend -requirement-machine=off
// RUN: %target-build-swift -I%t -emit-module -O %s -Xfrontend -requirement-machine=off
// RUN: %target-build-swift -emit-module -module-name tf1202 -emit-module-path %t/tf1202.swiftmodule %S/Inputs/tf1202-differentiability-witness-dead-function-elimination.swift
// RUN: %target-build-swift -I%t -emit-module -O %s

// TF-1202: test bug where DeadFunctionElimination eliminated the
// SILFunction for `func identity<T>` even though a differentiability witness for it
Expand Down
2 changes: 1 addition & 1 deletion test/AutoDiff/mangling.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %target-swift-frontend -emit-sil -enable-experimental-forward-mode-differentiation -module-name=mangling -verify %s -requirement-machine=off | %FileCheck %s
// RUN: %target-swift-frontend -emit-sil -enable-experimental-forward-mode-differentiation -module-name=mangling -verify -requirement-machine=off %s | %FileCheck %s

import _Differentiation

Expand Down
2 changes: 1 addition & 1 deletion test/AutoDiff/stdlib/anydifferentiable.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %target-run-simple-swift(-Xfrontend -requirement-machine=off)
// RUN: %target-run-simple-swift
// REQUIRES: executable_test

import _Differentiation
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %target-run-simple-swift(-Xfrontend -requirement-machine=off)
// RUN: %target-run-simple-swift
// REQUIRES: executable_test

import _Differentiation
Expand Down
2 changes: 1 addition & 1 deletion test/AutoDiff/stdlib/derivative_customization.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %target-run-simple-swift(-Xfrontend -requirement-machine=off)
// RUN: %target-run-simple-swift
// REQUIRES: executable_test

import DifferentiationUnittest
Expand Down
2 changes: 1 addition & 1 deletion test/AutoDiff/stdlib/differential_operators.swift.gyb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: %empty-directory(%t)
// RUN: %gyb %s -o %t/differential_operators.swift
// RUN: %target-build-swift %t/differential_operators.swift -o %t/differential_operators -Xfrontend -requirement-machine=off
// RUN: %target-build-swift %t/differential_operators.swift -o %t/differential_operators
// RUN: %target-codesign %t/differential_operators
// RUN: %target-run %t/differential_operators
// REQUIRES: executable_test
Expand Down
2 changes: 1 addition & 1 deletion test/AutoDiff/stdlib/floating_point.swift.gyb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %target-run-simple-swiftgyb(-Xfrontend -enable-experimental-forward-mode-differentiation -Xfrontend -requirement-machine=off)
// RUN: %target-run-simple-swiftgyb(-Xfrontend -enable-experimental-forward-mode-differentiation)
// REQUIRES: executable_test

#if !(os(Windows) || os(Android)) && (arch(i386) || arch(x86_64))
Expand Down
2 changes: 1 addition & 1 deletion test/AutoDiff/stdlib/simd.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %target-run-simple-swift(-Xfrontend -requirement-machine=off)
// RUN: %target-run-simple-swift
// REQUIRES: executable_test

// Would fail due to unavailability of swift_autoDiffCreateLinearMapContext.
Expand Down
2 changes: 1 addition & 1 deletion test/AutoDiff/stdlib/tgmath_derivatives.swift.gyb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %target-run-simple-swiftgyb(-Xfrontend -enable-experimental-forward-mode-differentiation -Xfrontend -requirement-machine=off)
// RUN: %target-run-simple-swiftgyb(-Xfrontend -enable-experimental-forward-mode-differentiation)
// REQUIRES: executable_test

#if canImport(Darwin)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %target-run-simple-swift(-Xfrontend -requirement-machine=off)
// RUN: %target-run-simple-swift
// REQUIRES: executable_test

// Would fail due to unavailability of swift_autoDiffCreateLinearMapContext.
Expand Down
2 changes: 1 addition & 1 deletion test/AutoDiff/validation-test/array.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %target-run-simple-swift(-Xfrontend -requirement-machine=off)
// RUN: %target-run-simple-swift
// REQUIRES: executable_test

// Would fail due to unavailability of swift_autoDiffCreateLinearMapContext.
Expand Down
4 changes: 2 additions & 2 deletions test/AutoDiff/validation-test/class_differentiation.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: %target-run-simple-swift(-Xfrontend -requirement-machine=off)
// RUN: %target-run-simple-swift
// NOTE: Verify whether forward-mode differentiation crashes. It currently does.
// RUN: not --crash %target-swift-frontend -enable-experimental-forward-mode-differentiation -emit-sil %s -requirement-machine=off
// RUN: not --crash %target-swift-frontend -enable-experimental-forward-mode-differentiation -emit-sil %s
// REQUIRES: executable_test

import StdlibUnittest
Expand Down
2 changes: 1 addition & 1 deletion test/AutoDiff/validation-test/control_flow.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %target-run-simple-swift(-Xfrontend -requirement-machine=off)
// RUN: %target-run-simple-swift
// REQUIRES: executable_test

// FIXME(SR-12741): Enable test for all platforms after debugging
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift-dylib(%t/%target-library-name(module1)) %S/Inputs/cross_module_derivative_attr/module1/module1.swift %S/Inputs/cross_module_derivative_attr/module1/module1_other_file.swift -emit-module -emit-module-path %t/module1.swiftmodule -module-name module1 -Xfrontend -requirement-machine=off
// RUN: %target-build-swift -I%t -L%t %S/Inputs/cross_module_derivative_attr/main/main.swift -o %t/a.out -lmodule1 %target-rpath(%t) -Xfrontend -requirement-machine=off
// RUN: %target-build-swift-dylib(%t/%target-library-name(module1)) %S/Inputs/cross_module_derivative_attr/module1/module1.swift %S/Inputs/cross_module_derivative_attr/module1/module1_other_file.swift -emit-module -emit-module-path %t/module1.swiftmodule -module-name module1
// RUN: %target-build-swift -I%t -L%t %S/Inputs/cross_module_derivative_attr/main/main.swift -o %t/a.out -lmodule1 %target-rpath(%t)
// RUN: %target-codesign %t/a.out
// RUN: %target-codesign %t/%target-library-name(module1)
// RUN: %target-run %t/a.out %t/%target-library-name(module1)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift-dylib(%t/%target-library-name(cross_module_differentiation_other)) %S/Inputs/cross_module_differentiation_other.swift -emit-module -emit-module-path %t/cross_module_differentiation_other.swiftmodule -module-name cross_module_differentiation_other -Xfrontend -requirement-machine=off
// RUN: %target-build-swift -I%t -L%t %s -o %t/a.out -lcross_module_differentiation_other %target-rpath(%t) -Xfrontend -requirement-machine=off
// RUN: %target-build-swift-dylib(%t/%target-library-name(cross_module_differentiation_other)) %S/Inputs/cross_module_differentiation_other.swift -emit-module -emit-module-path %t/cross_module_differentiation_other.swiftmodule -module-name cross_module_differentiation_other
// RUN: %target-build-swift -I%t -L%t %s -o %t/a.out -lcross_module_differentiation_other %target-rpath(%t)
// RUN: %target-codesign %t/a.out
// RUN: %target-codesign %t/%target-library-name(cross_module_differentiation_other)
// RUN: %target-run %t/a.out %t/%target-library-name(cross_module_differentiation_other)
Expand Down
2 changes: 1 addition & 1 deletion test/AutoDiff/validation-test/custom_derivatives.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %target-run-simple-swift(-Xfrontend -requirement-machine=off)
// RUN: %target-run-simple-swift
// REQUIRES: executable_test

import StdlibUnittest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %target-run-simple-swift(-Xfrontend -requirement-machine=off)
// RUN: %target-run-simple-swift
// REQUIRES: executable_test

import StdlibUnittest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %target-run-simple-swift(-Xfrontend -requirement-machine=off)
// RUN: %target-run-simple-swift
// REQUIRES: executable_test

// An end-to-end test that we can differentiate property accesses, with custom
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %target-run-simple-swift(-Xfrontend -requirement-machine=off)
// RUN: %target-run-simple-swift
// REQUIRES: executable_test

// Disabled due to test failure with `-O`: SR-13250.
Expand Down
2 changes: 1 addition & 1 deletion test/AutoDiff/validation-test/existential.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %target-run-simple-swift(-Xfrontend -requirement-machine=off)
// RUN: %target-run-simple-swift
// REQUIRES: executable_test

import StdlibUnittest
Expand Down
2 changes: 1 addition & 1 deletion test/AutoDiff/validation-test/forward_mode_array.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %target-run-simple-swift(-Xfrontend -enable-experimental-forward-mode-differentiation -Xfrontend -requirement-machine=off)
// RUN: %target-run-simple-swift(-Xfrontend -enable-experimental-forward-mode-differentiation)
// REQUIRES: executable_test

import StdlibUnittest
Expand Down
2 changes: 1 addition & 1 deletion test/AutoDiff/validation-test/forward_mode_inout.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %target-run-simple-swift(-Xfrontend -enable-experimental-forward-mode-differentiation -Xfrontend -requirement-machine=off)
// RUN: %target-run-simple-swift(-Xfrontend -enable-experimental-forward-mode-differentiation)
// REQUIRES: executable_test

import StdlibUnittest
Expand Down
Loading