Skip to content

Commit 3ab94f1

Browse files
committed
Comment out an expensive assert in type lowering.
For very large types (e.g. tuples with many elements), this assertion is very expensive to execute, because the `isLegalSILType` status is not cached.
1 parent ae7e5b5 commit 3ab94f1

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/SIL/IR/TypeLowering.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3047,9 +3047,12 @@ const TypeLowering &TypeConverter::getTypeLoweringForLoweredType(
30473047
AbstractionPattern origType, CanType loweredType,
30483048
TypeExpansionContext forExpansion,
30493049
IsTypeExpansionSensitive_t isTypeExpansionSensitive) {
3050-
assert(loweredType->isLegalSILType() && "type is not lowered!");
3051-
(void)loweredType;
3052-
3050+
3051+
// For very large types (e.g. tuples with many elements), this assertion is
3052+
// very expensive to execute, because the `isLegalSILType` status is not cached.
3053+
// Therefore the assert is commented out and only here for documentation purposes.
3054+
// assert(loweredType->isLegalSILType() && "type is not lowered!");
3055+
30533056
// Cache the lowered type record for a contextualized type independent of the
30543057
// abstraction pattern. Lowered type parameters can't be cached or looked up
30553058
// without context. (TODO: We could if they match the out-of-context

0 commit comments

Comments
 (0)