(Translated by https://www.hiragana.jp/)
[PrepareForEmission] Hoist registers in a procedural region with `disallowLocalVariables` by uenoku · Pull Request #7404 · llvm/circt · GitHub
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

[PrepareForEmission] Hoist registers in a procedural region with disallowLocalVariables #7404

Merged
merged 1 commit into from
Jul 30, 2024

Conversation

uenoku
Copy link
Member

@uenoku uenoku commented Jul 30, 2024

Fix #7399

@uenoku
Copy link
Member Author

uenoku commented Jul 30, 2024

The diff is very small and it fixes the crash reported so I'm going to merge it.

@uenoku uenoku changed the title [PrepareForEmission] Hoist registers in a procedural region with `dis… [PrepareForEmission] Hoist registers in a procedural region with disallowLocalVariables Jul 30, 2024
@uenoku uenoku merged commit 68b568b into main Jul 30, 2024
4 checks passed
@uenoku uenoku deleted the dev/hidetou/fix-reg branch July 30, 2024 15:20
@dtzSiFive
Copy link
Contributor

LGTM, sorry I got lost chasing down whether this was "correct" if it had an initializer and checking consistent handling other places specific to LogicOp (or RegOp). LogicOp doesn't have this concern since it doesn't support an initializer. The initialization is a one-time thing so I was thinking that pulling that out of a procedural block could change when that occurs (including how many times?). Not sure that's the case, got pulled into other things before chasing down more thoroughly. WDYT?

While pushing on that I ran into a bug I filed as #7405 , that isn't what I describe above but something breaks def-before-use.

@uenoku
Copy link
Member Author

uenoku commented Jul 31, 2024

Thank you for pointing this out! I was slightly surprised that reg op initial operand is not restricted to constant. I think for RegOp with initial operand under disallowLocalVariables, PrepareForEmission should drop initialization operand in reg op declaration but create sv.bpassign in the original position. WDYT?

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.

[ExportVerilog] Comb ExtractOp assertion "should be handled by isExpressionUnableToInline" failed
2 participants