Skip to content

[AutoDiff] Remove unused joinElementTypes* methods. #28598

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 1 commit into from
Dec 6, 2019
Merged
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
25 changes: 0 additions & 25 deletions lib/SILOptimizer/Mandatory/Differentiation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,31 +116,6 @@ static void collectAllActualResultsInTypeOrder(
}
}

/// Given a range of types, joins these into a single type. If there's exactly
/// one element type, returns that element type. Otherwise, creates a tuple type
/// of all element types.
template <typename TypeRange>
static CanType joinElementTypes(TypeRange &&range, const ASTContext &ctx) {
if (range.size() == 1)
return range.front();
auto typeElts =
map<SmallVector<TupleTypeElt, 8>>(range, [&](Type type) { return type; });
return TupleType::get(typeElts, ctx);
}

/// Given a range of SIL values, retrieves the canonical types of these values,
/// and joins these types into a single type.
template <typename SILValueRange>
static CanType joinElementTypesFromValues(SILValueRange &&range,
const ASTContext &ctx) {
if (range.size() == 1)
return range.front()->getType().getASTType();
SmallVector<TupleTypeElt, 8> elts;
transform(range, elts.begin(),
[&](SILValue val) { return val->getType().getASTType(); });
return TupleType::get(elts, ctx)->getCanonicalType();
}

/// Returns the "constrained" derivative generic signature given:
/// - An original SIL function type.
/// - A wrt parameter index subset.
Expand Down