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

compiler: allow to use multiple returns in inlined functions #2594

Merged
merged 3 commits into from
Jul 12, 2022

Conversation

fyrchik
Copy link
Contributor

@fyrchik fyrchik commented Jul 12, 2022

Close #2587.

@codecov
Copy link

codecov bot commented Jul 12, 2022

Codecov Report

Merging #2594 (17329ee) into master (125c280) will decrease coverage by 0.00%.
The diff coverage is 96.07%.

@@            Coverage Diff             @@
##           master    #2594      +/-   ##
==========================================
- Coverage   84.58%   84.58%   -0.01%     
==========================================
  Files         298      298              
  Lines       37836    37841       +5     
==========================================
+ Hits        32003    32006       +3     
- Misses       4424     4425       +1     
- Partials     1409     1410       +1     
Impacted Files Coverage Δ
pkg/compiler/func_scope.go 100.00% <ø> (ø)
pkg/compiler/codegen.go 92.36% <95.23%> (-0.11%) ⬇️
pkg/compiler/inline.go 96.75% <100.00%> (+0.07%) ⬆️
pkg/core/transaction/transaction.go 85.18% <0.00%> (-1.49%) ⬇️
pkg/network/server.go 74.09% <0.00%> (+0.09%) ⬆️
pkg/network/compress.go 76.00% <0.00%> (+12.00%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9414538...17329ee. Read the comment docs.

pkg/compiler/byte_conversion_test.go Outdated Show resolved Hide resolved
pkg/compiler/byte_conversion_test.go Outdated Show resolved Hide resolved
pkg/compiler/inline_test.go Outdated Show resolved Hide resolved
pkg/compiler/inline_test.go Outdated Show resolved Hide resolved
pkg/compiler/codegen.go Outdated Show resolved Hide resolved
First replace parts to be removed with NOPs, then actually remove.

Signed-off-by: Evgeniy Stratonikov <[email protected]>
In case there are no returns in the inlined function, jumps point to the
next instruction and can be omitted. This optimization can be extended
to handle other cases, here we just make sure that already existing code
stays the same.

Signed-off-by: Evgeniy Stratonikov <[email protected]>
@roman-khimov roman-khimov merged commit 71b721c into master Jul 12, 2022
@roman-khimov roman-khimov deleted the compiler-inline-return branch July 12, 2022 18:52
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.

Unexpected compiler behaviour while inlining interop function
3 participants