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

Fix create new target_machine for every program #14694

Merged
merged 1 commit into from
Jun 12, 2024

Conversation

straight-shoota
Copy link
Member

Compiler#new_program instantiates a new Program instance which is used for compiling a macro run program. Some properties (such as codegen target) can be shared between multiple compilations. But the TargetMachine instance must not be shared because this would leak potentially incompatible data layouts between programs.
This patch creates a new instance of TargetMachine for every program.

See #14496 (comment) and previous comments for details.

Resolves (probably) #14496

@beta-ziliani
Copy link
Member

beta-ziliani commented Jun 11, 2024

What's the real difference? IIUC the original program was calling the getter, who was in turn creating an instance.

EDIT: Answer to self: That isn't cached by the getter.

@straight-shoota straight-shoota added this to the 1.13.0 milestone Jun 11, 2024
@straight-shoota straight-shoota merged commit 1a6686a into master Jun 12, 2024
122 checks passed
@straight-shoota straight-shoota deleted the fix/new_program-fresh-target_machine branch June 12, 2024 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:compiler:codegen
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants