Commit Graph

41 Commits

Author SHA1 Message Date
Derek Gottfrid
3f62ab069c fix test w/ signed issues 2022-07-03 16:33:22 -04:00
Daniel Kirchner
e0c837b33b Remove isCreation flag from OptimiserSettings. 2022-03-09 17:53:28 +01:00
Daniel Kirchner
ce0a3e93f2 Store whether an evmasm Assembly is creation code. 2022-03-09 17:42:29 +01:00
Kamil Śliwak
6ad6fa2382 Do not hard-code the default 'runs' value as 200 in code that fills out optimizer settings 2021-06-28 14:12:28 +02:00
hrkrshnn
8b4eaeabbf Added a few optimizer tests for Verbatim 2021-04-28 09:56:45 +02:00
chriseth
e2d8005737 Add verbatim builtin. 2021-04-26 19:56:44 +02:00
hrkrshnn
4fbf5a3f12 Added few more tests for low level inliner. 2021-03-24 13:50:24 +01:00
Daniel Kirchner
8b3095920a Inline ordinary jumps to small blocks and jumps to terminating control flow. 2021-03-24 13:50:24 +01:00
Daniel Kirchner
cb74a45fd6 Add inlining for old optimizer. 2021-02-09 19:08:58 +01:00
Alex Beregszaszi
7e88ba8da0 Enable the -Wconversion warning 2020-12-08 16:45:24 +00:00
Sachin Grover
b7adb2aa42 Add SPDX license identifier if not present already in source file
Fixes: #9220
2020-07-17 20:24:12 +05:30
Djordje Mijovic
e4e3f49844 Fixing signedness conversion warnings in libevmasm
Co-authored-by: Harikrishnan Mulackal <webmail.hari@gmail.com>
2020-06-03 13:25:43 +02:00
a3d4
a499ef16fa Fix spelling errors 2020-05-25 02:54:37 +02:00
Daniel Kirchner
04d8ad2ae1 Legacy codegeneration for immutable state variables. 2020-03-24 16:45:25 +01:00
alex
e4b18e85e6 Replaced SourceLocation::isEmpty() with isValid() and hasText().
The function SourceLocation::isEmpty() had somewhat dual role.
Sometimes it indicates that the SourceLocation is invalid.
Sometimes it means that there is no corresponding source text.

Hence the proposal is to replace it with two functions, isValid() and hasText().

I also removed Scanner::sourceAt(). (Do we have a rule of thumb to remove unused code?)

Since hasText() checks that start and end are valid indices for source, I adjusted a couple of tests to avoid empty source strings.
2020-02-03 08:04:21 +01:00
Mathias Baumann
00e4d13975 TestFramework: Merge Options.h into Common.h 2020-01-29 12:27:05 +01:00
Christian Parpart
ed45b000d1 Adapt tests directory to C++ namespace changes. 2020-01-07 15:51:50 +01:00
Christian Parpart
6b23412fae C++ namespace cleanup (except tests). 2020-01-07 15:51:50 +01:00
Mathias Baumann
5c66ccc179 Optimize obsolete ANDs in combination with certain SHIFTs 2019-03-29 10:08:05 +01:00
Alex Beregszaszi
84fbf605aa Replace shifts by larger than 255 with 0 2019-03-29 10:07:54 +01:00
Bhargava Shastry
f7b5a27581 Fixes bug in byte optimization rule and adds tests. 2019-03-21 14:29:06 +01:00
Bhargava Shastry
515fa872c8 Fixes u256 overflow in logical shift optimization rule and adds tests. 2019-03-13 11:19:20 +01:00
chriseth
e0d1b2f5b3 Peephole optimizer for "iszero iszero <tag> jumpi". 2019-03-07 15:52:02 +01:00
chriseth
851dd635eb Remove defaults in constructor arguments. 2019-03-04 11:41:52 +01:00
Christian Parpart
d10bae245e
liblangutil: SourceLocation to default initialize data members (w/o the use of ctor)
See: http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#c45-dont-define-a-default-constructor-that-only-initializes-data-members-use-in-class-member-initializers-instead
2018-12-19 11:21:45 +01:00
Christian Parpart
c48a5264be
liblangutil: SourceLocation: adds (shared) pointer to underlying CharStream source, eliminating sourceName
Also, adapted affecting code to those changes.
2018-11-30 17:07:12 +01:00
Christian Parpart
d67322a186 Introduce namespace langutil in liblangutil directory.
Also:
- Use {}-style list initialisation for SourceLocation construction
- Introduce new system includes
- Changes the API of the Scanner to take source as value (with move) as opposed to as a reference
2018-11-21 19:13:44 +00:00
Matías Aereal Aeón
e902ce1aa0 Removing std:: from std::to_string and include for boost/lexical_cast 2018-08-08 11:26:30 -03:00
Nicolás Venturo
804eb3ef9d Improves peephole_truthy_and test case 2018-06-19 17:09:50 -03:00
Nicolás Venturo
172e208c6a Add TruthyAnd Peephole optimization 2018-06-15 11:27:39 -03:00
Alex Beregszaszi
38460d8b47 Remove unnecessary masking of the result of known short instructions 2018-04-19 23:59:06 +01:00
Alex Beregszaszi
02ea0e547f Replace comparison operators with opposites if preceded by SWAP1 2018-04-04 17:47:58 +02:00
Alex Beregszaszi
be6051bead Test multiple instructions with the (non)commutative peephole optimiser 2018-04-03 18:57:28 +02:00
Alex Beregszaszi
17bcabb6cf Remove useless SWAP1 in front of commutative operations 2018-04-03 18:57:07 +02:00
chriseth
6777f7a57f Optimize across MLOAD if MSIZE is not used. 2018-04-03 14:34:32 +02:00
Daniel Kirchner
d63d41b3b5 test: Rename test/TestHelper.* to test/Options.* and add Options::validate(). 2018-03-14 12:04:04 +01:00
chriseth
6ec4517929 Use EVM version in gas meter and optimizer. 2018-03-05 11:36:33 +01:00
chriseth
7c94e5462a Assume peephole optimizer was successful if number of pops increased. 2017-10-13 19:00:56 +02:00
chriseth
223235c97e Add test for jumpdest removal. 2017-08-25 10:42:36 +01:00
Alex Beregszaszi
b3986f1d07 Remove some unused includes 2017-08-21 14:08:58 +01:00
Alex Beregszaszi
8107177b9c Split off libevmasm specific optimiser tests 2017-07-26 20:51:27 +01:00