Merge pull request #5864 from ethereum/tuneOptOrder

Some optimizer tuning.
This commit is contained in:
Alex Beregszaszi 2019-01-28 13:50:09 +00:00 committed by GitHub
commit 2fc7928697
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 36 additions and 35 deletions

View File

@ -79,8 +79,8 @@ void OptimiserSuite::run(
RedundantAssignEliminator::run(_dialect, ast);
RedundantAssignEliminator::run(_dialect, ast);
CommonSubexpressionEliminator{_dialect}(ast);
ExpressionSimplifier::run(_dialect, ast);
CommonSubexpressionEliminator{_dialect}(ast);
StructuralSimplifier{_dialect}(ast);
(BlockFlattener{})(ast);
SSATransform::run(ast, dispenser);
@ -108,6 +108,7 @@ void OptimiserSuite::run(
(FunctionGrouper{})(ast);
EquivalentFunctionCombiner::run(ast);
FullInliner{ast, dispenser}.run();
(BlockFlattener{})(ast);
SSATransform::run(ast, dispenser);
RedundantAssignEliminator::run(_dialect, ast);

View File

@ -1090,43 +1090,43 @@
// {
// revert(value4, value4)
// }
// value0_57 := and(calldataload(add(headStart_55, value4)), 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)
// value0_57 := and(calldataload(headStart_55), 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)
// value1_58 := calldataload(add(headStart_55, 32))
// let offset_62 := calldataload(add(headStart_55, 64))
// let _201 := 0xffffffffffffffff
// if gt(offset_62, _201)
// let _200 := 0xffffffffffffffff
// if gt(offset_62, _200)
// {
// revert(value4, value4)
// }
// let _203 := add(headStart_55, offset_62)
// if iszero(slt(add(_203, 0x1f), dataEnd_56))
// let _202 := add(headStart_55, offset_62)
// if iszero(slt(add(_202, 0x1f), dataEnd_56))
// {
// revert(value4, value4)
// }
// let abi_decode_length_15_246 := calldataload(_203)
// if gt(abi_decode_length_15_246, _201)
// let abi_decode_length_15_244 := calldataload(_202)
// if gt(abi_decode_length_15_244, _200)
// {
// revert(value4, value4)
// }
// if gt(add(add(_203, abi_decode_length_15_246), 32), dataEnd_56)
// if gt(add(add(_202, abi_decode_length_15_244), 32), dataEnd_56)
// {
// revert(value4, value4)
// }
// value2_59 := add(_203, 32)
// value3 := abi_decode_length_15_246
// let _206 := calldataload(add(headStart_55, 96))
// if iszero(lt(_206, 3))
// value2_59 := add(_202, 32)
// value3 := abi_decode_length_15_244
// let _205 := calldataload(add(headStart_55, 96))
// if iszero(lt(_205, 3))
// {
// revert(value4, value4)
// }
// value4 := _206
// value4 := _205
// }
// function abi_encode_tuple_t_bytes32_t_address_t_uint256_t_bytes32_t_enum$_Operation_$1949_t_uint256_t_uint256_t_uint256_t_address_t_address_t_uint256__to_t_bytes32_t_address_t_uint256_t_bytes32_t_uint8_t_uint256_t_uint256_t_uint256_t_address_t_address_t_uint256_(headStart_252, value10_253, value9_254, value8_255, value7_256, value6_257, value5_258, value4_259, value3_260, value2_261, value1_262, value0_263) -> tail_264
// {
// tail_264 := add(headStart_252, 352)
// mstore(headStart_252, value0_263)
// let _413 := 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
// mstore(add(headStart_252, 32), and(value1_262, _413))
// let _409 := 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
// mstore(add(headStart_252, 32), and(value1_262, _409))
// mstore(add(headStart_252, 64), value2_261)
// mstore(add(headStart_252, 96), value3_260)
// if iszero(lt(value4_259, 3))
@ -1137,8 +1137,8 @@
// mstore(add(headStart_252, 160), value5_258)
// mstore(add(headStart_252, 192), value6_257)
// mstore(add(headStart_252, 224), value7_256)
// mstore(add(headStart_252, 256), and(value8_255, _413))
// mstore(add(headStart_252, 288), and(value9_254, _413))
// mstore(add(headStart_252, 256), and(value8_255, _409))
// mstore(add(headStart_252, 288), and(value9_254, _409))
// mstore(add(headStart_252, 320), value10_253)
// }
// }

View File

@ -474,20 +474,20 @@
// abi_encode_i_69 := add(abi_encode_i_69, 1)
// }
// {
// let _580 := mload(abi_encode_srcPtr)
// let abi_encode_pos_71_672 := abi_encode_pos
// let abi_encode_srcPtr_73_674 := _580
// let abi_encode_i_74_675 := _2
// let _579 := mload(abi_encode_srcPtr)
// let abi_encode_pos_71_671 := abi_encode_pos
// let abi_encode_srcPtr_73_673 := _579
// let abi_encode_i_74_674 := _2
// for {
// }
// lt(abi_encode_i_74_675, 0x3)
// lt(abi_encode_i_74_674, 0x3)
// {
// abi_encode_i_74_675 := add(abi_encode_i_74_675, 1)
// abi_encode_i_74_674 := add(abi_encode_i_74_674, 1)
// }
// {
// mstore(abi_encode_pos_71_672, and(mload(abi_encode_srcPtr_73_674), 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF))
// abi_encode_srcPtr_73_674 := add(abi_encode_srcPtr_73_674, _1)
// abi_encode_pos_71_672 := add(abi_encode_pos_71_672, _1)
// mstore(abi_encode_pos_71_671, and(mload(abi_encode_srcPtr_73_673), 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF))
// abi_encode_srcPtr_73_673 := add(abi_encode_srcPtr_73_673, _1)
// abi_encode_pos_71_671 := add(abi_encode_pos_71_671, _1)
// }
// abi_encode_srcPtr := add(abi_encode_srcPtr, _1)
// abi_encode_pos := add(abi_encode_pos, 0x60)
@ -504,15 +504,15 @@
// {
// revert(_2, _2)
// }
// let abi_decode_value2_317 := abi_decode_t_array$_t_uint256_$dyn_memory_ptr(add(_221, abi_decode_offset_64), _220)
// let abi_decode_value2_314 := abi_decode_t_array$_t_uint256_$dyn_memory_ptr(add(_221, abi_decode_offset_64), _220)
// let abi_decode_offset_65 := calldataload(add(_221, 96))
// if gt(abi_decode_offset_65, abi_decode__74)
// {
// revert(_2, _2)
// }
// let abi_decode_value3_318 := abi_decode_t_array$_t_array$_t_uint256_$2_memory_$dyn_memory_ptr(add(_221, abi_decode_offset_65), _220)
// let abi_decode_value3_315 := abi_decode_t_array$_t_array$_t_uint256_$2_memory_$dyn_memory_ptr(add(_221, abi_decode_offset_65), _220)
// sstore(calldataload(_221), calldataload(add(_221, _1)))
// sstore(abi_decode_value2_317, abi_decode_value3_318)
// sstore(abi_decode_value2_314, abi_decode_value3_315)
// sstore(_2, abi_encode_pos)
// function abi_decode_t_array$_t_array$_t_uint256_$2_memory_$dyn_memory_ptr(offset_3, end_4) -> array_5
// {
@ -544,10 +544,10 @@
// revert(0, 0)
// }
// let abi_decode_dst_15 := allocateMemory(array_allocation_size_t_array$_t_uint256_$2_memory(0x2))
// let abi_decode_dst_15_1155 := abi_decode_dst_15
// let abi_decode_dst_15_1154 := abi_decode_dst_15
// let abi_decode_src_16 := src_8
// let abi_decode__239 := add(src_8, 0x40)
// if gt(abi_decode__239, end_4)
// let abi_decode__238 := add(src_8, 0x40)
// if gt(abi_decode__238, end_4)
// {
// revert(0, 0)
// }
@ -563,9 +563,9 @@
// abi_decode_dst_15 := add(abi_decode_dst_15, _16)
// abi_decode_src_16 := add(abi_decode_src_16, _16)
// }
// mstore(dst_7, abi_decode_dst_15_1155)
// mstore(dst_7, abi_decode_dst_15_1154)
// dst_7 := add(dst_7, _16)
// src_8 := abi_decode__239
// src_8 := abi_decode__238
// }
// }
// function abi_decode_t_array$_t_uint256_$dyn_memory_ptr(offset_27, end_28) -> array_29