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

Using sha256 to compare strings is stressing out the register allocator. #4356

Open
otrho opened this issue Mar 27, 2023 · 0 comments
Open
Assignees
Labels
compiler: codegen Everything to do with IR->ASM, register allocation, etc. P: high Should be looked at if there are no critical issues left

Comments

@otrho
Copy link
Contributor

otrho commented Mar 27, 2023

In #4336 I had to massage both the stdlib/vec and test_contracts/basic_storage tests to isolate parts which were comparing strings. They were using assert(sha256(str_a) == sha256(str_b)). For some reason putting a few of these together would use up all the registers.

I have a hunch it's because both sha256 and assert use ASM blocks which are optimisation blockers. But there might be a simple solution.

The register allocator is to be rewritten next so this isn't necessarily high priority, but if there is a simple fix then it's worth taking a look.

@otrho otrho added P: high Should be looked at if there are no critical issues left compiler: codegen Everything to do with IR->ASM, register allocation, etc. labels Mar 27, 2023
@otrho otrho self-assigned this Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler: codegen Everything to do with IR->ASM, register allocation, etc. P: high Should be looked at if there are no critical issues left
Projects
None yet
Development

No branches or pull requests

1 participant