Commit Graph

990 Commits

Author SHA1 Message Date
Marenz
f508494f52 Fix undefined order of evaluation 2022-08-29 15:33:25 +02:00
Daniel Kirchner
e996fe6247 Yul Optimizer: Simplify start offset of zero-length operations. 2022-08-15 15:42:51 +02:00
Leonid Pospelov
32aa000378
Update FullInliner.cpp 2022-08-14 03:14:15 +03:00
chriseth
c12d151834 Only analyze memory in DataFlowAnalyzer if it is needed in the optimizer step. 2022-07-11 15:51:25 +02:00
Kamil Śliwak
4c85cb880e
Merge pull request #13238 from ethereum/improve-stack-too-deep-message
Improved stack too deep message when compiled without --optimize
2022-07-06 12:43:36 +02:00
Matheus Aguiar
290bd4fd2d Added a flag to record when a source is reconstructed from JSON so garbage code snippets are not printed after source location. 2022-07-05 11:41:24 -03:00
hrkrshnn
0b2a670a94 Improved stack too deep message when compiled without --optimize 2022-07-03 14:03:00 +02:00
chriseth
51ef6a62da Fix removal of memory stores in inline assembly blocks. 2022-06-10 17:32:28 +02:00
Christian Parpart
4ae43884d0 Apply a better way to annotate unreachability to the C++ compiler. 2022-06-07 16:41:04 +02:00
Kamil Śliwak
539e139555 Add explicit throws after some assertions to work around a spurious warning in GCC 12.1 2022-06-01 20:37:48 +02:00
Daniel Kirchner
7168c27f0d Relax inliner heuristics. 2022-05-23 13:37:50 +02:00
Daniel Kirchner
9fa907aac2 Do not remove potentially reverting returndatacopy cases. 2022-05-23 11:01:03 +02:00
hrkrshnn
5ae17c8e65 Recommend via-ir whenever a stack too deep error is encountered. 2022-05-05 19:22:03 +02:00
a3d4
048b253a93 Refix MSVC Debug crash 2022-04-26 01:52:56 +02:00
Joshua Quinones
e1a59397c6 Renamed AssemblyStack to YulStack
All files, references, variables, comments, etc. were renamed to YulStack.
2022-04-08 20:28:55 +02:00
Kamil Śliwak
3c5930dd8e Put arguments in parantheses in assert macro definitions 2022-04-06 22:26:21 +02:00
a3d4
44093f2ed6 Fix MSVC Debug crash 2022-04-06 01:34:58 +02:00
chriseth
a054285f31 Simplify rematerialization candidates. 2022-03-16 16:43:21 +01:00
chriseth
af86a80536
Merge pull request #12796 from ethereum/refactorStackCompressor
Refactor stack compressor
2022-03-16 16:36:41 +01:00
chriseth
75abe92eb2 Refactor stack compressor. 2022-03-15 21:28:47 +01:00
Daniel Kirchner
5cd98006d4 Fill in junk in stack layouts on terminating control flow paths. 2022-03-15 18:36:55 +01:00
chriseth
5afa2adec2
Merge pull request #12775 from ethereum/refactorDataFlowAnalyzer
Refactor data flow analyzer state access.
2022-03-15 15:52:40 +01:00
chriseth
28593839d9 Add helper to see if a switch has a default case. 2022-03-15 14:29:54 +01:00
chriseth
afdf22f5c7 Create a state struct. 2022-03-14 19:32:33 +01:00
chriseth
eab4ca906c Refactor data flow analyzer state access. 2022-03-14 19:32:33 +01:00
Daniel Kirchner
9410e125da Change memory-safe assembly annotation suggestion during stack too deep errors. 2022-03-14 11:54:09 +01:00
Tyler
1c58b91075 Merge branch 'develop' of github.com:tfire/solidity into fix/remove-namespace-ast-annotations 2022-03-10 17:39:29 -05:00
chriseth
4f02be110c Unused store eliminator. 2022-03-10 18:25:28 +01:00
chriseth
6ab31420af Remove unneeded header files. 2022-03-10 09:55:05 +01:00
Tyler
047034544e Merge branch 'develop' of github.com:tfire/solidity into fix/remove-namespace-ast-annotations 2022-03-09 18:55:22 -05: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
Tyler
519e1c9402 Specify namespaces
Fix references into solidity::util
2022-03-08 00:09:17 -05:00
chriseth
77c40cd2af
Merge pull request #12740 from ethereum/remove-locale-dependent-operations
Replace all locale-dependent operations with locale-agnostic counterparts
2022-03-07 17:56:58 +01:00
wechman
52dfccca98 Replace all locale-dependent operations with locale-agnostic counterparts 2022-03-07 17:23:08 +01:00
chriseth
4f19d68ee9
Merge pull request #12620 from ethereum/assemblyAnnotation
Memory-safety annotation for inline assembly.
2022-03-07 12:48:41 +01:00
Daniel Kirchner
dfb7bf2853 Report memoryguard in stack too deep error. 2022-03-02 16:42:28 +01:00
Daniel Kirchner
9bcfcc61a7 Inline assembly without memory effects is implicitly memory safe. 2022-03-02 16:42:28 +01:00
chriseth
d118f21417
Merge pull request #12729 from ethereum/splitOutDisassemble
Split out disassemble to remove numeric from instruction includes.
2022-03-02 16:18:17 +01:00
chriseth
b0dcd7b915 Split out disassemble to remove numeric from instruction includes. 2022-03-02 15:30:41 +01:00
chriseth
63f0a22c5d Also save and restore the nesting depth. 2022-03-02 13:49:40 +01:00
Daniel Kirchner
de28f31716 Improved stack shuffling in corner cases. 2022-01-21 15:41:30 +01:00
hrkrshnn
85d1a57e65 Added more tests. Updated chromosome. Remove unused headers. 2022-01-04 13:27:39 +05:30
chriseth
772e100813 Equal store eliminator. 2022-01-03 15:52:05 +01:00
chriseth
9a0821f2c3 Fix warning about reference. 2021-12-16 00:12:19 +01:00
chriseth
0e7a065a78 Enhance documentation. 2021-11-23 14:58:04 +01:00
chriseth
bd321b9f1f Rename RedundantAssignEliminator to UnusedAssignEliminator. 2021-11-23 10:38:36 +01:00
Marenz
49b4e77d6b Prevent crash when translating yul->ewasm with @use-src annotations 2021-11-11 13:43:57 +01:00
Daniel Kirchner
9fb77b139c Keep canonical form of Yul code at all times. 2021-11-09 13:29:10 +01:00
Daniel Kirchner
b4f98b41bc Minor fix to forEach on Yul AST nodes. 2021-11-05 13:24:30 +01:00
chriseth
776ae466bc Control flow side effects on non-disambiguated source. 2021-11-04 16:32:11 +01:00
chriseth
25c41546ee Function reference resolver. 2021-11-04 16:31:18 +01:00
chriseth
dd8f12760b Introduce forEach for yul ast nodes. 2021-11-04 16:14:43 +01:00
chriseth
929ed094ce Register functions earlier. 2021-11-04 13:48:11 +01:00
chriseth
99aa18c4f3 Refactor: Only return output. 2021-11-04 13:42:50 +01:00
Daniel Kirchner
95c973d6c2 Refactoring of optimiser suite and yulopti. 2021-11-03 19:33:01 +01:00
Daniel Kirchner
28ae316556 Named function labels. 2021-11-03 12:42:07 +01:00
Daniel Kirchner
1a0605c594 Update tests. 2021-11-03 12:39:55 +01:00
Daniel Kirchner
4229369180 Compatibility with StackCompressor and StackLimitEvader. 2021-11-03 12:39:55 +01:00
Daniel Kirchner
b2c9b69de2 Enable for IR code generation with stack optimization > homestead. 2021-11-03 12:39:55 +01:00
chriseth
d6c461ed61 Use side effects of user-defined functions in other optimizer steps. 2021-11-02 11:59:01 +01:00
chriseth
7ebf71f315
Merge pull request #12203 from ethereum/fixuseafterfreeside
Fix use-after-free bug.
2021-10-27 16:43:44 +02:00
chriseth
dce13fbb6a Fix use-after-free bug. 2021-10-27 15:49:41 +02:00
chriseth
9f48b7419c Do not use named function labels if function names are not unique. 2021-10-19 18:33:00 +02:00
chriseth
9417d6775f Control flow side-effects for user-defined functions. 2021-10-14 17:46:07 +02:00
Kamil Śliwak
bcfefc79d9 Pass DebugInfoSelection down to the code handling assembly printing 2021-10-11 20:34:48 +02:00
Kamil Śliwak
f7c4ed849d Handle DebugInfoSelection in the code printing Yul and EVM assembly 2021-10-11 20:34:48 +02:00
Kamil Śliwak
2cd1c644b6 Remove unused includes and sort existing includes in a few places 2021-10-11 20:34:48 +02:00
Christian Parpart
3f08b2269a Adds fmtlib as 3rdparty dependency for easier string composition. 2021-10-11 13:35:08 +02:00
Kamil Śliwak
620ec47efb OptimizerSuite: Rewrite runSequence() with support for nested brackets 2021-10-06 19:15:02 +02:00
Kamil Śliwak
2fb8f1be5b OptimiserSuite: Use string_view instead of string for step sequences 2021-10-06 18:48:41 +02:00
Sreekesh V
79d9d5bf0d Change optimizer sequence validations to allow nested brackets 2021-10-06 18:46:53 +02:00
Kamil Śliwak
0745842d46 Use BOOST_PP_OVERLOAD() to allow invoking the assertion macros without a message 2021-10-04 12:05:00 +02:00
Kamil Śliwak
4fe6aa1328 Add default messages to assertion macros 2021-10-04 12:05:00 +02:00
chriseth
1531863835 Split Common.h into Numeric.h. 2021-09-23 15:27:29 +02:00
chriseth
c8e6ef9657
Merge pull request #12004 from ethereum/disambiguateBytesRequired
Disambiguate bytesRequired
2021-09-23 15:25:44 +02:00
Kamil Śliwak
fc7e8c56dc Fill out originLocation with nativeLocation when importing Yul AST 2021-09-22 13:17:18 +02:00
Kamil Śliwak
d23754eafd AsmParser: Don't use locationOverride as current location when location from comments is selected 2021-09-22 13:11:39 +02:00
Kamil Śliwak
ce4420f857 Separate DebugData fields for Solidity and Yul source locations 2021-09-22 13:11:39 +02:00
Kamil Śliwak
9c1d40debf AsmParser: Replace m_debugDataOverride with separate variables for location and AST ID 2021-09-22 13:11:39 +02:00
chriseth
50ce1f5ddd Disambiguate bytesRequired 2021-09-22 11:22:07 +02:00
chriseth
e6f0fe8ae3 Use source id in yul to evm code transform. 2021-09-22 11:11:51 +02:00
Kamil Śliwak
a9b5835e5d AsmPrinter: Don't include whitespace after @src if there's no code snippet 2021-09-17 21:46:12 +02:00
chriseth
a72f4f3993 Print AST ID. 2021-09-16 17:19:17 +02:00
chriseth
dafa6f552b Rename formatting function. 2021-09-16 17:19:17 +02:00
chriseth
05d20446bb Parse @ast-id annotation. 2021-09-16 17:18:48 +02:00
chriseth
42739b73b1 Extend debug info. 2021-09-16 17:18:48 +02:00
chriseth
280ff8cbd4 Use iterateReplacing in StatementRemover. 2021-09-16 15:34:48 +02:00
chriseth
d708612e27 Refactor source comment parsing. 2021-09-16 12:22:27 +02:00
chriseth
a66e6f08c0
Merge pull request #11951 from ethereum/scopeFillerNullptr
Use locationOf helper instead of accessing debugData directly.
2021-09-14 15:43:01 +02:00
chriseth
f14ff233fc
Merge pull request #11922 from ethereum/newCodeTransformSourceLocations
Better source locations in Yul ControlFlowGraph and OptimizedEVMCodeTransform.
2021-09-14 14:32:39 +02:00
chriseth
a35608aa8c
Merge pull request #11797 from ethereum/optimizedEVMCodeTransform
Optimized EVM Code Transform. (New Code Transform Step 3)
2021-09-14 14:29:54 +02:00
Daniel Kirchner
854b8b65b5 Better source locations in Yul ControlFlowGraph and OptimizedEVMCodeTransform. 2021-09-14 13:43:16 +02:00
Daniel Kirchner
75c3286311 Optimized EVM Code Transform. 2021-09-14 13:37:04 +02:00
Kamil Śliwak
14639efc5d Print code snippets next to source locations in IR output 2021-09-14 12:09:59 +02:00
Kamil Śliwak
d78522b08b AsmParser: Accept optional code snippets after the @src tags 2021-09-14 12:09:59 +02:00
Kamil Śliwak
37f681c430 Deduplicate code for printing source locations 2021-09-14 11:46:57 +02:00
Daniel Kirchner
7abc55d89a Use locationOf helper instead of accessing debugData directly. 2021-09-14 10:04:09 +02:00
Kamil Śliwak
fbdfc6bb7a AsmParser: Require whitespace before tags in location comments 2021-09-09 18:27:29 +02:00
Kamil Śliwak
14396c207c AsmParser: Generalize location comment parsing to make it easier to add support for more tags 2021-09-09 17:12:59 +02:00