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

[Mips][AsmPrinter] Fix for assembler not printing a label #80666

Closed

Conversation

urosbericsyrmia
Copy link

This PR is a fix for a bug that manifests in rust-lang/rust#108835.
rustc-demangle couldn't compile due to an undefined temporary symbol error which arises when the assembly code is branching to a basic block whose label is not emitted.
One of the reasons not to emit the label of a basic block is when that block is only reachable by fallthrough. If a block has only one predecessor and that predecessor is immediately before it, the block is reachable only by fallthrough. The problem is that the MipsAsmPrinter didn't take it into account what if that predecessor also branches to this basic block, which in this case happens. In that case, we need a label for the block.
The solution is to check if the predecessor branches to this basic block.

Copy link

github-actions bot commented Feb 5, 2024

Thank you for submitting a Pull Request (PR) to the LLVM Project!

This PR will be automatically labeled and the relevant teams will be
notified.

If you wish to, you can add reviewers by using the "Reviewers" section on this page.

If this is not working for you, it is probably because you do not have write
permissions for the repository. In which case you can instead tag reviewers by
name in a comment by using @ followed by their GitHub username.

If you have received no comments on your PR for a week, you can request a review
by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate
is once a week. Please remember that you are asking for valuable time from other developers.

If you have further questions, they may be answered by the LLVM GitHub User Guide.

You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums.

Copy link

github-actions bot commented Feb 5, 2024

⚠️ We detected that you are using a GitHub private e-mail address to contribute to the repo.
Please turn off Keep my email addresses private setting in your account.

1 similar comment
Copy link

github-actions bot commented Feb 5, 2024

⚠️ We detected that you are using a GitHub private e-mail address to contribute to the repo.
Please turn off Keep my email addresses private setting in your account.

@urosbericsyrmia urosbericsyrmia force-pushed the mips-asm-printer-label-fix branch from c3be89b to b763ac6 Compare February 5, 2024 12:21
@MaskRay
Copy link
Member

MaskRay commented Feb 6, 2024

Thanks for the analysis. I think we can just remove the derived isBlockOnlyReachableByFallthrough #80799

@urosbericsyrmia
Copy link
Author

Thanks for the feedback. Should I close this one?

@MaskRay
Copy link
Member

MaskRay commented Feb 7, 2024

Thanks for the feedback. Should I close this one?

Sounds good since Fast-ISel/pr40325.ll covers the case.

@brad0 brad0 closed this Feb 8, 2024
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.

3 participants