-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
eof: Update yul legacy tests #15658
eof: Update yul legacy tests #15658
Conversation
Thank you for your contribution to the Solidity compiler! A team member will follow up shortly. If you haven't read our contributing guidelines and our review checklist before, please do it now, this makes the reviewing process and accepting your contribution smoother. If you have any questions or need our help, feel free to post them in the PR or talk to us directly on the #solidity-dev channel on Matrix. |
4964479
to
ccf6260
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problems here, but there are quite a few tests that can be easily made portable with small adjustments. And some cases where multiple tests are crammed into one file and we could easily restrict only one part and let the rest run for all backends.
test/libyul/yulOptimizerTests/equalStoreEliminator/branching.yul
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a general note: there are a few tests like this one that don't necessarily need a separate EOF version, but are relevant to all the backends, not just legacy
. Keeping them restricted to legacy
runs the risk that in the future someone will assume that they can be dropped along with legacy backend. Not sure how to prevent that. Maybe we should revisit the PR and switch them to EOF when it becomes the default backend.
test/libyul/yulOptimizerTests/expressionSimplifier/zero_length_read.yul
Outdated
Show resolved
Hide resolved
ccf6260
to
d3c09aa
Compare
// let _5 := 0 | ||
// sstore(_5, _4) | ||
// pop(extcall(_5, _5, _5, _5)) | ||
// sstore(_5, _1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. The original test had an unresolved mload()
here.
This seems to be the practical effect of the fact that we have to assume that CALL
writes memory but EXTCALL
can only ever read it.
CALL
's write could be figured out to have no impact but apparently we ignore its length.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But I just noticed something in SemanticInfo.cpp
that looks like a bug:
solidity/libevmasm/SemanticInformation.cpp
Lines 184 to 188 in f632ec8
if (_instruction == Instruction::EXTDELEGATECALL) | |
{ | |
operations.emplace_back(Operation{Location::Storage, Effect::Write, {}, {}, {}}); | |
operations.emplace_back(Operation{Location::TransientStorage, Effect::Write, {}, {}, {}}); | |
} |
Looks like we decided to mark EXTDELEGATECALL
as writing storage/tstorage, but not EXTCALL
, even though CALL
is marked as such. I may have been thinking only about direct writes when I reviewed it but I guess EXTCALL
can modify storage indirectly, by calling a function that can do that. We should fix that (and make sure there's a test where the difference shows).
test/libyul/yulOptimizerTests/loopInvariantCodeMotion/no_move_gas.yul
Outdated
Show resolved
Hide resolved
test/libyul/yulOptimizerTests/fullSuite/unusedFunctionParameterPruner.yul
Outdated
Show resolved
Hide resolved
d3c09aa
to
3dc0fea
Compare
There are still two unaddressed things here: #15658 (comment) and #15658 (comment). After that we can merge. |
3dc0fea
to
e96c085
Compare
test/libyul/yulOptimizerTests/loopInvariantCodeMotion/no_move_gas.yul
Outdated
Show resolved
Hide resolved
e96c085
to
105b6db
Compare
105b6db
to
c9466e5
Compare
Add
bytecodeFormat: legacy
to all tests which are supposed to run in legacy bytecode mode only.