Skip to content
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

SIL: Tiny conformance substitution cleanups #80594

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

slavapestov
Copy link
Contributor

Follow-up to #80482 that removes origType plumbing from a few more places in SIL.

@@ -71,9 +71,8 @@ public struct WitnessTable : CustomStringConvertible, NoReflectionChildren {
OptionalBridgedFunction(obj: witness?.bridged.obj))
case .associatedType(let requirement, let witness):
return BridgedWitnessTableEntry.createAssociatedType(requirement.bridged, witness.bridged)
case .associatedConformance(let requirement, let substType, let witness):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eeckstein I was lazy but the substType tuple element can be removed from this enum case entirely now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove the enum case in this PR? Shouldn't be too much work.

Copy link
Contributor Author

@slavapestov slavapestov Apr 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. (it's a tuple field in an enum case, not the whole enum case that I removed.)

@slavapestov slavapestov force-pushed the sil-abstract-conformance-cleanup branch 2 times, most recently from 5bb42c3 to 99cd4bd Compare April 7, 2025 16:02
return;
makeAlive(WT);

// FIXME: If 'concrete' is a SpecializedProtocolConformance,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eeckstein Thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It actually doesn't matter because we don't do dead witnesstable elimination. In findAnchorsInTables we set all witness tables alive. We had to do this because it's almost impossible to find all references to witness tables in SIL. Only IRGen knows that - and we emit witness tables lazily there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah. I'll just delete the logic then since it's pointless to keep around code that is unused and incorrect.

@@ -71,9 +71,8 @@ public struct WitnessTable : CustomStringConvertible, NoReflectionChildren {
OptionalBridgedFunction(obj: witness?.bridged.obj))
case .associatedType(let requirement, let witness):
return BridgedWitnessTableEntry.createAssociatedType(requirement.bridged, witness.bridged)
case .associatedConformance(let requirement, let substType, let witness):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove the enum case in this PR? Shouldn't be too much work.

return;
makeAlive(WT);

// FIXME: If 'concrete' is a SpecializedProtocolConformance,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It actually doesn't matter because we don't do dead witnesstable elimination. In findAnchorsInTables we set all witness tables alive. We had to do this because it's almost impossible to find all references to witness tables in SIL. Only IRGen knows that - and we emit witness tables lazily there.

@slavapestov slavapestov force-pushed the sil-abstract-conformance-cleanup branch 2 times, most recently from 0625b16 to f7fc125 Compare April 7, 2025 19:17
Copy link
Contributor

@eeckstein eeckstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks!

@slavapestov slavapestov force-pushed the sil-abstract-conformance-cleanup branch from f7fc125 to be5d03f Compare April 8, 2025 02:14
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov
Copy link
Contributor Author

@swift-ci Please test source compatibility

@eeckstein
Copy link
Contributor

@swift-ci benchmark

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants