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

Don't create instructions for implicit constants. #4497

Merged
merged 2 commits into from
Nov 6, 2024

Conversation

zygoloid
Copy link
Contributor

@zygoloid zygoloid commented Nov 6, 2024

When an instruction is created as part of an implicit call to an
interface member, we generated a bunch of constants for naming the
interface, finding the corresponding specific, accessing its member
function, and so on. This led to significant bloat in SemIR.

Instead, we now track whether an instruction is created implicitly in
its location, and where relevant, we use the constant value of the
instruction directly instead of storing a new Inst.

This doesn't reduce the amount of work we need to do, but does make the
representation in SemIR smaller and more readable.

When an instruction is created as part of an implicit call to an
interface member, we generated a bunch of constants for naming the
interface, finding the corresponding specific, accessing its member
function, and so on. This led to significant bloat in SemIR.

Instead, we now track whether an instruction is created implicitly in
its location, and where relevant, we use the constant value of the
instruction directly instead of storing a new `Inst`.

This doesn't reduce the amount of work we need to do, but does make the
representation in SemIR smaller and more readable.
@zygoloid
Copy link
Contributor Author

zygoloid commented Nov 6, 2024

I'm not entirely sure whether this is a good direction, but it seems like it should be easy to back out if we decide we don't like it.

@josh11b josh11b added this pull request to the merge queue Nov 6, 2024
Merged via the queue into carbon-language:trunk with commit fcabeb6 Nov 6, 2024
10 checks passed
@zygoloid zygoloid deleted the toolchain-no-implicit-semir branch November 20, 2024 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants