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

[Emit] Copy fragments into modules created by ExtractTestCode #6843

Merged
merged 1 commit into from Mar 18, 2024

Conversation

nandor
Copy link
Contributor

@nandor nandor commented Mar 18, 2024

This ensures that the extracted modules have the same fragments included as the original modules.

@nandor nandor requested a review from dtzSiFive March 18, 2024 14:19
Copy link
Contributor

@dtzSiFive dtzSiFive 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!

Are all fragments something that makes sense to copy and emit along with the extracted modules (idempotent maybe, benign if not needed/relevant?)?

In practice I think this is fine (set macro to default if not set), but just wondering what the contract of "emit.fragments" is and that relationship to how ETC works.

If this pass is only meant to be used with our pipeline (probably?) maybe that's not a big deal (re:relying on IR only using them in the way that makes this safe).

Maybe this is part of emit.fragments intended/required usage anyway?

@nandor
Copy link
Contributor Author

nandor commented Mar 18, 2024

Copying everything is the safe bet here. Normally, if we move all asserts into the companion module, we can move the fragment there too, but here we don't really have the necessary information to do that nicely. We can safely over-approximate and emit fragments since they are idempotent.

@nandor nandor merged commit 6d40b28 into main Mar 18, 2024
4 checks passed
@nandor nandor deleted the nandor/emit-fix branch March 18, 2024 14:32
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.

None yet

2 participants