From 213a1bd0d9b48375012fdceb1fed904644b9f950 Mon Sep 17 00:00:00 2001 From: Mohammad Rezaei Date: Wed, 7 May 2025 17:41:27 -0400 Subject: [PATCH 1/7] constant optimizer assembly tests --- .../constant_optimizer_runs_0.asm | 709 ++++++++++++++++++ .../constant_optimizer_runs_200.asm | 709 ++++++++++++++++++ .../constant_optimizer_runs_2M.asm | 709 ++++++++++++++++++ 3 files changed, 2127 insertions(+) create mode 100644 test/libevmasm/evmAssemblyTests/constant_optimizer_runs_0.asm create mode 100644 test/libevmasm/evmAssemblyTests/constant_optimizer_runs_200.asm create mode 100644 test/libevmasm/evmAssemblyTests/constant_optimizer_runs_2M.asm diff --git a/test/libevmasm/evmAssemblyTests/constant_optimizer_runs_0.asm b/test/libevmasm/evmAssemblyTests/constant_optimizer_runs_0.asm new file mode 100644 index 000000000000..c27b87c14a2b --- /dev/null +++ b/test/libevmasm/evmAssemblyTests/constant_optimizer_runs_0.asm @@ -0,0 +1,709 @@ + +PUSH 0x2 + +.sub + PUSH 0x1 + PUSH 0x1 + PUSH 0x2000000 + PUSH 0x8000000000000 + PUSH 0x10000000000000000000 + PUSH 0x40000000000000000000000000 + PUSH 0x80000000000000000000000000000000 + PUSH 0x200000000000000000000000000000000000000 + PUSH 0x400000000000000000000000000000000000000000000 + PUSH 0x1000000000000000000000000000000000000000000000000000 + PUSH 0x2000000000000000000000000000000000000000000000000000000000 + PUSH 0x8000000000000000000000000000000000000000000000000000000000000000 + // masks with 2 bits + PUSH 0x3 + PUSH 0x6000000 + PUSH 0xc000000000000 + PUSH 0x30000000000000000000 + PUSH 0x60000000000000000000000000 + PUSH 0x180000000000000000000000000000000 + PUSH 0x300000000000000000000000000000000000000 + PUSH 0x600000000000000000000000000000000000000000000 + PUSH 0x1800000000000000000000000000000000000000000000000000 + PUSH 0x3000000000000000000000000000000000000000000000000000000000 + PUSH 0xc000000000000000000000000000000000000000000000000000000000000000 + // masks with 3 bits + PUSH 0x7 + PUSH 0xe000000 + PUSH 0x1c000000000000 + PUSH 0x38000000000000000000 + PUSH 0xe0000000000000000000000000 + PUSH 0x1c0000000000000000000000000000000 + PUSH 0x380000000000000000000000000000000000000 + PUSH 0xe00000000000000000000000000000000000000000000 + PUSH 0x1c00000000000000000000000000000000000000000000000000 + PUSH 0x3800000000000000000000000000000000000000000000000000000000 + PUSH 0xe000000000000000000000000000000000000000000000000000000000000000 + // masks with 4 bits + PUSH 0xf + PUSH 0x1e000000 + PUSH 0x3c000000000000 + PUSH 0x78000000000000000000 + PUSH 0xf0000000000000000000000000 + PUSH 0x3c0000000000000000000000000000000 + PUSH 0x780000000000000000000000000000000000000 + PUSH 0xf00000000000000000000000000000000000000000000 + PUSH 0x1e00000000000000000000000000000000000000000000000000 + PUSH 0x3c00000000000000000000000000000000000000000000000000000000 + PUSH 0xf000000000000000000000000000000000000000000000000000000000000000 + // masks with 7 bits + PUSH 0x7f + PUSH 0x7f000000 + PUSH 0xfe000000000000 + PUSH 0x1fc000000000000000000 + PUSH 0x3f8000000000000000000000000 + PUSH 0x7f0000000000000000000000000000000 + PUSH 0xfe0000000000000000000000000000000000000 + PUSH 0x1fc0000000000000000000000000000000000000000000 + PUSH 0x3f80000000000000000000000000000000000000000000000000 + PUSH 0x7f00000000000000000000000000000000000000000000000000000000 + PUSH 0xfe00000000000000000000000000000000000000000000000000000000000000 + // masks with 8 bits + PUSH 0xff + PUSH 0xff000000 + PUSH 0x1fe000000000000 + PUSH 0x3fc000000000000000000 + PUSH 0x7f8000000000000000000000000 + PUSH 0xff0000000000000000000000000000000 + PUSH 0xff0000000000000000000000000000000000000 + PUSH 0x1fe0000000000000000000000000000000000000000000 + PUSH 0x3fc0000000000000000000000000000000000000000000000000 + PUSH 0x7f80000000000000000000000000000000000000000000000000000000 + PUSH 0xff00000000000000000000000000000000000000000000000000000000000000 + // masks with 16 bits + PUSH 0xffff + PUSH 0xffff000000 + PUSH 0xffff000000000000 + PUSH 0xffff000000000000000000 + PUSH 0xffff000000000000000000000000 + PUSH 0xffff000000000000000000000000000000 + PUSH 0xffff000000000000000000000000000000000000 + PUSH 0xffff000000000000000000000000000000000000000000 + PUSH 0xffff000000000000000000000000000000000000000000000000 + PUSH 0xffff000000000000000000000000000000000000000000000000000000 + PUSH 0xffff000000000000000000000000000000000000000000000000000000000000 + // masks with 23 bits + PUSH 0x7fffff + PUSH 0x3fffff800000 + PUSH 0x1fffffc00000000000 + PUSH 0xfffffe00000000000000000 + PUSH 0xfffffe00000000000000000000000 + PUSH 0x7fffff00000000000000000000000000000 + PUSH 0x3fffff80000000000000000000000000000000000 + PUSH 0x3fffff80000000000000000000000000000000000000000 + PUSH 0x1fffffc0000000000000000000000000000000000000000000000 + PUSH 0xfffffe0000000000000000000000000000000000000000000000000000 + PUSH 0xfffffe0000000000000000000000000000000000000000000000000000000000 + // masks with 32 bits + PUSH 0xffffffff + PUSH 0x3fffffffc00000 + PUSH 0xffffffff00000000000 + PUSH 0x7fffffff80000000000000000 + PUSH 0x1fffffffe0000000000000000000000 + PUSH 0xffffffff0000000000000000000000000000 + PUSH 0x3fffffffc000000000000000000000000000000000 + PUSH 0xffffffff000000000000000000000000000000000000000 + PUSH 0x7fffffff800000000000000000000000000000000000000000000 + PUSH 0x1fffffffe00000000000000000000000000000000000000000000000000 + PUSH 0xffffffff00000000000000000000000000000000000000000000000000000000 + // masks with 47 bits + PUSH 0x7fffffffffff + PUSH 0x7fffffffffff00000 + PUSH 0xfffffffffffe0000000000 + PUSH 0x1fffffffffffc000000000000000 + PUSH 0x3fffffffffff800000000000000000000 + PUSH 0x7fffffffffff00000000000000000000000000 + PUSH 0xfffffffffffe0000000000000000000000000000000 + PUSH 0x1fffffffffffc000000000000000000000000000000000000 + PUSH 0x3fffffffffff800000000000000000000000000000000000000000 + PUSH 0x7fffffffffff00000000000000000000000000000000000000000000000 + PUSH 0xfffffffffffe0000000000000000000000000000000000000000000000000000 + // masks with 64 bits + PUSH 0xffffffffffffffff + PUSH 0x7fffffffffffffff80000 + PUSH 0x3fffffffffffffffc000000000 + PUSH 0x1fffffffffffffffe00000000000000 + PUSH 0xffffffffffffffff0000000000000000000 + PUSH 0xffffffffffffffff000000000000000000000000 + PUSH 0x7fffffffffffffff80000000000000000000000000000 + PUSH 0x3fffffffffffffffc000000000000000000000000000000000 + PUSH 0x1fffffffffffffffe00000000000000000000000000000000000000 + PUSH 0xffffffffffffffff0000000000000000000000000000000000000000000 + PUSH 0xffffffffffffffff000000000000000000000000000000000000000000000000 + // masks with 92 bits + PUSH 0xfffffffffffffffffffffff + PUSH 0xfffffffffffffffffffffff0000 + PUSH 0xfffffffffffffffffffffff00000000 + PUSH 0x1ffffffffffffffffffffffe000000000000 + PUSH 0x1ffffffffffffffffffffffe0000000000000000 + PUSH 0x3ffffffffffffffffffffffc00000000000000000000 + PUSH 0x3ffffffffffffffffffffffc000000000000000000000000 + PUSH 0x3ffffffffffffffffffffffc0000000000000000000000000000 + PUSH 0x7ffffffffffffffffffffff800000000000000000000000000000000 + PUSH 0x7ffffffffffffffffffffff8000000000000000000000000000000000000 + PUSH 0xfffffffffffffffffffffff00000000000000000000000000000000000000000 + // masks with 103 bits + PUSH 0x7fffffffffffffffffffffffff + PUSH 0x3fffffffffffffffffffffffff8000 + PUSH 0x1fffffffffffffffffffffffffc0000000 + PUSH 0xfffffffffffffffffffffffffe00000000000 + PUSH 0xfffffffffffffffffffffffffe000000000000000 + PUSH 0x7fffffffffffffffffffffffff0000000000000000000 + PUSH 0x3fffffffffffffffffffffffff80000000000000000000000 + PUSH 0x3fffffffffffffffffffffffff800000000000000000000000000 + PUSH 0x1fffffffffffffffffffffffffc000000000000000000000000000000 + PUSH 0xfffffffffffffffffffffffffe0000000000000000000000000000000000 + PUSH 0xfffffffffffffffffffffffffe00000000000000000000000000000000000000 + // masks with 128 bits + PUSH 0xffffffffffffffffffffffffffffffff + PUSH 0xffffffffffffffffffffffffffffffff000 + PUSH 0x1fffffffffffffffffffffffffffffffe000000 + PUSH 0x3fffffffffffffffffffffffffffffffc000000000 + PUSH 0x7fffffffffffffffffffffffffffffff8000000000000 + PUSH 0xffffffffffffffffffffffffffffffff0000000000000000 + PUSH 0xffffffffffffffffffffffffffffffff0000000000000000000 + PUSH 0x1fffffffffffffffffffffffffffffffe0000000000000000000000 + PUSH 0x3fffffffffffffffffffffffffffffffc0000000000000000000000000 + PUSH 0x7fffffffffffffffffffffffffffffff80000000000000000000000000000 + PUSH 0xffffffffffffffffffffffffffffffff00000000000000000000000000000000 + // masks with 133 bits + PUSH 0x1fffffffffffffffffffffffffffffffff + PUSH 0x1fffffffffffffffffffffffffffffffff000 + PUSH 0x1fffffffffffffffffffffffffffffffff000000 + PUSH 0x1fffffffffffffffffffffffffffffffff000000000 + PUSH 0x3ffffffffffffffffffffffffffffffffe000000000000 + PUSH 0x3ffffffffffffffffffffffffffffffffe000000000000000 + PUSH 0x3ffffffffffffffffffffffffffffffffe000000000000000000 + PUSH 0x7ffffffffffffffffffffffffffffffffc000000000000000000000 + PUSH 0x7ffffffffffffffffffffffffffffffffc000000000000000000000000 + PUSH 0x7ffffffffffffffffffffffffffffffffc000000000000000000000000000 + PUSH 0xfffffffffffffffffffffffffffffffff8000000000000000000000000000000 + // masks with 160 bits + PUSH 0xffffffffffffffffffffffffffffffffffffffff + PUSH 0x1fffffffffffffffffffffffffffffffffffffffe00 + PUSH 0x7fffffffffffffffffffffffffffffffffffffff80000 + PUSH 0xffffffffffffffffffffffffffffffffffffffff0000000 + PUSH 0x3fffffffffffffffffffffffffffffffffffffffc000000000 + PUSH 0xffffffffffffffffffffffffffffffffffffffff000000000000 + PUSH 0x1fffffffffffffffffffffffffffffffffffffffe00000000000000 + PUSH 0x7fffffffffffffffffffffffffffffffffffffff80000000000000000 + PUSH 0xffffffffffffffffffffffffffffffffffffffff0000000000000000000 + PUSH 0x3fffffffffffffffffffffffffffffffffffffffc000000000000000000000 + PUSH 0xffffffffffffffffffffffffffffffffffffffff000000000000000000000000 + // masks with 175 bits + PUSH 0x7fffffffffffffffffffffffffffffffffffffffffff + PUSH 0x7fffffffffffffffffffffffffffffffffffffffffff00 + PUSH 0x7fffffffffffffffffffffffffffffffffffffffffff0000 + PUSH 0x7fffffffffffffffffffffffffffffffffffffffffff000000 + PUSH 0x7fffffffffffffffffffffffffffffffffffffffffff00000000 + PUSH 0x7fffffffffffffffffffffffffffffffffffffffffff0000000000 + PUSH 0x7fffffffffffffffffffffffffffffffffffffffffff000000000000 + PUSH 0x7fffffffffffffffffffffffffffffffffffffffffff00000000000000 + PUSH 0x7fffffffffffffffffffffffffffffffffffffffffff0000000000000000 + PUSH 0x7fffffffffffffffffffffffffffffffffffffffffff000000000000000000 + PUSH 0xfffffffffffffffffffffffffffffffffffffffffffe00000000000000000000 + // masks with 200 bits + PUSH 0xffffffffffffffffffffffffffffffffffffffffffffffffff + PUSH 0x1fffffffffffffffffffffffffffffffffffffffffffffffffe0 + PUSH 0x7fffffffffffffffffffffffffffffffffffffffffffffffff800 + PUSH 0xffffffffffffffffffffffffffffffffffffffffffffffffff0000 + PUSH 0x3fffffffffffffffffffffffffffffffffffffffffffffffffc00000 + PUSH 0xffffffffffffffffffffffffffffffffffffffffffffffffff0000000 + PUSH 0x1fffffffffffffffffffffffffffffffffffffffffffffffffe00000000 + PUSH 0x7fffffffffffffffffffffffffffffffffffffffffffffffff8000000000 + PUSH 0xffffffffffffffffffffffffffffffffffffffffffffffffff00000000000 + PUSH 0x3fffffffffffffffffffffffffffffffffffffffffffffffffc000000000000 + PUSH 0xffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000 + // masks with 255 bits + PUSH 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + PUSH 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe + // masks with 256 bits + PUSH 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + // powers of 10 + PUSH 0xa + PUSH 0x64 + PUSH 0x3e8 + PUSH 0x2710 + PUSH 0x186a0 + PUSH 0xf4240 + PUSH 0x989680 + PUSH 0x5f5e100 + PUSH 0x3b9aca00 + PUSH 0x2540be400 + PUSH 0x174876e800 + PUSH 0xe8d4a51000 + PUSH 0x9184e72a000 + PUSH 0x5af3107a4000 + PUSH 0x38d7ea4c68000 + PUSH 0x2386f26fc10000 + PUSH 0x16345785d8a0000 + PUSH 0xde0b6b3a7640000 + PUSH 0x8ac7230489e80000 + PUSH 0x56bc75e2d63100000 + PUSH 0x3635c9adc5dea00000 + PUSH 0x21e19e0c9bab2400000 + PUSH 0x152d02c7e14af6800000 + PUSH 0xd3c21bcecceda1000000 + PUSH 0x84595161401484a000000 + PUSH 0x52b7d2dcc80cd2e4000000 + PUSH 0x33b2e3c9fd0803ce8000000 + PUSH 0x204fce5e3e25026110000000 + PUSH 0x1431e0fae6d7217caa0000000 + PUSH 0xc9f2c9cd04674edea40000000 + PUSH 0x7e37be2022c0914b2680000000 + PUSH 0x4ee2d6d415b85acef8100000000 + PUSH 0x314dc6448d9338c15b0a00000000 + PUSH 0x1ed09bead87c0378d8e6400000000 + PUSH 0x13426172c74d822b878fe800000000 + PUSH 0xc097ce7bc90715b34b9f1000000000 + PUSH 0x785ee10d5da46d900f436a000000000 + PUSH 0x4b3b4ca85a86c47a098a224000000000 + PUSH 0x2f050fe938943acc45f65568000000000 + PUSH 0x1d6329f1c35ca4bfabb9f5610000000000 + PUSH 0x125dfa371a19e6f7cb54395ca0000000000 + PUSH 0xb7abc627050305adf14a3d9e40000000000 + PUSH 0x72cb5bd86321e38cb6ce6682e80000000000 + PUSH 0x47bf19673df52e37f2410011d100000000000 + PUSH 0x2cd76fe086b93ce2f768a00b22a00000000000 + PUSH 0x1c06a5ec5433c60ddaa16406f5a400000000000 + PUSH 0x118427b3b4a05bc8a8a4de845986800000000000 + PUSH 0xaf298d050e4395d69670b12b7f41000000000000 + PUSH 0x6d79f82328ea3da61e066ebb2f88a000000000000 + PUSH 0x446c3b15f9926687d2c40534fdb564000000000000 + PUSH 0x2ac3a4edbbfb8014e3ba83411e915e8000000000000 + PUSH 0x1aba4714957d300d0e549208b31adb10000000000000 + PUSH 0x10b46c6cdd6e3e0828f4db456ff0c8ea0000000000000 + PUSH 0xa70c3c40a64e6c51999090b65f67d9240000000000000 + PUSH 0x6867a5a867f103b2fffa5a71fba0e7b680000000000000 + PUSH 0x4140c78940f6a24fdffc78873d4490d2100000000000000 + PUSH 0x28c87cb5c89a2571ebfdcb54864ada834a00000000000000 + PUSH 0x197d4df19d605767337e9f14d3eec8920e400000000000000 + PUSH 0xfee50b7025c36a0802f236d04753d5b48e800000000000000 + PUSH 0x9f4f2726179a224501d762422c946590d91000000000000000 + PUSH 0x63917877cec0556b21269d695bdcbf7a87aa000000000000000 + PUSH 0x3e3aeb4ae1383562f4b82261d969f7ac94ca4000000000000000 + PUSH 0x26e4d30eccc3215dd8f3157d27e23acbdcfe68000000000000000 + PUSH 0x184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000 + PUSH 0xf316271c7fc3908a8bef464e3945ef7a25360a0000000000000000 + PUSH 0x97edd871cfda3a5697758bf0e3cbb5ac5741c640000000000000000 + PUSH 0x5ef4a74721e864761ea977768e5f518bb6891be80000000000000000 + PUSH 0x3b58e88c75313ec9d329eaaa18fb92f75215b17100000000000000000 + PUSH 0x25179157c93ec73e23fa32aa4f9d3bda934d8ee6a00000000000000000 + PUSH 0x172ebad6ddc73c86d67c5faa71c245689c1079502400000000000000000 + PUSH 0xe7d34c64a9c85d4460dbbca87196b61618a4bd216800000000000000000 + PUSH 0x90e40fbeea1d3a4abc8955e946fe31cdcf66f634e1000000000000000000 + PUSH 0x5a8e89d75252446eb5d5d5b1cc5edf20a1a059e10ca000000000000000000 + PUSH 0x3899162693736ac531a5a58f1fbb4b746504382ca7e4000000000000000000 + PUSH 0x235fadd81c2822bb3f07877973d50f28bf22a31be8ee8000000000000000000 + PUSH 0x161bcca7119915b50764b4abe86529797775a5f1719510000000000000000000 + PUSH 0xdd15fe86affad91249ef0eb713f39ebeaa987b6e6fd2a0000000000000000000 + // powers of 10 multiplied by ffffffffffffffff + PUSH 0x9fffffffffffffff6 + PUSH 0x63ffffffffffffff9c + PUSH 0x3e7fffffffffffffc18 + PUSH 0x270fffffffffffffd8f0 + PUSH 0x1869ffffffffffffe7960 + PUSH 0xf423ffffffffffff0bdc0 + PUSH 0x98967fffffffffff676980 + PUSH 0x5f5e0fffffffffffa0a1f00 + PUSH 0x3b9ac9ffffffffffc4653600 + PUSH 0x2540be3fffffffffdabf41c00 + PUSH 0x174876e7ffffffffe8b7891800 + PUSH 0xe8d4a50fffffffff172b5af000 + PUSH 0x9184e729ffffffff6e7b18d6000 + PUSH 0x5af3107a3fffffffa50cef85c000 + PUSH 0x38d7ea4c67ffffffc72815b398000 + PUSH 0x2386f26fc0ffffffdc790d903f0000 + PUSH 0x16345785d89fffffe9cba87a2760000 + PUSH 0xde0b6b3a763fffff21f494c589c0000 + PUSH 0x8ac7230489e7ffff7538dcfb76180000 + PUSH 0x56bc75e2d630ffffa9438a1d29cf00000 + PUSH 0x3635c9adc5de9fffc9ca36523a21600000 + PUSH 0x21e19e0c9bab23ffde1e61f36454dc00000 + PUSH 0x152d02c7e14af67fead2fd381eb509800000 + PUSH 0xd3c21bcecceda0ff2c3de43133125f000000 + PUSH 0x845951614014849f7ba6ae9ebfeb7b6000000 + PUSH 0x52b7d2dcc80cd2e3ad482d2337f32d1c000000 + PUSH 0x33b2e3c9fd0803ce4c4d1c3602f7fc318000000 + PUSH 0x204fce5e3e250260efb031a1c1dafd9ef0000000 + PUSH 0x1431e0fae6d7217c95ce1f051928de83560000000 + PUSH 0xc9f2c9cd04674eddda0d3632fb98b1215c0000000 + PUSH 0x7e37be2022c0914aa84841dfdd3f6eb4d980000000 + PUSH 0x4ee2d6d415b85acea92d292bea47a53107f00000000 + PUSH 0x314dc6448d9338c129bc39bb726cc73ea4f600000000 + PUSH 0x1ed09bead87c0378ba15a4152783fc872719c00000000 + PUSH 0x13426172c74d822b744d868d38b27dd478701800000000 + PUSH 0xc097ce7bc90715b28b07418436f8ea4cb460f000000000 + PUSH 0x785ee10d5da46d8f96e488f2a25b926ff0bc96000000000 + PUSH 0x4b3b4ca85a86c479be4ed597a5793b85f675ddc000000000 + PUSH 0x2f050fe938943acc16f1457ec76bc533ba09aa98000000000 + PUSH 0x1d6329f1c35ca4bf8e56cb6f3ca35b4054460a9f0000000000 + PUSH 0x125dfa371a19e6f7b8f63f2585e6190834abc6a360000000000 + PUSH 0xb7abc627050305ad399e77773afcfa520eb5c261c0000000000 + PUSH 0x72cb5bd86321e38c44030aaa84de1c734931997d180000000000 + PUSH 0x47bf19673df52e37aa81e6aa930ad1c80dbeffee2f00000000000 + PUSH 0x2cd76fe086b93ce2ca91302a9be6c31d08975ff4dd600000000000 + PUSH 0x1c06a5ec5433c60dbe9abe1aa17039f2255e9bf90a5c00000000000 + PUSH 0x118427b3b4a05bc89720b6d0a4e62437575b217ba679800000000000 + PUSH 0xaf298d050e4395d5e747242670fd6a29698f4ed480bf000000000000 + PUSH 0x6d79f82328ea3da5b08c7698069e6259e1f99144d0776000000000000 + PUSH 0x446c3b15f99266878e57ca1f0422fd782d3bfacb024a9c000000000000 + PUSH 0x2ac3a4edbbfb8014b8f6de536295de6b1c457cbee16ea18000000000000 + PUSH 0x1aba4714957d300cf39a4af41d9dab02f1ab6df74ce524f0000000000000 + PUSH 0x10b46c6cdd6e3e0818406ed892828ae1d70b24ba900f37160000000000000 + PUSH 0xa70c3c40a64e6c50f2845475b9196cd2666f6f49a09826dc0000000000000 + PUSH 0x6867a5a867f103b29792b4c993afe4038005a58e045f184980000000000000 + PUSH 0x4140c78940f6a24f9ebbb0fdfc4dee8230038778c2bb6f2df00000000000000 + PUSH 0x28c87cb5c89a2571c3354e9ebdb0b5115e0234ab79b5257cb600000000000000 +// ==== +// optimizationPreset: none +// optimizer.constantOptimizer: true +// optimizer.expectedExecutionsPerDeployment: 0 +// outputs: Assembly +// ---- +// Assembly: +// 0x02 +// stop +// +// sub_0: assembly { +// 0x01 +// 0x01 +// 0x02000000 +// shl(0x33, 0x01) +// shl(0x4c, 0x01) +// shl(0x66, 0x01) +// shl(0x7f, 0x01) +// shl(0x99, 0x01) +// shl(0xb2, 0x01) +// shl(0xcc, 0x01) +// shl(0xe5, 0x01) +// shl(0xff, 0x01) +// 0x03 +// 0x06000000 +// shl(0x32, 0x03) +// shl(0x4c, 0x03) +// shl(0x65, 0x03) +// shl(0x7f, 0x03) +// shl(0x98, 0x03) +// shl(0xb1, 0x03) +// shl(0xcb, 0x03) +// shl(0xe4, 0x03) +// shl(0xfe, 0x03) +// 0x07 +// 0x0e000000 +// shl(0x32, 0x07) +// shl(0x4b, 0x07) +// shl(0x65, 0x07) +// shl(0x7e, 0x07) +// shl(0x97, 0x07) +// shl(0xb1, 0x07) +// shl(0xca, 0x07) +// shl(0xe3, 0x07) +// shl(0xfd, 0x07) +// 0x0f +// 0x1e000000 +// shl(0x32, 0x0f) +// shl(0x4b, 0x0f) +// shl(0x64, 0x0f) +// shl(0x7e, 0x0f) +// shl(0x97, 0x0f) +// shl(0xb0, 0x0f) +// shl(0xc9, 0x0f) +// shl(0xe2, 0x0f) +// shl(0xfc, 0x0f) +// 0x7f +// 0x7f000000 +// shl(0x31, 0x7f) +// shl(0x4a, 0x7f) +// shl(0x63, 0x7f) +// shl(0x7c, 0x7f) +// shl(0x95, 0x7f) +// shl(0xae, 0x7f) +// shl(0xc7, 0x7f) +// shl(0xe0, 0x7f) +// shl(0xf9, 0x7f) +// 0xff +// 0xff000000 +// shl(0x31, 0xff) +// shl(0x4a, 0xff) +// shl(0x63, 0xff) +// shl(0x7c, 0xff) +// shl(0x94, 0xff) +// shl(0xad, 0xff) +// shl(0xc6, 0xff) +// shl(0xdf, 0xff) +// not(sub(shl(0xf8, 0x01), 0x01)) +// 0xffff +// 0xffff000000 +// shl(0x30, 0xffff) +// shl(0x48, 0xffff) +// shl(0x60, 0xffff) +// shl(0x78, 0xffff) +// shl(0x90, 0xffff) +// shl(0xa8, 0xffff) +// shl(0xc0, 0xffff) +// shl(0xd8, 0xffff) +// not(sub(shl(0xf0, 0x01), 0x01)) +// 0x7fffff +// 0x3fffff800000 +// shl(0x2e, 0x7fffff) +// shl(0x45, 0x7fffff) +// shl(0x5d, 0x7fffff) +// shl(0x74, 0x7fffff) +// shl(0x8b, 0x7fffff) +// shl(0xa3, 0x7fffff) +// shl(0xba, 0x7fffff) +// shl(0xd1, 0x7fffff) +// not(sub(shl(0xe9, 0x01), 0x01)) +// 0xffffffff +// 0x3fffffffc00000 +// shl(0x2c, 0xffffffff) +// shl(0x43, 0xffffffff) +// shl(0x59, 0xffffffff) +// shl(0x70, 0xffffffff) +// shl(0x86, 0xffffffff) +// shl(0x9c, 0xffffffff) +// shl(0xb3, 0xffffffff) +// shl(0xc9, 0xffffffff) +// not(sub(shl(0xe0, 0x01), 0x01)) +// 0x7fffffffffff +// 0x07fffffffffff00000 +// shl(0x29, 0x7fffffffffff) +// shl(0x3e, 0x7fffffffffff) +// shl(0x53, 0x7fffffffffff) +// shl(0x68, 0x7fffffffffff) +// shl(0x7d, 0x7fffffffffff) +// shl(0x92, 0x7fffffffffff) +// shl(0xa7, 0x7fffffffffff) +// shl(0xbc, 0x7fffffffffff) +// not(sub(shl(0xd1, 0x01), 0x01)) +// sub(shl(0x40, 0x01), 0x01) +// sub(shl(0x53, 0x01), 0x080000) +// sub(shl(0x66, 0x01), shl(0x26, 0x01)) +// sub(shl(0x79, 0x01), shl(0x39, 0x01)) +// sub(shl(0x8c, 0x01), shl(0x4c, 0x01)) +// sub(shl(0xa0, 0x01), shl(0x60, 0x01)) +// sub(shl(0xb3, 0x01), shl(0x73, 0x01)) +// sub(shl(0xc6, 0x01), shl(0x86, 0x01)) +// sub(shl(0xd9, 0x01), shl(0x99, 0x01)) +// sub(shl(0xec, 0x01), shl(0xac, 0x01)) +// not(sub(shl(0xc0, 0x01), 0x01)) +// sub(shl(0x5c, 0x01), 0x01) +// sub(shl(0x6c, 0x01), 0x010000) +// sub(shl(0x7c, 0x01), shl(0x20, 0x01)) +// sub(shl(0x8d, 0x01), shl(0x31, 0x01)) +// sub(shl(0x9d, 0x01), shl(0x41, 0x01)) +// sub(shl(0xae, 0x01), shl(0x52, 0x01)) +// sub(shl(0xbe, 0x01), shl(0x62, 0x01)) +// sub(shl(0xce, 0x01), shl(0x72, 0x01)) +// sub(shl(0xdf, 0x01), shl(0x83, 0x01)) +// sub(shl(0xef, 0x01), shl(0x93, 0x01)) +// not(sub(shl(0xa4, 0x01), 0x01)) +// sub(shl(0x67, 0x01), 0x01) +// sub(shl(0x76, 0x01), 0x8000) +// sub(shl(0x85, 0x01), 0x40000000) +// sub(shl(0x94, 0x01), shl(0x2d, 0x01)) +// sub(shl(0xa4, 0x01), shl(0x3d, 0x01)) +// sub(shl(0xb3, 0x01), shl(0x4c, 0x01)) +// sub(shl(0xc2, 0x01), shl(0x5b, 0x01)) +// sub(shl(0xd2, 0x01), shl(0x6b, 0x01)) +// sub(shl(0xe1, 0x01), shl(0x7a, 0x01)) +// sub(shl(0xf0, 0x01), shl(0x89, 0x01)) +// not(sub(shl(0x99, 0x01), 0x01)) +// sub(shl(0x80, 0x01), 0x01) +// sub(shl(0x8c, 0x01), 0x1000) +// sub(shl(0x99, 0x01), 0x02000000) +// sub(shl(0xa6, 0x01), shl(0x26, 0x01)) +// sub(shl(0xb3, 0x01), shl(0x33, 0x01)) +// sub(shl(0xc0, 0x01), shl(0x40, 0x01)) +// sub(shl(0xcc, 0x01), shl(0x4c, 0x01)) +// sub(shl(0xd9, 0x01), shl(0x59, 0x01)) +// sub(shl(0xe6, 0x01), shl(0x66, 0x01)) +// sub(shl(0xf3, 0x01), shl(0x73, 0x01)) +// not(sub(shl(0x80, 0x01), 0x01)) +// sub(shl(0x85, 0x01), 0x01) +// sub(shl(0x91, 0x01), 0x1000) +// sub(shl(0x9d, 0x01), 0x01000000) +// sub(shl(0xa9, 0x01), shl(0x24, 0x01)) +// sub(shl(0xb6, 0x01), shl(0x31, 0x01)) +// sub(shl(0xc2, 0x01), shl(0x3d, 0x01)) +// sub(shl(0xce, 0x01), shl(0x49, 0x01)) +// sub(shl(0xdb, 0x01), shl(0x56, 0x01)) +// sub(shl(0xe7, 0x01), shl(0x62, 0x01)) +// sub(shl(0xf3, 0x01), shl(0x6e, 0x01)) +// not(sub(shl(0x7b, 0x01), 0x01)) +// sub(shl(0xa0, 0x01), 0x01) +// sub(shl(0xa9, 0x01), 0x0200) +// sub(shl(0xb3, 0x01), 0x080000) +// sub(shl(0xbc, 0x01), 0x10000000) +// sub(shl(0xc6, 0x01), shl(0x26, 0x01)) +// sub(shl(0xd0, 0x01), shl(0x30, 0x01)) +// sub(shl(0xd9, 0x01), shl(0x39, 0x01)) +// sub(shl(0xe3, 0x01), shl(0x43, 0x01)) +// sub(shl(0xec, 0x01), shl(0x4c, 0x01)) +// sub(shl(0xf6, 0x01), shl(0x56, 0x01)) +// not(sub(shl(0x60, 0x01), 0x01)) +// sub(shl(0xaf, 0x01), 0x01) +// sub(shl(0xb7, 0x01), 0x0100) +// sub(shl(0xbf, 0x01), 0x010000) +// sub(shl(0xc7, 0x01), 0x01000000) +// sub(shl(0xcf, 0x01), shl(0x20, 0x01)) +// sub(shl(0xd7, 0x01), shl(0x28, 0x01)) +// sub(shl(0xdf, 0x01), shl(0x30, 0x01)) +// sub(shl(0xe7, 0x01), shl(0x38, 0x01)) +// sub(shl(0xef, 0x01), shl(0x40, 0x01)) +// sub(shl(0xf7, 0x01), shl(0x48, 0x01)) +// not(sub(shl(0x51, 0x01), 0x01)) +// sub(shl(0xc8, 0x01), 0x01) +// sub(shl(0xcd, 0x01), 0x20) +// sub(shl(0xd3, 0x01), 0x0800) +// sub(shl(0xd8, 0x01), 0x010000) +// sub(shl(0xde, 0x01), 0x400000) +// sub(shl(0xe4, 0x01), 0x10000000) +// sub(shl(0xe9, 0x01), shl(0x21, 0x01)) +// sub(shl(0xef, 0x01), shl(0x27, 0x01)) +// sub(shl(0xf4, 0x01), shl(0x2c, 0x01)) +// sub(shl(0xfa, 0x01), shl(0x32, 0x01)) +// not(0xffffffffffffff) +// sub(shl(0xff, 0x01), 0x01) +// not(0x01) +// not(0x00) +// 0x0a +// 0x64 +// 0x03e8 +// 0x2710 +// 0x0186a0 +// 0x0f4240 +// 0x989680 +// 0x05f5e100 +// 0x3b9aca00 +// 0x02540be400 +// 0x174876e800 +// 0xe8d4a51000 +// 0x09184e72a000 +// 0x5af3107a4000 +// 0x038d7ea4c68000 +// 0x2386f26fc10000 +// 0x016345785d8a0000 +// 0x0de0b6b3a7640000 +// 0x8ac7230489e80000 +// 0x056bc75e2d63100000 +// 0x3635c9adc5dea00000 +// 0x021e19e0c9bab2400000 +// 0x152d02c7e14af6800000 +// 0xd3c21bcecceda1000000 +// 0x084595161401484a000000 +// 0x52b7d2dcc80cd2e4000000 +// shl(0x1b, 0x6765c793fa10079d) +// 0x204fce5e3e25026110000000 +// shl(0x1d, 0x0a18f07d736b90be55) +// shl(0x1e, 0x327cb2734119d3b7a9) +// shl(0x1f, 0xfc6f7c40458122964d) +// shl(0x20, 0x04ee2d6d415b85acef81) +// shl(0x21, 0x18a6e32246c99c60ad85) +// shl(0x22, 0x7b426fab61f00de36399) +// shl(0x23, 0x02684c2e58e9b04570f1fd) +// shl(0x24, 0x0c097ce7bc90715b34b9f1) +// shl(0x25, 0x3c2f7086aed236c807a1b5) +// shl(0x26, 0x012ced32a16a1b11e8262889) +// shl(0x27, 0x05e0a1fd2712875988becaad) +// shl(0x28, 0x1d6329f1c35ca4bfabb9f561) +// shl(0x29, 0x92efd1b8d0cf37be5aa1cae5) +// shl(0x2a, 0x02deaf189c140c16b7c528f679) +// shl(0x2b, 0x0e596b7b0c643c7196d9ccd05d) +// shl(0x2c, 0x47bf19673df52e37f2410011d1) +// shl(0x2d, 0x0166bb7f0435c9e717bb45005915) +// shl(0x2e, 0x0701a97b150cf18376a85901bd69) +// shl(0x2f, 0x23084f676940b7915149bd08b30d) +// shl(0x30, 0xaf298d050e4395d69670b12b7f41) +// shl(0x31, 0x036bcfc1194751ed30f03375d97c45) +// shl(0x32, 0x111b0ec57e6499a1f4b1014d3f6d59) +// shl(0x33, 0x558749db77f70029c77506823d22bd) +// shl(0x34, 0x01aba4714957d300d0e549208b31adb1) +// shl(0x35, 0x085a36366eb71f04147a6da2b7f86475) +// shl(0x36, 0x29c30f1029939b146664242d97d9f649) +// shl(0x37, 0xd0cf4b50cfe20765fff4b4e3f741cf6d) +// shl(0x38, 0x04140c78940f6a24fdffc78873d4490d21) +// shl(0x39, 0x14643e5ae44d12b8f5fee5aa43256d41a5) +// shl(0x3a, 0x65f537c675815d9ccdfa7c534fbb224839) +// shl(0x3b, 0x01fdca16e04b86d41005e46da08ea7ab691d) +// shl(0x3c, 0x09f4f2726179a224501d762422c946590d91) +// shl(0x3d, 0x31c8bc3be7602ab590934eb4adee5fbd43d5) +// shl(0x3e, 0xf8ebad2b84e0d58bd2e0898765a7deb25329) +// shl(0x3f, 0x04dc9a61d998642bbb1e62afa4fc47597b9fcd) +// shl(0x40, 0x184f03e93ff9f4daa797ed6e38ed64bf6a1f01) +// shl(0x41, 0x798b138e3fe1c84545f7a3271ca2f7bd129b05) +// shl(0x42, 0x025fb761c73f68e95a5dd62fc38f2ed6b15d0719) +// shl(0x43, 0x0bde94e8e43d0c8ec3d52eeed1cbea3176d1237d) +// shl(0x44, 0x3b58e88c75313ec9d329eaaa18fb92f75215b171) +// shl(0x45, 0x0128bc8abe49f639f11fd195527ce9ded49a6c7735) +// shl(0x46, 0x05cbaeb5b771cf21b59f17ea9c70915a27041e5409) +// shl(0x47, 0x1cfa698c95390ba88c1b77950e32d6c2c31497a42d) +// shl(0x48, 0x90e40fbeea1d3a4abc8955e946fe31cdcf66f634e1) +// shl(0x49, 0x02d4744eba92922375aeaead8e62f6f9050d02cf0865) +// shl(0x4a, 0x0e264589a4dcdab14c696963c7eed2dd19410e0b29f9) +// shl(0x4b, 0x46bf5bb0385045767e0f0ef2e7aa1e517e454637d1dd) +// shl(0x4c, 0x0161bcca7119915b50764b4abe86529797775a5f171951) +// shl(0x4d, 0x06e8aff4357fd6c8924f7875b89f9cf5f554c3db737e95) +// sub(shl(0x41, 0x05), 0x0a) +// sub(shl(0x42, 0x19), 0x64) +// sub(shl(0x43, 0x7d), 0x03e8) +// sub(shl(0x44, 0x0271), 0x2710) +// sub(shl(0x45, 0x0c35), 0x0186a0) +// sub(shl(0x46, 0x3d09), 0x0f4240) +// 0x98967fffffffffff676980 +// 0x05f5e0fffffffffffa0a1f00 +// 0x3b9ac9ffffffffffc4653600 +// 0x02540be3fffffffffdabf41c00 +// 0x174876e7ffffffffe8b7891800 +// 0xe8d4a50fffffffff172b5af000 +// 0x09184e729ffffffff6e7b18d6000 +// 0x5af3107a3fffffffa50cef85c000 +// 0x038d7ea4c67ffffffc72815b398000 +// 0x2386f26fc0ffffffdc790d903f0000 +// 0x016345785d89fffffe9cba87a2760000 +// 0x0de0b6b3a763fffff21f494c589c0000 +// 0x8ac7230489e7ffff7538dcfb76180000 +// 0x056bc75e2d630ffffa9438a1d29cf00000 +// 0x3635c9adc5de9fffc9ca36523a21600000 +// 0x021e19e0c9bab23ffde1e61f36454dc00000 +// 0x152d02c7e14af67fead2fd381eb509800000 +// 0xd3c21bcecceda0ff2c3de43133125f000000 +// 0x0845951614014849f7ba6ae9ebfeb7b6000000 +// 0x52b7d2dcc80cd2e3ad482d2337f32d1c000000 +// shl(0x1b, 0x6765c793fa10079c989a386c05eff863) +// 0x204fce5e3e250260efb031a1c1dafd9ef0000000 +// shl(0x1d, 0x0a18f07d736b90be4ae70f828c946f41ab) +// shl(0x1e, 0x327cb2734119d3b776834d8cbee62c4857) +// shl(0x1f, 0xfc6f7c4045812295509083bfba7edd69b3) +// shl(0x20, 0x04ee2d6d415b85acea92d292bea47a53107f) +// shl(0x21, 0x18a6e32246c99c6094de1cddb936639f527b) +// shl(0x22, 0x7b426fab61f00de2e85690549e0ff21c9c67) +// shl(0x23, 0x02684c2e58e9b0456e89b0d1a7164fba8f0e03) +// shl(0x24, 0x0c097ce7bc90715b28b07418436f8ea4cb460f) +// shl(0x25, 0x3c2f7086aed236c7cb724479512dc937f85e4b) +// shl(0x26, 0x012ced32a16a1b11e6f93b565e95e4ee17d9d777) +// shl(0x27, 0x05e0a1fd2712875982de28afd8ed78a677413553) +// shl(0x28, 0x1d6329f1c35ca4bf8e56cb6f3ca35b4054460a9f) +// shl(0x29, 0x92efd1b8d0cf37bdc7b1f92c2f30c841a55e351b) +// shl(0x2a, 0x02deaf189c140c16b4e679dddcebf3e9483ad70987) +// shl(0x2b, 0x0e596b7b0c643c7188806155509bc38e6926332fa3) +// shl(0x2c, 0x47bf19673df52e37aa81e6aa930ad1c80dbeffee2f) +// shl(0x2d, 0x0166bb7f0435c9e71654898154df3618e844baffa6eb) +// shl(0x2e, 0x0701a97b150cf1836fa6af86a85c0e7c8957a6fe4297) +// shl(0x2f, 0x23084f676940b7912e416da149cc486eaeb642f74cf3) +// shl(0x30, 0xaf298d050e4395d5e747242670fd6a29698f4ed480bf) +// shl(0x31, 0x036bcfc1194751ed2d8463b4c034f312cf0fcc8a2683bb) +// shl(0x32, 0x111b0ec57e6499a1e395f287c108bf5e0b4efeb2c092a7) +// shl(0x33, 0x558749db77f7002971edbca6c52bbcd6388af97dc2dd43) +// shl(0x34, 0x01aba4714957d300cf39a4af41d9dab02f1ab6df74ce524f) +// shl(0x35, 0x085a36366eb71f040c20376c49414570eb85925d48079b8b) +// shl(0x36, 0x29c30f1029939b143ca1151d6e465b34999bdbd2682609b7) +// shl(0x37, 0xd0cf4b50cfe207652f256993275fc807000b4b1c08be3093) +// shl(0x38, 0x04140c78940f6a24f9ebbb0fdfc4dee8230038778c2bb6f2df) +// shl(0x39, 0x14643e5ae44d12b8e19aa74f5ed85a88af011a55bcda92be5b) +// } diff --git a/test/libevmasm/evmAssemblyTests/constant_optimizer_runs_200.asm b/test/libevmasm/evmAssemblyTests/constant_optimizer_runs_200.asm new file mode 100644 index 000000000000..85597757daa4 --- /dev/null +++ b/test/libevmasm/evmAssemblyTests/constant_optimizer_runs_200.asm @@ -0,0 +1,709 @@ + +PUSH 0x2 + +.sub + PUSH 0x1 + PUSH 0x1 + PUSH 0x2000000 + PUSH 0x8000000000000 + PUSH 0x10000000000000000000 + PUSH 0x40000000000000000000000000 + PUSH 0x80000000000000000000000000000000 + PUSH 0x200000000000000000000000000000000000000 + PUSH 0x400000000000000000000000000000000000000000000 + PUSH 0x1000000000000000000000000000000000000000000000000000 + PUSH 0x2000000000000000000000000000000000000000000000000000000000 + PUSH 0x8000000000000000000000000000000000000000000000000000000000000000 + // masks with 2 bits + PUSH 0x3 + PUSH 0x6000000 + PUSH 0xc000000000000 + PUSH 0x30000000000000000000 + PUSH 0x60000000000000000000000000 + PUSH 0x180000000000000000000000000000000 + PUSH 0x300000000000000000000000000000000000000 + PUSH 0x600000000000000000000000000000000000000000000 + PUSH 0x1800000000000000000000000000000000000000000000000000 + PUSH 0x3000000000000000000000000000000000000000000000000000000000 + PUSH 0xc000000000000000000000000000000000000000000000000000000000000000 + // masks with 3 bits + PUSH 0x7 + PUSH 0xe000000 + PUSH 0x1c000000000000 + PUSH 0x38000000000000000000 + PUSH 0xe0000000000000000000000000 + PUSH 0x1c0000000000000000000000000000000 + PUSH 0x380000000000000000000000000000000000000 + PUSH 0xe00000000000000000000000000000000000000000000 + PUSH 0x1c00000000000000000000000000000000000000000000000000 + PUSH 0x3800000000000000000000000000000000000000000000000000000000 + PUSH 0xe000000000000000000000000000000000000000000000000000000000000000 + // masks with 4 bits + PUSH 0xf + PUSH 0x1e000000 + PUSH 0x3c000000000000 + PUSH 0x78000000000000000000 + PUSH 0xf0000000000000000000000000 + PUSH 0x3c0000000000000000000000000000000 + PUSH 0x780000000000000000000000000000000000000 + PUSH 0xf00000000000000000000000000000000000000000000 + PUSH 0x1e00000000000000000000000000000000000000000000000000 + PUSH 0x3c00000000000000000000000000000000000000000000000000000000 + PUSH 0xf000000000000000000000000000000000000000000000000000000000000000 + // masks with 7 bits + PUSH 0x7f + PUSH 0x7f000000 + PUSH 0xfe000000000000 + PUSH 0x1fc000000000000000000 + PUSH 0x3f8000000000000000000000000 + PUSH 0x7f0000000000000000000000000000000 + PUSH 0xfe0000000000000000000000000000000000000 + PUSH 0x1fc0000000000000000000000000000000000000000000 + PUSH 0x3f80000000000000000000000000000000000000000000000000 + PUSH 0x7f00000000000000000000000000000000000000000000000000000000 + PUSH 0xfe00000000000000000000000000000000000000000000000000000000000000 + // masks with 8 bits + PUSH 0xff + PUSH 0xff000000 + PUSH 0x1fe000000000000 + PUSH 0x3fc000000000000000000 + PUSH 0x7f8000000000000000000000000 + PUSH 0xff0000000000000000000000000000000 + PUSH 0xff0000000000000000000000000000000000000 + PUSH 0x1fe0000000000000000000000000000000000000000000 + PUSH 0x3fc0000000000000000000000000000000000000000000000000 + PUSH 0x7f80000000000000000000000000000000000000000000000000000000 + PUSH 0xff00000000000000000000000000000000000000000000000000000000000000 + // masks with 16 bits + PUSH 0xffff + PUSH 0xffff000000 + PUSH 0xffff000000000000 + PUSH 0xffff000000000000000000 + PUSH 0xffff000000000000000000000000 + PUSH 0xffff000000000000000000000000000000 + PUSH 0xffff000000000000000000000000000000000000 + PUSH 0xffff000000000000000000000000000000000000000000 + PUSH 0xffff000000000000000000000000000000000000000000000000 + PUSH 0xffff000000000000000000000000000000000000000000000000000000 + PUSH 0xffff000000000000000000000000000000000000000000000000000000000000 + // masks with 23 bits + PUSH 0x7fffff + PUSH 0x3fffff800000 + PUSH 0x1fffffc00000000000 + PUSH 0xfffffe00000000000000000 + PUSH 0xfffffe00000000000000000000000 + PUSH 0x7fffff00000000000000000000000000000 + PUSH 0x3fffff80000000000000000000000000000000000 + PUSH 0x3fffff80000000000000000000000000000000000000000 + PUSH 0x1fffffc0000000000000000000000000000000000000000000000 + PUSH 0xfffffe0000000000000000000000000000000000000000000000000000 + PUSH 0xfffffe0000000000000000000000000000000000000000000000000000000000 + // masks with 32 bits + PUSH 0xffffffff + PUSH 0x3fffffffc00000 + PUSH 0xffffffff00000000000 + PUSH 0x7fffffff80000000000000000 + PUSH 0x1fffffffe0000000000000000000000 + PUSH 0xffffffff0000000000000000000000000000 + PUSH 0x3fffffffc000000000000000000000000000000000 + PUSH 0xffffffff000000000000000000000000000000000000000 + PUSH 0x7fffffff800000000000000000000000000000000000000000000 + PUSH 0x1fffffffe00000000000000000000000000000000000000000000000000 + PUSH 0xffffffff00000000000000000000000000000000000000000000000000000000 + // masks with 47 bits + PUSH 0x7fffffffffff + PUSH 0x7fffffffffff00000 + PUSH 0xfffffffffffe0000000000 + PUSH 0x1fffffffffffc000000000000000 + PUSH 0x3fffffffffff800000000000000000000 + PUSH 0x7fffffffffff00000000000000000000000000 + PUSH 0xfffffffffffe0000000000000000000000000000000 + PUSH 0x1fffffffffffc000000000000000000000000000000000000 + PUSH 0x3fffffffffff800000000000000000000000000000000000000000 + PUSH 0x7fffffffffff00000000000000000000000000000000000000000000000 + PUSH 0xfffffffffffe0000000000000000000000000000000000000000000000000000 + // masks with 64 bits + PUSH 0xffffffffffffffff + PUSH 0x7fffffffffffffff80000 + PUSH 0x3fffffffffffffffc000000000 + PUSH 0x1fffffffffffffffe00000000000000 + PUSH 0xffffffffffffffff0000000000000000000 + PUSH 0xffffffffffffffff000000000000000000000000 + PUSH 0x7fffffffffffffff80000000000000000000000000000 + PUSH 0x3fffffffffffffffc000000000000000000000000000000000 + PUSH 0x1fffffffffffffffe00000000000000000000000000000000000000 + PUSH 0xffffffffffffffff0000000000000000000000000000000000000000000 + PUSH 0xffffffffffffffff000000000000000000000000000000000000000000000000 + // masks with 92 bits + PUSH 0xfffffffffffffffffffffff + PUSH 0xfffffffffffffffffffffff0000 + PUSH 0xfffffffffffffffffffffff00000000 + PUSH 0x1ffffffffffffffffffffffe000000000000 + PUSH 0x1ffffffffffffffffffffffe0000000000000000 + PUSH 0x3ffffffffffffffffffffffc00000000000000000000 + PUSH 0x3ffffffffffffffffffffffc000000000000000000000000 + PUSH 0x3ffffffffffffffffffffffc0000000000000000000000000000 + PUSH 0x7ffffffffffffffffffffff800000000000000000000000000000000 + PUSH 0x7ffffffffffffffffffffff8000000000000000000000000000000000000 + PUSH 0xfffffffffffffffffffffff00000000000000000000000000000000000000000 + // masks with 103 bits + PUSH 0x7fffffffffffffffffffffffff + PUSH 0x3fffffffffffffffffffffffff8000 + PUSH 0x1fffffffffffffffffffffffffc0000000 + PUSH 0xfffffffffffffffffffffffffe00000000000 + PUSH 0xfffffffffffffffffffffffffe000000000000000 + PUSH 0x7fffffffffffffffffffffffff0000000000000000000 + PUSH 0x3fffffffffffffffffffffffff80000000000000000000000 + PUSH 0x3fffffffffffffffffffffffff800000000000000000000000000 + PUSH 0x1fffffffffffffffffffffffffc000000000000000000000000000000 + PUSH 0xfffffffffffffffffffffffffe0000000000000000000000000000000000 + PUSH 0xfffffffffffffffffffffffffe00000000000000000000000000000000000000 + // masks with 128 bits + PUSH 0xffffffffffffffffffffffffffffffff + PUSH 0xffffffffffffffffffffffffffffffff000 + PUSH 0x1fffffffffffffffffffffffffffffffe000000 + PUSH 0x3fffffffffffffffffffffffffffffffc000000000 + PUSH 0x7fffffffffffffffffffffffffffffff8000000000000 + PUSH 0xffffffffffffffffffffffffffffffff0000000000000000 + PUSH 0xffffffffffffffffffffffffffffffff0000000000000000000 + PUSH 0x1fffffffffffffffffffffffffffffffe0000000000000000000000 + PUSH 0x3fffffffffffffffffffffffffffffffc0000000000000000000000000 + PUSH 0x7fffffffffffffffffffffffffffffff80000000000000000000000000000 + PUSH 0xffffffffffffffffffffffffffffffff00000000000000000000000000000000 + // masks with 133 bits + PUSH 0x1fffffffffffffffffffffffffffffffff + PUSH 0x1fffffffffffffffffffffffffffffffff000 + PUSH 0x1fffffffffffffffffffffffffffffffff000000 + PUSH 0x1fffffffffffffffffffffffffffffffff000000000 + PUSH 0x3ffffffffffffffffffffffffffffffffe000000000000 + PUSH 0x3ffffffffffffffffffffffffffffffffe000000000000000 + PUSH 0x3ffffffffffffffffffffffffffffffffe000000000000000000 + PUSH 0x7ffffffffffffffffffffffffffffffffc000000000000000000000 + PUSH 0x7ffffffffffffffffffffffffffffffffc000000000000000000000000 + PUSH 0x7ffffffffffffffffffffffffffffffffc000000000000000000000000000 + PUSH 0xfffffffffffffffffffffffffffffffff8000000000000000000000000000000 + // masks with 160 bits + PUSH 0xffffffffffffffffffffffffffffffffffffffff + PUSH 0x1fffffffffffffffffffffffffffffffffffffffe00 + PUSH 0x7fffffffffffffffffffffffffffffffffffffff80000 + PUSH 0xffffffffffffffffffffffffffffffffffffffff0000000 + PUSH 0x3fffffffffffffffffffffffffffffffffffffffc000000000 + PUSH 0xffffffffffffffffffffffffffffffffffffffff000000000000 + PUSH 0x1fffffffffffffffffffffffffffffffffffffffe00000000000000 + PUSH 0x7fffffffffffffffffffffffffffffffffffffff80000000000000000 + PUSH 0xffffffffffffffffffffffffffffffffffffffff0000000000000000000 + PUSH 0x3fffffffffffffffffffffffffffffffffffffffc000000000000000000000 + PUSH 0xffffffffffffffffffffffffffffffffffffffff000000000000000000000000 + // masks with 175 bits + PUSH 0x7fffffffffffffffffffffffffffffffffffffffffff + PUSH 0x7fffffffffffffffffffffffffffffffffffffffffff00 + PUSH 0x7fffffffffffffffffffffffffffffffffffffffffff0000 + PUSH 0x7fffffffffffffffffffffffffffffffffffffffffff000000 + PUSH 0x7fffffffffffffffffffffffffffffffffffffffffff00000000 + PUSH 0x7fffffffffffffffffffffffffffffffffffffffffff0000000000 + PUSH 0x7fffffffffffffffffffffffffffffffffffffffffff000000000000 + PUSH 0x7fffffffffffffffffffffffffffffffffffffffffff00000000000000 + PUSH 0x7fffffffffffffffffffffffffffffffffffffffffff0000000000000000 + PUSH 0x7fffffffffffffffffffffffffffffffffffffffffff000000000000000000 + PUSH 0xfffffffffffffffffffffffffffffffffffffffffffe00000000000000000000 + // masks with 200 bits + PUSH 0xffffffffffffffffffffffffffffffffffffffffffffffffff + PUSH 0x1fffffffffffffffffffffffffffffffffffffffffffffffffe0 + PUSH 0x7fffffffffffffffffffffffffffffffffffffffffffffffff800 + PUSH 0xffffffffffffffffffffffffffffffffffffffffffffffffff0000 + PUSH 0x3fffffffffffffffffffffffffffffffffffffffffffffffffc00000 + PUSH 0xffffffffffffffffffffffffffffffffffffffffffffffffff0000000 + PUSH 0x1fffffffffffffffffffffffffffffffffffffffffffffffffe00000000 + PUSH 0x7fffffffffffffffffffffffffffffffffffffffffffffffff8000000000 + PUSH 0xffffffffffffffffffffffffffffffffffffffffffffffffff00000000000 + PUSH 0x3fffffffffffffffffffffffffffffffffffffffffffffffffc000000000000 + PUSH 0xffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000 + // masks with 255 bits + PUSH 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + PUSH 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe + // masks with 256 bits + PUSH 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + // powers of 10 + PUSH 0xa + PUSH 0x64 + PUSH 0x3e8 + PUSH 0x2710 + PUSH 0x186a0 + PUSH 0xf4240 + PUSH 0x989680 + PUSH 0x5f5e100 + PUSH 0x3b9aca00 + PUSH 0x2540be400 + PUSH 0x174876e800 + PUSH 0xe8d4a51000 + PUSH 0x9184e72a000 + PUSH 0x5af3107a4000 + PUSH 0x38d7ea4c68000 + PUSH 0x2386f26fc10000 + PUSH 0x16345785d8a0000 + PUSH 0xde0b6b3a7640000 + PUSH 0x8ac7230489e80000 + PUSH 0x56bc75e2d63100000 + PUSH 0x3635c9adc5dea00000 + PUSH 0x21e19e0c9bab2400000 + PUSH 0x152d02c7e14af6800000 + PUSH 0xd3c21bcecceda1000000 + PUSH 0x84595161401484a000000 + PUSH 0x52b7d2dcc80cd2e4000000 + PUSH 0x33b2e3c9fd0803ce8000000 + PUSH 0x204fce5e3e25026110000000 + PUSH 0x1431e0fae6d7217caa0000000 + PUSH 0xc9f2c9cd04674edea40000000 + PUSH 0x7e37be2022c0914b2680000000 + PUSH 0x4ee2d6d415b85acef8100000000 + PUSH 0x314dc6448d9338c15b0a00000000 + PUSH 0x1ed09bead87c0378d8e6400000000 + PUSH 0x13426172c74d822b878fe800000000 + PUSH 0xc097ce7bc90715b34b9f1000000000 + PUSH 0x785ee10d5da46d900f436a000000000 + PUSH 0x4b3b4ca85a86c47a098a224000000000 + PUSH 0x2f050fe938943acc45f65568000000000 + PUSH 0x1d6329f1c35ca4bfabb9f5610000000000 + PUSH 0x125dfa371a19e6f7cb54395ca0000000000 + PUSH 0xb7abc627050305adf14a3d9e40000000000 + PUSH 0x72cb5bd86321e38cb6ce6682e80000000000 + PUSH 0x47bf19673df52e37f2410011d100000000000 + PUSH 0x2cd76fe086b93ce2f768a00b22a00000000000 + PUSH 0x1c06a5ec5433c60ddaa16406f5a400000000000 + PUSH 0x118427b3b4a05bc8a8a4de845986800000000000 + PUSH 0xaf298d050e4395d69670b12b7f41000000000000 + PUSH 0x6d79f82328ea3da61e066ebb2f88a000000000000 + PUSH 0x446c3b15f9926687d2c40534fdb564000000000000 + PUSH 0x2ac3a4edbbfb8014e3ba83411e915e8000000000000 + PUSH 0x1aba4714957d300d0e549208b31adb10000000000000 + PUSH 0x10b46c6cdd6e3e0828f4db456ff0c8ea0000000000000 + PUSH 0xa70c3c40a64e6c51999090b65f67d9240000000000000 + PUSH 0x6867a5a867f103b2fffa5a71fba0e7b680000000000000 + PUSH 0x4140c78940f6a24fdffc78873d4490d2100000000000000 + PUSH 0x28c87cb5c89a2571ebfdcb54864ada834a00000000000000 + PUSH 0x197d4df19d605767337e9f14d3eec8920e400000000000000 + PUSH 0xfee50b7025c36a0802f236d04753d5b48e800000000000000 + PUSH 0x9f4f2726179a224501d762422c946590d91000000000000000 + PUSH 0x63917877cec0556b21269d695bdcbf7a87aa000000000000000 + PUSH 0x3e3aeb4ae1383562f4b82261d969f7ac94ca4000000000000000 + PUSH 0x26e4d30eccc3215dd8f3157d27e23acbdcfe68000000000000000 + PUSH 0x184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000 + PUSH 0xf316271c7fc3908a8bef464e3945ef7a25360a0000000000000000 + PUSH 0x97edd871cfda3a5697758bf0e3cbb5ac5741c640000000000000000 + PUSH 0x5ef4a74721e864761ea977768e5f518bb6891be80000000000000000 + PUSH 0x3b58e88c75313ec9d329eaaa18fb92f75215b17100000000000000000 + PUSH 0x25179157c93ec73e23fa32aa4f9d3bda934d8ee6a00000000000000000 + PUSH 0x172ebad6ddc73c86d67c5faa71c245689c1079502400000000000000000 + PUSH 0xe7d34c64a9c85d4460dbbca87196b61618a4bd216800000000000000000 + PUSH 0x90e40fbeea1d3a4abc8955e946fe31cdcf66f634e1000000000000000000 + PUSH 0x5a8e89d75252446eb5d5d5b1cc5edf20a1a059e10ca000000000000000000 + PUSH 0x3899162693736ac531a5a58f1fbb4b746504382ca7e4000000000000000000 + PUSH 0x235fadd81c2822bb3f07877973d50f28bf22a31be8ee8000000000000000000 + PUSH 0x161bcca7119915b50764b4abe86529797775a5f1719510000000000000000000 + PUSH 0xdd15fe86affad91249ef0eb713f39ebeaa987b6e6fd2a0000000000000000000 + // powers of 10 multiplied by ffffffffffffffff + PUSH 0x9fffffffffffffff6 + PUSH 0x63ffffffffffffff9c + PUSH 0x3e7fffffffffffffc18 + PUSH 0x270fffffffffffffd8f0 + PUSH 0x1869ffffffffffffe7960 + PUSH 0xf423ffffffffffff0bdc0 + PUSH 0x98967fffffffffff676980 + PUSH 0x5f5e0fffffffffffa0a1f00 + PUSH 0x3b9ac9ffffffffffc4653600 + PUSH 0x2540be3fffffffffdabf41c00 + PUSH 0x174876e7ffffffffe8b7891800 + PUSH 0xe8d4a50fffffffff172b5af000 + PUSH 0x9184e729ffffffff6e7b18d6000 + PUSH 0x5af3107a3fffffffa50cef85c000 + PUSH 0x38d7ea4c67ffffffc72815b398000 + PUSH 0x2386f26fc0ffffffdc790d903f0000 + PUSH 0x16345785d89fffffe9cba87a2760000 + PUSH 0xde0b6b3a763fffff21f494c589c0000 + PUSH 0x8ac7230489e7ffff7538dcfb76180000 + PUSH 0x56bc75e2d630ffffa9438a1d29cf00000 + PUSH 0x3635c9adc5de9fffc9ca36523a21600000 + PUSH 0x21e19e0c9bab23ffde1e61f36454dc00000 + PUSH 0x152d02c7e14af67fead2fd381eb509800000 + PUSH 0xd3c21bcecceda0ff2c3de43133125f000000 + PUSH 0x845951614014849f7ba6ae9ebfeb7b6000000 + PUSH 0x52b7d2dcc80cd2e3ad482d2337f32d1c000000 + PUSH 0x33b2e3c9fd0803ce4c4d1c3602f7fc318000000 + PUSH 0x204fce5e3e250260efb031a1c1dafd9ef0000000 + PUSH 0x1431e0fae6d7217c95ce1f051928de83560000000 + PUSH 0xc9f2c9cd04674eddda0d3632fb98b1215c0000000 + PUSH 0x7e37be2022c0914aa84841dfdd3f6eb4d980000000 + PUSH 0x4ee2d6d415b85acea92d292bea47a53107f00000000 + PUSH 0x314dc6448d9338c129bc39bb726cc73ea4f600000000 + PUSH 0x1ed09bead87c0378ba15a4152783fc872719c00000000 + PUSH 0x13426172c74d822b744d868d38b27dd478701800000000 + PUSH 0xc097ce7bc90715b28b07418436f8ea4cb460f000000000 + PUSH 0x785ee10d5da46d8f96e488f2a25b926ff0bc96000000000 + PUSH 0x4b3b4ca85a86c479be4ed597a5793b85f675ddc000000000 + PUSH 0x2f050fe938943acc16f1457ec76bc533ba09aa98000000000 + PUSH 0x1d6329f1c35ca4bf8e56cb6f3ca35b4054460a9f0000000000 + PUSH 0x125dfa371a19e6f7b8f63f2585e6190834abc6a360000000000 + PUSH 0xb7abc627050305ad399e77773afcfa520eb5c261c0000000000 + PUSH 0x72cb5bd86321e38c44030aaa84de1c734931997d180000000000 + PUSH 0x47bf19673df52e37aa81e6aa930ad1c80dbeffee2f00000000000 + PUSH 0x2cd76fe086b93ce2ca91302a9be6c31d08975ff4dd600000000000 + PUSH 0x1c06a5ec5433c60dbe9abe1aa17039f2255e9bf90a5c00000000000 + PUSH 0x118427b3b4a05bc89720b6d0a4e62437575b217ba679800000000000 + PUSH 0xaf298d050e4395d5e747242670fd6a29698f4ed480bf000000000000 + PUSH 0x6d79f82328ea3da5b08c7698069e6259e1f99144d0776000000000000 + PUSH 0x446c3b15f99266878e57ca1f0422fd782d3bfacb024a9c000000000000 + PUSH 0x2ac3a4edbbfb8014b8f6de536295de6b1c457cbee16ea18000000000000 + PUSH 0x1aba4714957d300cf39a4af41d9dab02f1ab6df74ce524f0000000000000 + PUSH 0x10b46c6cdd6e3e0818406ed892828ae1d70b24ba900f37160000000000000 + PUSH 0xa70c3c40a64e6c50f2845475b9196cd2666f6f49a09826dc0000000000000 + PUSH 0x6867a5a867f103b29792b4c993afe4038005a58e045f184980000000000000 + PUSH 0x4140c78940f6a24f9ebbb0fdfc4dee8230038778c2bb6f2df00000000000000 + PUSH 0x28c87cb5c89a2571c3354e9ebdb0b5115e0234ab79b5257cb600000000000000 +// ==== +// optimizationPreset: none +// optimizer.constantOptimizer: true +// optimizer.expectedExecutionsPerDeployment: 200 +// outputs: Assembly +// ---- +// Assembly: +// 0x02 +// stop +// +// sub_0: assembly { +// 0x01 +// 0x01 +// 0x02000000 +// 0x08000000000000 +// 0x10000000000000000000 +// shl(0x66, 0x01) +// shl(0x7f, 0x01) +// shl(0x99, 0x01) +// shl(0xb2, 0x01) +// shl(0xcc, 0x01) +// shl(0xe5, 0x01) +// shl(0xff, 0x01) +// 0x03 +// 0x06000000 +// 0x0c000000000000 +// 0x30000000000000000000 +// shl(0x65, 0x03) +// shl(0x7f, 0x03) +// shl(0x98, 0x03) +// shl(0xb1, 0x03) +// shl(0xcb, 0x03) +// shl(0xe4, 0x03) +// shl(0xfe, 0x03) +// 0x07 +// 0x0e000000 +// 0x1c000000000000 +// 0x38000000000000000000 +// shl(0x65, 0x07) +// shl(0x7e, 0x07) +// shl(0x97, 0x07) +// shl(0xb1, 0x07) +// shl(0xca, 0x07) +// shl(0xe3, 0x07) +// shl(0xfd, 0x07) +// 0x0f +// 0x1e000000 +// 0x3c000000000000 +// 0x78000000000000000000 +// shl(0x64, 0x0f) +// shl(0x7e, 0x0f) +// shl(0x97, 0x0f) +// shl(0xb0, 0x0f) +// shl(0xc9, 0x0f) +// shl(0xe2, 0x0f) +// shl(0xfc, 0x0f) +// 0x7f +// 0x7f000000 +// 0xfe000000000000 +// shl(0x4a, 0x7f) +// shl(0x63, 0x7f) +// shl(0x7c, 0x7f) +// shl(0x95, 0x7f) +// shl(0xae, 0x7f) +// shl(0xc7, 0x7f) +// shl(0xe0, 0x7f) +// shl(0xf9, 0x7f) +// 0xff +// 0xff000000 +// 0x01fe000000000000 +// shl(0x4a, 0xff) +// shl(0x63, 0xff) +// shl(0x7c, 0xff) +// shl(0x94, 0xff) +// shl(0xad, 0xff) +// shl(0xc6, 0xff) +// shl(0xdf, 0xff) +// not(sub(shl(0xf8, 0x01), 0x01)) +// 0xffff +// 0xffff000000 +// 0xffff000000000000 +// 0xffff000000000000000000 +// shl(0x60, 0xffff) +// shl(0x78, 0xffff) +// shl(0x90, 0xffff) +// shl(0xa8, 0xffff) +// shl(0xc0, 0xffff) +// shl(0xd8, 0xffff) +// not(sub(shl(0xf0, 0x01), 0x01)) +// 0x7fffff +// 0x3fffff800000 +// 0x1fffffc00000000000 +// 0x0fffffe00000000000000000 +// shl(0x5d, 0x7fffff) +// shl(0x74, 0x7fffff) +// shl(0x8b, 0x7fffff) +// shl(0xa3, 0x7fffff) +// shl(0xba, 0x7fffff) +// shl(0xd1, 0x7fffff) +// not(sub(shl(0xe9, 0x01), 0x01)) +// 0xffffffff +// 0x3fffffffc00000 +// 0x0ffffffff00000000000 +// 0x07fffffff80000000000000000 +// shl(0x59, 0xffffffff) +// shl(0x70, 0xffffffff) +// shl(0x86, 0xffffffff) +// shl(0x9c, 0xffffffff) +// shl(0xb3, 0xffffffff) +// shl(0xc9, 0xffffffff) +// not(sub(shl(0xe0, 0x01), 0x01)) +// 0x7fffffffffff +// 0x07fffffffffff00000 +// 0xfffffffffffe0000000000 +// 0x1fffffffffffc000000000000000 +// shl(0x53, 0x7fffffffffff) +// shl(0x68, 0x7fffffffffff) +// shl(0x7d, 0x7fffffffffff) +// shl(0x92, 0x7fffffffffff) +// shl(0xa7, 0x7fffffffffff) +// shl(0xbc, 0x7fffffffffff) +// not(sub(shl(0xd1, 0x01), 0x01)) +// 0xffffffffffffffff +// 0x07fffffffffffffff80000 +// 0x3fffffffffffffffc000000000 +// 0x01fffffffffffffffe00000000000000 +// shl(0x4c, 0xffffffffffffffff) +// shl(0x60, 0xffffffffffffffff) +// shl(0x73, 0xffffffffffffffff) +// shl(0x86, 0xffffffffffffffff) +// shl(0x99, 0xffffffffffffffff) +// shl(0xac, 0xffffffffffffffff) +// not(sub(shl(0xc0, 0x01), 0x01)) +// 0x0fffffffffffffffffffffff +// 0x0fffffffffffffffffffffff0000 +// 0x0fffffffffffffffffffffff00000000 +// 0x1ffffffffffffffffffffffe000000000000 +// 0x1ffffffffffffffffffffffe0000000000000000 +// shl(0x52, 0x0fffffffffffffffffffffff) +// shl(0x62, 0x0fffffffffffffffffffffff) +// shl(0x72, 0x0fffffffffffffffffffffff) +// shl(0x83, 0x0fffffffffffffffffffffff) +// shl(0x93, 0x0fffffffffffffffffffffff) +// not(sub(shl(0xa4, 0x01), 0x01)) +// 0x7fffffffffffffffffffffffff +// 0x3fffffffffffffffffffffffff8000 +// 0x1fffffffffffffffffffffffffc0000000 +// 0x0fffffffffffffffffffffffffe00000000000 +// 0x0fffffffffffffffffffffffffe000000000000000 +// shl(0x4c, 0x7fffffffffffffffffffffffff) +// shl(0x5b, 0x7fffffffffffffffffffffffff) +// shl(0x6b, 0x7fffffffffffffffffffffffff) +// shl(0x7a, 0x7fffffffffffffffffffffffff) +// shl(0x89, 0x7fffffffffffffffffffffffff) +// not(sub(shl(0x99, 0x01), 0x01)) +// 0xffffffffffffffffffffffffffffffff +// 0x0ffffffffffffffffffffffffffffffff000 +// 0x01fffffffffffffffffffffffffffffffe000000 +// 0x3fffffffffffffffffffffffffffffffc000000000 +// 0x07fffffffffffffffffffffffffffffff8000000000000 +// 0xffffffffffffffffffffffffffffffff0000000000000000 +// shl(0x4c, 0xffffffffffffffffffffffffffffffff) +// shl(0x59, 0xffffffffffffffffffffffffffffffff) +// shl(0x66, 0xffffffffffffffffffffffffffffffff) +// shl(0x73, 0xffffffffffffffffffffffffffffffff) +// not(0xffffffffffffffffffffffffffffffff) +// 0x1fffffffffffffffffffffffffffffffff +// 0x01fffffffffffffffffffffffffffffffff000 +// 0x1fffffffffffffffffffffffffffffffff000000 +// 0x01fffffffffffffffffffffffffffffffff000000000 +// 0x3ffffffffffffffffffffffffffffffffe000000000000 +// 0x03ffffffffffffffffffffffffffffffffe000000000000000 +// 0x3ffffffffffffffffffffffffffffffffe000000000000000000 +// shl(0x56, 0x1fffffffffffffffffffffffffffffffff) +// shl(0x62, 0x1fffffffffffffffffffffffffffffffff) +// shl(0x6e, 0x1fffffffffffffffffffffffffffffffff) +// not(0x07ffffffffffffffffffffffffffffff) +// sub(shl(0xa0, 0x01), 0x01) +// sub(shl(0xa9, 0x01), 0x0200) +// sub(shl(0xb3, 0x01), 0x080000) +// sub(shl(0xbc, 0x01), 0x10000000) +// sub(shl(0xc6, 0x01), 0x4000000000) +// sub(shl(0xd0, 0x01), 0x01000000000000) +// sub(shl(0xd9, 0x01), 0x0200000000000000) +// sub(shl(0xe3, 0x01), 0x080000000000000000) +// sub(shl(0xec, 0x01), 0x10000000000000000000) +// sub(shl(0xf6, 0x01), shl(0x56, 0x01)) +// not(0xffffffffffffffffffffffff) +// sub(shl(0xaf, 0x01), 0x01) +// sub(shl(0xb7, 0x01), 0x0100) +// sub(shl(0xbf, 0x01), 0x010000) +// sub(shl(0xc7, 0x01), 0x01000000) +// sub(shl(0xcf, 0x01), 0x0100000000) +// sub(shl(0xd7, 0x01), 0x010000000000) +// sub(shl(0xdf, 0x01), 0x01000000000000) +// sub(shl(0xe7, 0x01), 0x0100000000000000) +// sub(shl(0xef, 0x01), 0x010000000000000000) +// sub(shl(0xf7, 0x01), 0x01000000000000000000) +// not(0x01ffffffffffffffffffff) +// sub(shl(0xc8, 0x01), 0x01) +// sub(shl(0xcd, 0x01), 0x20) +// sub(shl(0xd3, 0x01), 0x0800) +// sub(shl(0xd8, 0x01), 0x010000) +// sub(shl(0xde, 0x01), 0x400000) +// sub(shl(0xe4, 0x01), 0x10000000) +// sub(shl(0xe9, 0x01), 0x0200000000) +// sub(shl(0xef, 0x01), 0x8000000000) +// sub(shl(0xf4, 0x01), 0x100000000000) +// sub(shl(0xfa, 0x01), 0x04000000000000) +// not(0xffffffffffffff) +// sub(shl(0xff, 0x01), 0x01) +// not(0x01) +// not(0x00) +// 0x0a +// 0x64 +// 0x03e8 +// 0x2710 +// 0x0186a0 +// 0x0f4240 +// 0x989680 +// 0x05f5e100 +// 0x3b9aca00 +// 0x02540be400 +// 0x174876e800 +// 0xe8d4a51000 +// 0x09184e72a000 +// 0x5af3107a4000 +// 0x038d7ea4c68000 +// 0x2386f26fc10000 +// 0x016345785d8a0000 +// 0x0de0b6b3a7640000 +// 0x8ac7230489e80000 +// 0x056bc75e2d63100000 +// 0x3635c9adc5dea00000 +// 0x021e19e0c9bab2400000 +// 0x152d02c7e14af6800000 +// 0xd3c21bcecceda1000000 +// 0x084595161401484a000000 +// 0x52b7d2dcc80cd2e4000000 +// 0x033b2e3c9fd0803ce8000000 +// 0x204fce5e3e25026110000000 +// 0x01431e0fae6d7217caa0000000 +// 0x0c9f2c9cd04674edea40000000 +// 0x7e37be2022c0914b2680000000 +// 0x04ee2d6d415b85acef8100000000 +// 0x314dc6448d9338c15b0a00000000 +// 0x01ed09bead87c0378d8e6400000000 +// 0x13426172c74d822b878fe800000000 +// 0xc097ce7bc90715b34b9f1000000000 +// 0x0785ee10d5da46d900f436a000000000 +// 0x4b3b4ca85a86c47a098a224000000000 +// 0x02f050fe938943acc45f65568000000000 +// 0x1d6329f1c35ca4bfabb9f5610000000000 +// 0x0125dfa371a19e6f7cb54395ca0000000000 +// 0x0b7abc627050305adf14a3d9e40000000000 +// 0x72cb5bd86321e38cb6ce6682e80000000000 +// 0x047bf19673df52e37f2410011d100000000000 +// 0x2cd76fe086b93ce2f768a00b22a00000000000 +// 0x01c06a5ec5433c60ddaa16406f5a400000000000 +// 0x118427b3b4a05bc8a8a4de845986800000000000 +// 0xaf298d050e4395d69670b12b7f41000000000000 +// 0x06d79f82328ea3da61e066ebb2f88a000000000000 +// 0x446c3b15f9926687d2c40534fdb564000000000000 +// 0x02ac3a4edbbfb8014e3ba83411e915e8000000000000 +// 0x1aba4714957d300d0e549208b31adb10000000000000 +// 0x010b46c6cdd6e3e0828f4db456ff0c8ea0000000000000 +// 0x0a70c3c40a64e6c51999090b65f67d9240000000000000 +// 0x6867a5a867f103b2fffa5a71fba0e7b680000000000000 +// 0x04140c78940f6a24fdffc78873d4490d2100000000000000 +// 0x28c87cb5c89a2571ebfdcb54864ada834a00000000000000 +// 0x0197d4df19d605767337e9f14d3eec8920e400000000000000 +// 0x0fee50b7025c36a0802f236d04753d5b48e800000000000000 +// 0x9f4f2726179a224501d762422c946590d91000000000000000 +// 0x063917877cec0556b21269d695bdcbf7a87aa000000000000000 +// 0x3e3aeb4ae1383562f4b82261d969f7ac94ca4000000000000000 +// 0x026e4d30eccc3215dd8f3157d27e23acbdcfe68000000000000000 +// 0x184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000 +// 0xf316271c7fc3908a8bef464e3945ef7a25360a0000000000000000 +// 0x097edd871cfda3a5697758bf0e3cbb5ac5741c640000000000000000 +// 0x5ef4a74721e864761ea977768e5f518bb6891be80000000000000000 +// 0x03b58e88c75313ec9d329eaaa18fb92f75215b17100000000000000000 +// 0x25179157c93ec73e23fa32aa4f9d3bda934d8ee6a00000000000000000 +// 0x0172ebad6ddc73c86d67c5faa71c245689c1079502400000000000000000 +// 0x0e7d34c64a9c85d4460dbbca87196b61618a4bd216800000000000000000 +// 0x90e40fbeea1d3a4abc8955e946fe31cdcf66f634e1000000000000000000 +// 0x05a8e89d75252446eb5d5d5b1cc5edf20a1a059e10ca000000000000000000 +// 0x3899162693736ac531a5a58f1fbb4b746504382ca7e4000000000000000000 +// shl(0x4b, 0x46bf5bb0385045767e0f0ef2e7aa1e517e454637d1dd) +// 0x161bcca7119915b50764b4abe86529797775a5f1719510000000000000000000 +// 0xdd15fe86affad91249ef0eb713f39ebeaa987b6e6fd2a0000000000000000000 +// 0x09fffffffffffffff6 +// 0x63ffffffffffffff9c +// 0x03e7fffffffffffffc18 +// 0x270fffffffffffffd8f0 +// 0x01869ffffffffffffe7960 +// 0x0f423ffffffffffff0bdc0 +// 0x98967fffffffffff676980 +// 0x05f5e0fffffffffffa0a1f00 +// 0x3b9ac9ffffffffffc4653600 +// 0x02540be3fffffffffdabf41c00 +// 0x174876e7ffffffffe8b7891800 +// 0xe8d4a50fffffffff172b5af000 +// 0x09184e729ffffffff6e7b18d6000 +// 0x5af3107a3fffffffa50cef85c000 +// 0x038d7ea4c67ffffffc72815b398000 +// 0x2386f26fc0ffffffdc790d903f0000 +// 0x016345785d89fffffe9cba87a2760000 +// 0x0de0b6b3a763fffff21f494c589c0000 +// 0x8ac7230489e7ffff7538dcfb76180000 +// 0x056bc75e2d630ffffa9438a1d29cf00000 +// 0x3635c9adc5de9fffc9ca36523a21600000 +// 0x021e19e0c9bab23ffde1e61f36454dc00000 +// 0x152d02c7e14af67fead2fd381eb509800000 +// 0xd3c21bcecceda0ff2c3de43133125f000000 +// 0x0845951614014849f7ba6ae9ebfeb7b6000000 +// 0x52b7d2dcc80cd2e3ad482d2337f32d1c000000 +// 0x033b2e3c9fd0803ce4c4d1c3602f7fc318000000 +// 0x204fce5e3e250260efb031a1c1dafd9ef0000000 +// 0x01431e0fae6d7217c95ce1f051928de83560000000 +// 0x0c9f2c9cd04674eddda0d3632fb98b1215c0000000 +// 0x7e37be2022c0914aa84841dfdd3f6eb4d980000000 +// 0x04ee2d6d415b85acea92d292bea47a53107f00000000 +// 0x314dc6448d9338c129bc39bb726cc73ea4f600000000 +// 0x01ed09bead87c0378ba15a4152783fc872719c00000000 +// 0x13426172c74d822b744d868d38b27dd478701800000000 +// 0xc097ce7bc90715b28b07418436f8ea4cb460f000000000 +// 0x0785ee10d5da46d8f96e488f2a25b926ff0bc96000000000 +// 0x4b3b4ca85a86c479be4ed597a5793b85f675ddc000000000 +// 0x02f050fe938943acc16f1457ec76bc533ba09aa98000000000 +// 0x1d6329f1c35ca4bf8e56cb6f3ca35b4054460a9f0000000000 +// 0x0125dfa371a19e6f7b8f63f2585e6190834abc6a360000000000 +// 0x0b7abc627050305ad399e77773afcfa520eb5c261c0000000000 +// 0x72cb5bd86321e38c44030aaa84de1c734931997d180000000000 +// 0x047bf19673df52e37aa81e6aa930ad1c80dbeffee2f00000000000 +// 0x2cd76fe086b93ce2ca91302a9be6c31d08975ff4dd600000000000 +// 0x01c06a5ec5433c60dbe9abe1aa17039f2255e9bf90a5c00000000000 +// 0x118427b3b4a05bc89720b6d0a4e62437575b217ba679800000000000 +// 0xaf298d050e4395d5e747242670fd6a29698f4ed480bf000000000000 +// 0x06d79f82328ea3da5b08c7698069e6259e1f99144d0776000000000000 +// 0x446c3b15f99266878e57ca1f0422fd782d3bfacb024a9c000000000000 +// 0x02ac3a4edbbfb8014b8f6de536295de6b1c457cbee16ea18000000000000 +// 0x1aba4714957d300cf39a4af41d9dab02f1ab6df74ce524f0000000000000 +// 0x010b46c6cdd6e3e0818406ed892828ae1d70b24ba900f37160000000000000 +// 0x0a70c3c40a64e6c50f2845475b9196cd2666f6f49a09826dc0000000000000 +// 0x6867a5a867f103b29792b4c993afe4038005a58e045f184980000000000000 +// 0x04140c78940f6a24f9ebbb0fdfc4dee8230038778c2bb6f2df00000000000000 +// 0x28c87cb5c89a2571c3354e9ebdb0b5115e0234ab79b5257cb600000000000000 +// } diff --git a/test/libevmasm/evmAssemblyTests/constant_optimizer_runs_2M.asm b/test/libevmasm/evmAssemblyTests/constant_optimizer_runs_2M.asm new file mode 100644 index 000000000000..a7be38817353 --- /dev/null +++ b/test/libevmasm/evmAssemblyTests/constant_optimizer_runs_2M.asm @@ -0,0 +1,709 @@ + +PUSH 0x2 + +.sub + PUSH 0x1 + PUSH 0x1 + PUSH 0x2000000 + PUSH 0x8000000000000 + PUSH 0x10000000000000000000 + PUSH 0x40000000000000000000000000 + PUSH 0x80000000000000000000000000000000 + PUSH 0x200000000000000000000000000000000000000 + PUSH 0x400000000000000000000000000000000000000000000 + PUSH 0x1000000000000000000000000000000000000000000000000000 + PUSH 0x2000000000000000000000000000000000000000000000000000000000 + PUSH 0x8000000000000000000000000000000000000000000000000000000000000000 + // masks with 2 bits + PUSH 0x3 + PUSH 0x6000000 + PUSH 0xc000000000000 + PUSH 0x30000000000000000000 + PUSH 0x60000000000000000000000000 + PUSH 0x180000000000000000000000000000000 + PUSH 0x300000000000000000000000000000000000000 + PUSH 0x600000000000000000000000000000000000000000000 + PUSH 0x1800000000000000000000000000000000000000000000000000 + PUSH 0x3000000000000000000000000000000000000000000000000000000000 + PUSH 0xc000000000000000000000000000000000000000000000000000000000000000 + // masks with 3 bits + PUSH 0x7 + PUSH 0xe000000 + PUSH 0x1c000000000000 + PUSH 0x38000000000000000000 + PUSH 0xe0000000000000000000000000 + PUSH 0x1c0000000000000000000000000000000 + PUSH 0x380000000000000000000000000000000000000 + PUSH 0xe00000000000000000000000000000000000000000000 + PUSH 0x1c00000000000000000000000000000000000000000000000000 + PUSH 0x3800000000000000000000000000000000000000000000000000000000 + PUSH 0xe000000000000000000000000000000000000000000000000000000000000000 + // masks with 4 bits + PUSH 0xf + PUSH 0x1e000000 + PUSH 0x3c000000000000 + PUSH 0x78000000000000000000 + PUSH 0xf0000000000000000000000000 + PUSH 0x3c0000000000000000000000000000000 + PUSH 0x780000000000000000000000000000000000000 + PUSH 0xf00000000000000000000000000000000000000000000 + PUSH 0x1e00000000000000000000000000000000000000000000000000 + PUSH 0x3c00000000000000000000000000000000000000000000000000000000 + PUSH 0xf000000000000000000000000000000000000000000000000000000000000000 + // masks with 7 bits + PUSH 0x7f + PUSH 0x7f000000 + PUSH 0xfe000000000000 + PUSH 0x1fc000000000000000000 + PUSH 0x3f8000000000000000000000000 + PUSH 0x7f0000000000000000000000000000000 + PUSH 0xfe0000000000000000000000000000000000000 + PUSH 0x1fc0000000000000000000000000000000000000000000 + PUSH 0x3f80000000000000000000000000000000000000000000000000 + PUSH 0x7f00000000000000000000000000000000000000000000000000000000 + PUSH 0xfe00000000000000000000000000000000000000000000000000000000000000 + // masks with 8 bits + PUSH 0xff + PUSH 0xff000000 + PUSH 0x1fe000000000000 + PUSH 0x3fc000000000000000000 + PUSH 0x7f8000000000000000000000000 + PUSH 0xff0000000000000000000000000000000 + PUSH 0xff0000000000000000000000000000000000000 + PUSH 0x1fe0000000000000000000000000000000000000000000 + PUSH 0x3fc0000000000000000000000000000000000000000000000000 + PUSH 0x7f80000000000000000000000000000000000000000000000000000000 + PUSH 0xff00000000000000000000000000000000000000000000000000000000000000 + // masks with 16 bits + PUSH 0xffff + PUSH 0xffff000000 + PUSH 0xffff000000000000 + PUSH 0xffff000000000000000000 + PUSH 0xffff000000000000000000000000 + PUSH 0xffff000000000000000000000000000000 + PUSH 0xffff000000000000000000000000000000000000 + PUSH 0xffff000000000000000000000000000000000000000000 + PUSH 0xffff000000000000000000000000000000000000000000000000 + PUSH 0xffff000000000000000000000000000000000000000000000000000000 + PUSH 0xffff000000000000000000000000000000000000000000000000000000000000 + // masks with 23 bits + PUSH 0x7fffff + PUSH 0x3fffff800000 + PUSH 0x1fffffc00000000000 + PUSH 0xfffffe00000000000000000 + PUSH 0xfffffe00000000000000000000000 + PUSH 0x7fffff00000000000000000000000000000 + PUSH 0x3fffff80000000000000000000000000000000000 + PUSH 0x3fffff80000000000000000000000000000000000000000 + PUSH 0x1fffffc0000000000000000000000000000000000000000000000 + PUSH 0xfffffe0000000000000000000000000000000000000000000000000000 + PUSH 0xfffffe0000000000000000000000000000000000000000000000000000000000 + // masks with 32 bits + PUSH 0xffffffff + PUSH 0x3fffffffc00000 + PUSH 0xffffffff00000000000 + PUSH 0x7fffffff80000000000000000 + PUSH 0x1fffffffe0000000000000000000000 + PUSH 0xffffffff0000000000000000000000000000 + PUSH 0x3fffffffc000000000000000000000000000000000 + PUSH 0xffffffff000000000000000000000000000000000000000 + PUSH 0x7fffffff800000000000000000000000000000000000000000000 + PUSH 0x1fffffffe00000000000000000000000000000000000000000000000000 + PUSH 0xffffffff00000000000000000000000000000000000000000000000000000000 + // masks with 47 bits + PUSH 0x7fffffffffff + PUSH 0x7fffffffffff00000 + PUSH 0xfffffffffffe0000000000 + PUSH 0x1fffffffffffc000000000000000 + PUSH 0x3fffffffffff800000000000000000000 + PUSH 0x7fffffffffff00000000000000000000000000 + PUSH 0xfffffffffffe0000000000000000000000000000000 + PUSH 0x1fffffffffffc000000000000000000000000000000000000 + PUSH 0x3fffffffffff800000000000000000000000000000000000000000 + PUSH 0x7fffffffffff00000000000000000000000000000000000000000000000 + PUSH 0xfffffffffffe0000000000000000000000000000000000000000000000000000 + // masks with 64 bits + PUSH 0xffffffffffffffff + PUSH 0x7fffffffffffffff80000 + PUSH 0x3fffffffffffffffc000000000 + PUSH 0x1fffffffffffffffe00000000000000 + PUSH 0xffffffffffffffff0000000000000000000 + PUSH 0xffffffffffffffff000000000000000000000000 + PUSH 0x7fffffffffffffff80000000000000000000000000000 + PUSH 0x3fffffffffffffffc000000000000000000000000000000000 + PUSH 0x1fffffffffffffffe00000000000000000000000000000000000000 + PUSH 0xffffffffffffffff0000000000000000000000000000000000000000000 + PUSH 0xffffffffffffffff000000000000000000000000000000000000000000000000 + // masks with 92 bits + PUSH 0xfffffffffffffffffffffff + PUSH 0xfffffffffffffffffffffff0000 + PUSH 0xfffffffffffffffffffffff00000000 + PUSH 0x1ffffffffffffffffffffffe000000000000 + PUSH 0x1ffffffffffffffffffffffe0000000000000000 + PUSH 0x3ffffffffffffffffffffffc00000000000000000000 + PUSH 0x3ffffffffffffffffffffffc000000000000000000000000 + PUSH 0x3ffffffffffffffffffffffc0000000000000000000000000000 + PUSH 0x7ffffffffffffffffffffff800000000000000000000000000000000 + PUSH 0x7ffffffffffffffffffffff8000000000000000000000000000000000000 + PUSH 0xfffffffffffffffffffffff00000000000000000000000000000000000000000 + // masks with 103 bits + PUSH 0x7fffffffffffffffffffffffff + PUSH 0x3fffffffffffffffffffffffff8000 + PUSH 0x1fffffffffffffffffffffffffc0000000 + PUSH 0xfffffffffffffffffffffffffe00000000000 + PUSH 0xfffffffffffffffffffffffffe000000000000000 + PUSH 0x7fffffffffffffffffffffffff0000000000000000000 + PUSH 0x3fffffffffffffffffffffffff80000000000000000000000 + PUSH 0x3fffffffffffffffffffffffff800000000000000000000000000 + PUSH 0x1fffffffffffffffffffffffffc000000000000000000000000000000 + PUSH 0xfffffffffffffffffffffffffe0000000000000000000000000000000000 + PUSH 0xfffffffffffffffffffffffffe00000000000000000000000000000000000000 + // masks with 128 bits + PUSH 0xffffffffffffffffffffffffffffffff + PUSH 0xffffffffffffffffffffffffffffffff000 + PUSH 0x1fffffffffffffffffffffffffffffffe000000 + PUSH 0x3fffffffffffffffffffffffffffffffc000000000 + PUSH 0x7fffffffffffffffffffffffffffffff8000000000000 + PUSH 0xffffffffffffffffffffffffffffffff0000000000000000 + PUSH 0xffffffffffffffffffffffffffffffff0000000000000000000 + PUSH 0x1fffffffffffffffffffffffffffffffe0000000000000000000000 + PUSH 0x3fffffffffffffffffffffffffffffffc0000000000000000000000000 + PUSH 0x7fffffffffffffffffffffffffffffff80000000000000000000000000000 + PUSH 0xffffffffffffffffffffffffffffffff00000000000000000000000000000000 + // masks with 133 bits + PUSH 0x1fffffffffffffffffffffffffffffffff + PUSH 0x1fffffffffffffffffffffffffffffffff000 + PUSH 0x1fffffffffffffffffffffffffffffffff000000 + PUSH 0x1fffffffffffffffffffffffffffffffff000000000 + PUSH 0x3ffffffffffffffffffffffffffffffffe000000000000 + PUSH 0x3ffffffffffffffffffffffffffffffffe000000000000000 + PUSH 0x3ffffffffffffffffffffffffffffffffe000000000000000000 + PUSH 0x7ffffffffffffffffffffffffffffffffc000000000000000000000 + PUSH 0x7ffffffffffffffffffffffffffffffffc000000000000000000000000 + PUSH 0x7ffffffffffffffffffffffffffffffffc000000000000000000000000000 + PUSH 0xfffffffffffffffffffffffffffffffff8000000000000000000000000000000 + // masks with 160 bits + PUSH 0xffffffffffffffffffffffffffffffffffffffff + PUSH 0x1fffffffffffffffffffffffffffffffffffffffe00 + PUSH 0x7fffffffffffffffffffffffffffffffffffffff80000 + PUSH 0xffffffffffffffffffffffffffffffffffffffff0000000 + PUSH 0x3fffffffffffffffffffffffffffffffffffffffc000000000 + PUSH 0xffffffffffffffffffffffffffffffffffffffff000000000000 + PUSH 0x1fffffffffffffffffffffffffffffffffffffffe00000000000000 + PUSH 0x7fffffffffffffffffffffffffffffffffffffff80000000000000000 + PUSH 0xffffffffffffffffffffffffffffffffffffffff0000000000000000000 + PUSH 0x3fffffffffffffffffffffffffffffffffffffffc000000000000000000000 + PUSH 0xffffffffffffffffffffffffffffffffffffffff000000000000000000000000 + // masks with 175 bits + PUSH 0x7fffffffffffffffffffffffffffffffffffffffffff + PUSH 0x7fffffffffffffffffffffffffffffffffffffffffff00 + PUSH 0x7fffffffffffffffffffffffffffffffffffffffffff0000 + PUSH 0x7fffffffffffffffffffffffffffffffffffffffffff000000 + PUSH 0x7fffffffffffffffffffffffffffffffffffffffffff00000000 + PUSH 0x7fffffffffffffffffffffffffffffffffffffffffff0000000000 + PUSH 0x7fffffffffffffffffffffffffffffffffffffffffff000000000000 + PUSH 0x7fffffffffffffffffffffffffffffffffffffffffff00000000000000 + PUSH 0x7fffffffffffffffffffffffffffffffffffffffffff0000000000000000 + PUSH 0x7fffffffffffffffffffffffffffffffffffffffffff000000000000000000 + PUSH 0xfffffffffffffffffffffffffffffffffffffffffffe00000000000000000000 + // masks with 200 bits + PUSH 0xffffffffffffffffffffffffffffffffffffffffffffffffff + PUSH 0x1fffffffffffffffffffffffffffffffffffffffffffffffffe0 + PUSH 0x7fffffffffffffffffffffffffffffffffffffffffffffffff800 + PUSH 0xffffffffffffffffffffffffffffffffffffffffffffffffff0000 + PUSH 0x3fffffffffffffffffffffffffffffffffffffffffffffffffc00000 + PUSH 0xffffffffffffffffffffffffffffffffffffffffffffffffff0000000 + PUSH 0x1fffffffffffffffffffffffffffffffffffffffffffffffffe00000000 + PUSH 0x7fffffffffffffffffffffffffffffffffffffffffffffffff8000000000 + PUSH 0xffffffffffffffffffffffffffffffffffffffffffffffffff00000000000 + PUSH 0x3fffffffffffffffffffffffffffffffffffffffffffffffffc000000000000 + PUSH 0xffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000 + // masks with 255 bits + PUSH 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + PUSH 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe + // masks with 256 bits + PUSH 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + // powers of 10 + PUSH 0xa + PUSH 0x64 + PUSH 0x3e8 + PUSH 0x2710 + PUSH 0x186a0 + PUSH 0xf4240 + PUSH 0x989680 + PUSH 0x5f5e100 + PUSH 0x3b9aca00 + PUSH 0x2540be400 + PUSH 0x174876e800 + PUSH 0xe8d4a51000 + PUSH 0x9184e72a000 + PUSH 0x5af3107a4000 + PUSH 0x38d7ea4c68000 + PUSH 0x2386f26fc10000 + PUSH 0x16345785d8a0000 + PUSH 0xde0b6b3a7640000 + PUSH 0x8ac7230489e80000 + PUSH 0x56bc75e2d63100000 + PUSH 0x3635c9adc5dea00000 + PUSH 0x21e19e0c9bab2400000 + PUSH 0x152d02c7e14af6800000 + PUSH 0xd3c21bcecceda1000000 + PUSH 0x84595161401484a000000 + PUSH 0x52b7d2dcc80cd2e4000000 + PUSH 0x33b2e3c9fd0803ce8000000 + PUSH 0x204fce5e3e25026110000000 + PUSH 0x1431e0fae6d7217caa0000000 + PUSH 0xc9f2c9cd04674edea40000000 + PUSH 0x7e37be2022c0914b2680000000 + PUSH 0x4ee2d6d415b85acef8100000000 + PUSH 0x314dc6448d9338c15b0a00000000 + PUSH 0x1ed09bead87c0378d8e6400000000 + PUSH 0x13426172c74d822b878fe800000000 + PUSH 0xc097ce7bc90715b34b9f1000000000 + PUSH 0x785ee10d5da46d900f436a000000000 + PUSH 0x4b3b4ca85a86c47a098a224000000000 + PUSH 0x2f050fe938943acc45f65568000000000 + PUSH 0x1d6329f1c35ca4bfabb9f5610000000000 + PUSH 0x125dfa371a19e6f7cb54395ca0000000000 + PUSH 0xb7abc627050305adf14a3d9e40000000000 + PUSH 0x72cb5bd86321e38cb6ce6682e80000000000 + PUSH 0x47bf19673df52e37f2410011d100000000000 + PUSH 0x2cd76fe086b93ce2f768a00b22a00000000000 + PUSH 0x1c06a5ec5433c60ddaa16406f5a400000000000 + PUSH 0x118427b3b4a05bc8a8a4de845986800000000000 + PUSH 0xaf298d050e4395d69670b12b7f41000000000000 + PUSH 0x6d79f82328ea3da61e066ebb2f88a000000000000 + PUSH 0x446c3b15f9926687d2c40534fdb564000000000000 + PUSH 0x2ac3a4edbbfb8014e3ba83411e915e8000000000000 + PUSH 0x1aba4714957d300d0e549208b31adb10000000000000 + PUSH 0x10b46c6cdd6e3e0828f4db456ff0c8ea0000000000000 + PUSH 0xa70c3c40a64e6c51999090b65f67d9240000000000000 + PUSH 0x6867a5a867f103b2fffa5a71fba0e7b680000000000000 + PUSH 0x4140c78940f6a24fdffc78873d4490d2100000000000000 + PUSH 0x28c87cb5c89a2571ebfdcb54864ada834a00000000000000 + PUSH 0x197d4df19d605767337e9f14d3eec8920e400000000000000 + PUSH 0xfee50b7025c36a0802f236d04753d5b48e800000000000000 + PUSH 0x9f4f2726179a224501d762422c946590d91000000000000000 + PUSH 0x63917877cec0556b21269d695bdcbf7a87aa000000000000000 + PUSH 0x3e3aeb4ae1383562f4b82261d969f7ac94ca4000000000000000 + PUSH 0x26e4d30eccc3215dd8f3157d27e23acbdcfe68000000000000000 + PUSH 0x184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000 + PUSH 0xf316271c7fc3908a8bef464e3945ef7a25360a0000000000000000 + PUSH 0x97edd871cfda3a5697758bf0e3cbb5ac5741c640000000000000000 + PUSH 0x5ef4a74721e864761ea977768e5f518bb6891be80000000000000000 + PUSH 0x3b58e88c75313ec9d329eaaa18fb92f75215b17100000000000000000 + PUSH 0x25179157c93ec73e23fa32aa4f9d3bda934d8ee6a00000000000000000 + PUSH 0x172ebad6ddc73c86d67c5faa71c245689c1079502400000000000000000 + PUSH 0xe7d34c64a9c85d4460dbbca87196b61618a4bd216800000000000000000 + PUSH 0x90e40fbeea1d3a4abc8955e946fe31cdcf66f634e1000000000000000000 + PUSH 0x5a8e89d75252446eb5d5d5b1cc5edf20a1a059e10ca000000000000000000 + PUSH 0x3899162693736ac531a5a58f1fbb4b746504382ca7e4000000000000000000 + PUSH 0x235fadd81c2822bb3f07877973d50f28bf22a31be8ee8000000000000000000 + PUSH 0x161bcca7119915b50764b4abe86529797775a5f1719510000000000000000000 + PUSH 0xdd15fe86affad91249ef0eb713f39ebeaa987b6e6fd2a0000000000000000000 + // powers of 10 multiplied by ffffffffffffffff + PUSH 0x9fffffffffffffff6 + PUSH 0x63ffffffffffffff9c + PUSH 0x3e7fffffffffffffc18 + PUSH 0x270fffffffffffffd8f0 + PUSH 0x1869ffffffffffffe7960 + PUSH 0xf423ffffffffffff0bdc0 + PUSH 0x98967fffffffffff676980 + PUSH 0x5f5e0fffffffffffa0a1f00 + PUSH 0x3b9ac9ffffffffffc4653600 + PUSH 0x2540be3fffffffffdabf41c00 + PUSH 0x174876e7ffffffffe8b7891800 + PUSH 0xe8d4a50fffffffff172b5af000 + PUSH 0x9184e729ffffffff6e7b18d6000 + PUSH 0x5af3107a3fffffffa50cef85c000 + PUSH 0x38d7ea4c67ffffffc72815b398000 + PUSH 0x2386f26fc0ffffffdc790d903f0000 + PUSH 0x16345785d89fffffe9cba87a2760000 + PUSH 0xde0b6b3a763fffff21f494c589c0000 + PUSH 0x8ac7230489e7ffff7538dcfb76180000 + PUSH 0x56bc75e2d630ffffa9438a1d29cf00000 + PUSH 0x3635c9adc5de9fffc9ca36523a21600000 + PUSH 0x21e19e0c9bab23ffde1e61f36454dc00000 + PUSH 0x152d02c7e14af67fead2fd381eb509800000 + PUSH 0xd3c21bcecceda0ff2c3de43133125f000000 + PUSH 0x845951614014849f7ba6ae9ebfeb7b6000000 + PUSH 0x52b7d2dcc80cd2e3ad482d2337f32d1c000000 + PUSH 0x33b2e3c9fd0803ce4c4d1c3602f7fc318000000 + PUSH 0x204fce5e3e250260efb031a1c1dafd9ef0000000 + PUSH 0x1431e0fae6d7217c95ce1f051928de83560000000 + PUSH 0xc9f2c9cd04674eddda0d3632fb98b1215c0000000 + PUSH 0x7e37be2022c0914aa84841dfdd3f6eb4d980000000 + PUSH 0x4ee2d6d415b85acea92d292bea47a53107f00000000 + PUSH 0x314dc6448d9338c129bc39bb726cc73ea4f600000000 + PUSH 0x1ed09bead87c0378ba15a4152783fc872719c00000000 + PUSH 0x13426172c74d822b744d868d38b27dd478701800000000 + PUSH 0xc097ce7bc90715b28b07418436f8ea4cb460f000000000 + PUSH 0x785ee10d5da46d8f96e488f2a25b926ff0bc96000000000 + PUSH 0x4b3b4ca85a86c479be4ed597a5793b85f675ddc000000000 + PUSH 0x2f050fe938943acc16f1457ec76bc533ba09aa98000000000 + PUSH 0x1d6329f1c35ca4bf8e56cb6f3ca35b4054460a9f0000000000 + PUSH 0x125dfa371a19e6f7b8f63f2585e6190834abc6a360000000000 + PUSH 0xb7abc627050305ad399e77773afcfa520eb5c261c0000000000 + PUSH 0x72cb5bd86321e38c44030aaa84de1c734931997d180000000000 + PUSH 0x47bf19673df52e37aa81e6aa930ad1c80dbeffee2f00000000000 + PUSH 0x2cd76fe086b93ce2ca91302a9be6c31d08975ff4dd600000000000 + PUSH 0x1c06a5ec5433c60dbe9abe1aa17039f2255e9bf90a5c00000000000 + PUSH 0x118427b3b4a05bc89720b6d0a4e62437575b217ba679800000000000 + PUSH 0xaf298d050e4395d5e747242670fd6a29698f4ed480bf000000000000 + PUSH 0x6d79f82328ea3da5b08c7698069e6259e1f99144d0776000000000000 + PUSH 0x446c3b15f99266878e57ca1f0422fd782d3bfacb024a9c000000000000 + PUSH 0x2ac3a4edbbfb8014b8f6de536295de6b1c457cbee16ea18000000000000 + PUSH 0x1aba4714957d300cf39a4af41d9dab02f1ab6df74ce524f0000000000000 + PUSH 0x10b46c6cdd6e3e0818406ed892828ae1d70b24ba900f37160000000000000 + PUSH 0xa70c3c40a64e6c50f2845475b9196cd2666f6f49a09826dc0000000000000 + PUSH 0x6867a5a867f103b29792b4c993afe4038005a58e045f184980000000000000 + PUSH 0x4140c78940f6a24f9ebbb0fdfc4dee8230038778c2bb6f2df00000000000000 + PUSH 0x28c87cb5c89a2571c3354e9ebdb0b5115e0234ab79b5257cb600000000000000 +// ==== +// optimizationPreset: none +// optimizer.constantOptimizer: true +// optimizer.expectedExecutionsPerDeployment: 2000000 +// outputs: Assembly +// ---- +// Assembly: +// 0x02 +// stop +// +// sub_0: assembly { +// 0x01 +// 0x01 +// 0x02000000 +// 0x08000000000000 +// 0x10000000000000000000 +// 0x40000000000000000000000000 +// 0x80000000000000000000000000000000 +// 0x0200000000000000000000000000000000000000 +// 0x0400000000000000000000000000000000000000000000 +// 0x1000000000000000000000000000000000000000000000000000 +// 0x2000000000000000000000000000000000000000000000000000000000 +// 0x8000000000000000000000000000000000000000000000000000000000000000 +// 0x03 +// 0x06000000 +// 0x0c000000000000 +// 0x30000000000000000000 +// 0x60000000000000000000000000 +// 0x0180000000000000000000000000000000 +// 0x0300000000000000000000000000000000000000 +// 0x0600000000000000000000000000000000000000000000 +// 0x1800000000000000000000000000000000000000000000000000 +// 0x3000000000000000000000000000000000000000000000000000000000 +// 0xc000000000000000000000000000000000000000000000000000000000000000 +// 0x07 +// 0x0e000000 +// 0x1c000000000000 +// 0x38000000000000000000 +// 0xe0000000000000000000000000 +// 0x01c0000000000000000000000000000000 +// 0x0380000000000000000000000000000000000000 +// 0x0e00000000000000000000000000000000000000000000 +// 0x1c00000000000000000000000000000000000000000000000000 +// 0x3800000000000000000000000000000000000000000000000000000000 +// 0xe000000000000000000000000000000000000000000000000000000000000000 +// 0x0f +// 0x1e000000 +// 0x3c000000000000 +// 0x78000000000000000000 +// 0xf0000000000000000000000000 +// 0x03c0000000000000000000000000000000 +// 0x0780000000000000000000000000000000000000 +// 0x0f00000000000000000000000000000000000000000000 +// 0x1e00000000000000000000000000000000000000000000000000 +// 0x3c00000000000000000000000000000000000000000000000000000000 +// 0xf000000000000000000000000000000000000000000000000000000000000000 +// 0x7f +// 0x7f000000 +// 0xfe000000000000 +// 0x01fc000000000000000000 +// 0x03f8000000000000000000000000 +// 0x07f0000000000000000000000000000000 +// 0x0fe0000000000000000000000000000000000000 +// 0x1fc0000000000000000000000000000000000000000000 +// 0x3f80000000000000000000000000000000000000000000000000 +// 0x7f00000000000000000000000000000000000000000000000000000000 +// 0xfe00000000000000000000000000000000000000000000000000000000000000 +// 0xff +// 0xff000000 +// 0x01fe000000000000 +// 0x03fc000000000000000000 +// 0x07f8000000000000000000000000 +// 0x0ff0000000000000000000000000000000 +// 0x0ff0000000000000000000000000000000000000 +// 0x1fe0000000000000000000000000000000000000000000 +// 0x3fc0000000000000000000000000000000000000000000000000 +// 0x7f80000000000000000000000000000000000000000000000000000000 +// 0xff00000000000000000000000000000000000000000000000000000000000000 +// 0xffff +// 0xffff000000 +// 0xffff000000000000 +// 0xffff000000000000000000 +// 0xffff000000000000000000000000 +// 0xffff000000000000000000000000000000 +// 0xffff000000000000000000000000000000000000 +// 0xffff000000000000000000000000000000000000000000 +// 0xffff000000000000000000000000000000000000000000000000 +// 0xffff000000000000000000000000000000000000000000000000000000 +// 0xffff000000000000000000000000000000000000000000000000000000000000 +// 0x7fffff +// 0x3fffff800000 +// 0x1fffffc00000000000 +// 0x0fffffe00000000000000000 +// 0x0fffffe00000000000000000000000 +// 0x07fffff00000000000000000000000000000 +// 0x03fffff80000000000000000000000000000000000 +// 0x03fffff80000000000000000000000000000000000000000 +// 0x01fffffc0000000000000000000000000000000000000000000000 +// 0xfffffe0000000000000000000000000000000000000000000000000000 +// 0xfffffe0000000000000000000000000000000000000000000000000000000000 +// 0xffffffff +// 0x3fffffffc00000 +// 0x0ffffffff00000000000 +// 0x07fffffff80000000000000000 +// 0x01fffffffe0000000000000000000000 +// 0xffffffff0000000000000000000000000000 +// 0x3fffffffc000000000000000000000000000000000 +// 0x0ffffffff000000000000000000000000000000000000000 +// 0x07fffffff800000000000000000000000000000000000000000000 +// 0x01fffffffe00000000000000000000000000000000000000000000000000 +// 0xffffffff00000000000000000000000000000000000000000000000000000000 +// 0x7fffffffffff +// 0x07fffffffffff00000 +// 0xfffffffffffe0000000000 +// 0x1fffffffffffc000000000000000 +// 0x03fffffffffff800000000000000000000 +// 0x7fffffffffff00000000000000000000000000 +// 0x0fffffffffffe0000000000000000000000000000000 +// 0x01fffffffffffc000000000000000000000000000000000000 +// 0x3fffffffffff800000000000000000000000000000000000000000 +// 0x07fffffffffff00000000000000000000000000000000000000000000000 +// 0xfffffffffffe0000000000000000000000000000000000000000000000000000 +// 0xffffffffffffffff +// 0x07fffffffffffffff80000 +// 0x3fffffffffffffffc000000000 +// 0x01fffffffffffffffe00000000000000 +// 0x0ffffffffffffffff0000000000000000000 +// 0xffffffffffffffff000000000000000000000000 +// 0x07fffffffffffffff80000000000000000000000000000 +// 0x3fffffffffffffffc000000000000000000000000000000000 +// 0x01fffffffffffffffe00000000000000000000000000000000000000 +// 0x0ffffffffffffffff0000000000000000000000000000000000000000000 +// 0xffffffffffffffff000000000000000000000000000000000000000000000000 +// 0x0fffffffffffffffffffffff +// 0x0fffffffffffffffffffffff0000 +// 0x0fffffffffffffffffffffff00000000 +// 0x1ffffffffffffffffffffffe000000000000 +// 0x1ffffffffffffffffffffffe0000000000000000 +// 0x3ffffffffffffffffffffffc00000000000000000000 +// 0x3ffffffffffffffffffffffc000000000000000000000000 +// 0x3ffffffffffffffffffffffc0000000000000000000000000000 +// 0x7ffffffffffffffffffffff800000000000000000000000000000000 +// 0x7ffffffffffffffffffffff8000000000000000000000000000000000000 +// 0xfffffffffffffffffffffff00000000000000000000000000000000000000000 +// 0x7fffffffffffffffffffffffff +// 0x3fffffffffffffffffffffffff8000 +// 0x1fffffffffffffffffffffffffc0000000 +// 0x0fffffffffffffffffffffffffe00000000000 +// 0x0fffffffffffffffffffffffffe000000000000000 +// 0x07fffffffffffffffffffffffff0000000000000000000 +// 0x03fffffffffffffffffffffffff80000000000000000000000 +// 0x03fffffffffffffffffffffffff800000000000000000000000000 +// 0x01fffffffffffffffffffffffffc000000000000000000000000000000 +// 0xfffffffffffffffffffffffffe0000000000000000000000000000000000 +// 0xfffffffffffffffffffffffffe00000000000000000000000000000000000000 +// 0xffffffffffffffffffffffffffffffff +// 0x0ffffffffffffffffffffffffffffffff000 +// 0x01fffffffffffffffffffffffffffffffe000000 +// 0x3fffffffffffffffffffffffffffffffc000000000 +// 0x07fffffffffffffffffffffffffffffff8000000000000 +// 0xffffffffffffffffffffffffffffffff0000000000000000 +// 0x0ffffffffffffffffffffffffffffffff0000000000000000000 +// 0x01fffffffffffffffffffffffffffffffe0000000000000000000000 +// 0x3fffffffffffffffffffffffffffffffc0000000000000000000000000 +// 0x07fffffffffffffffffffffffffffffff80000000000000000000000000000 +// 0xffffffffffffffffffffffffffffffff00000000000000000000000000000000 +// 0x1fffffffffffffffffffffffffffffffff +// 0x01fffffffffffffffffffffffffffffffff000 +// 0x1fffffffffffffffffffffffffffffffff000000 +// 0x01fffffffffffffffffffffffffffffffff000000000 +// 0x3ffffffffffffffffffffffffffffffffe000000000000 +// 0x03ffffffffffffffffffffffffffffffffe000000000000000 +// 0x3ffffffffffffffffffffffffffffffffe000000000000000000 +// 0x07ffffffffffffffffffffffffffffffffc000000000000000000000 +// 0x7ffffffffffffffffffffffffffffffffc000000000000000000000000 +// 0x07ffffffffffffffffffffffffffffffffc000000000000000000000000000 +// 0xfffffffffffffffffffffffffffffffff8000000000000000000000000000000 +// 0xffffffffffffffffffffffffffffffffffffffff +// 0x01fffffffffffffffffffffffffffffffffffffffe00 +// 0x07fffffffffffffffffffffffffffffffffffffff80000 +// 0x0ffffffffffffffffffffffffffffffffffffffff0000000 +// 0x3fffffffffffffffffffffffffffffffffffffffc000000000 +// 0xffffffffffffffffffffffffffffffffffffffff000000000000 +// 0x01fffffffffffffffffffffffffffffffffffffffe00000000000000 +// 0x07fffffffffffffffffffffffffffffffffffffff80000000000000000 +// 0x0ffffffffffffffffffffffffffffffffffffffff0000000000000000000 +// 0x3fffffffffffffffffffffffffffffffffffffffc000000000000000000000 +// 0xffffffffffffffffffffffffffffffffffffffff000000000000000000000000 +// 0x7fffffffffffffffffffffffffffffffffffffffffff +// 0x7fffffffffffffffffffffffffffffffffffffffffff00 +// 0x7fffffffffffffffffffffffffffffffffffffffffff0000 +// 0x7fffffffffffffffffffffffffffffffffffffffffff000000 +// 0x7fffffffffffffffffffffffffffffffffffffffffff00000000 +// 0x7fffffffffffffffffffffffffffffffffffffffffff0000000000 +// 0x7fffffffffffffffffffffffffffffffffffffffffff000000000000 +// 0x7fffffffffffffffffffffffffffffffffffffffffff00000000000000 +// 0x7fffffffffffffffffffffffffffffffffffffffffff0000000000000000 +// 0x7fffffffffffffffffffffffffffffffffffffffffff000000000000000000 +// 0xfffffffffffffffffffffffffffffffffffffffffffe00000000000000000000 +// 0xffffffffffffffffffffffffffffffffffffffffffffffffff +// 0x1fffffffffffffffffffffffffffffffffffffffffffffffffe0 +// 0x07fffffffffffffffffffffffffffffffffffffffffffffffff800 +// 0xffffffffffffffffffffffffffffffffffffffffffffffffff0000 +// 0x3fffffffffffffffffffffffffffffffffffffffffffffffffc00000 +// 0x0ffffffffffffffffffffffffffffffffffffffffffffffffff0000000 +// 0x01fffffffffffffffffffffffffffffffffffffffffffffffffe00000000 +// 0x7fffffffffffffffffffffffffffffffffffffffffffffffff8000000000 +// 0x0ffffffffffffffffffffffffffffffffffffffffffffffffff00000000000 +// 0x03fffffffffffffffffffffffffffffffffffffffffffffffffc000000000000 +// 0xffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000 +// 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +// 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe +// 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff +// 0x0a +// 0x64 +// 0x03e8 +// 0x2710 +// 0x0186a0 +// 0x0f4240 +// 0x989680 +// 0x05f5e100 +// 0x3b9aca00 +// 0x02540be400 +// 0x174876e800 +// 0xe8d4a51000 +// 0x09184e72a000 +// 0x5af3107a4000 +// 0x038d7ea4c68000 +// 0x2386f26fc10000 +// 0x016345785d8a0000 +// 0x0de0b6b3a7640000 +// 0x8ac7230489e80000 +// 0x056bc75e2d63100000 +// 0x3635c9adc5dea00000 +// 0x021e19e0c9bab2400000 +// 0x152d02c7e14af6800000 +// 0xd3c21bcecceda1000000 +// 0x084595161401484a000000 +// 0x52b7d2dcc80cd2e4000000 +// 0x033b2e3c9fd0803ce8000000 +// 0x204fce5e3e25026110000000 +// 0x01431e0fae6d7217caa0000000 +// 0x0c9f2c9cd04674edea40000000 +// 0x7e37be2022c0914b2680000000 +// 0x04ee2d6d415b85acef8100000000 +// 0x314dc6448d9338c15b0a00000000 +// 0x01ed09bead87c0378d8e6400000000 +// 0x13426172c74d822b878fe800000000 +// 0xc097ce7bc90715b34b9f1000000000 +// 0x0785ee10d5da46d900f436a000000000 +// 0x4b3b4ca85a86c47a098a224000000000 +// 0x02f050fe938943acc45f65568000000000 +// 0x1d6329f1c35ca4bfabb9f5610000000000 +// 0x0125dfa371a19e6f7cb54395ca0000000000 +// 0x0b7abc627050305adf14a3d9e40000000000 +// 0x72cb5bd86321e38cb6ce6682e80000000000 +// 0x047bf19673df52e37f2410011d100000000000 +// 0x2cd76fe086b93ce2f768a00b22a00000000000 +// 0x01c06a5ec5433c60ddaa16406f5a400000000000 +// 0x118427b3b4a05bc8a8a4de845986800000000000 +// 0xaf298d050e4395d69670b12b7f41000000000000 +// 0x06d79f82328ea3da61e066ebb2f88a000000000000 +// 0x446c3b15f9926687d2c40534fdb564000000000000 +// 0x02ac3a4edbbfb8014e3ba83411e915e8000000000000 +// 0x1aba4714957d300d0e549208b31adb10000000000000 +// 0x010b46c6cdd6e3e0828f4db456ff0c8ea0000000000000 +// 0x0a70c3c40a64e6c51999090b65f67d9240000000000000 +// 0x6867a5a867f103b2fffa5a71fba0e7b680000000000000 +// 0x04140c78940f6a24fdffc78873d4490d2100000000000000 +// 0x28c87cb5c89a2571ebfdcb54864ada834a00000000000000 +// 0x0197d4df19d605767337e9f14d3eec8920e400000000000000 +// 0x0fee50b7025c36a0802f236d04753d5b48e800000000000000 +// 0x9f4f2726179a224501d762422c946590d91000000000000000 +// 0x063917877cec0556b21269d695bdcbf7a87aa000000000000000 +// 0x3e3aeb4ae1383562f4b82261d969f7ac94ca4000000000000000 +// 0x026e4d30eccc3215dd8f3157d27e23acbdcfe68000000000000000 +// 0x184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000 +// 0xf316271c7fc3908a8bef464e3945ef7a25360a0000000000000000 +// 0x097edd871cfda3a5697758bf0e3cbb5ac5741c640000000000000000 +// 0x5ef4a74721e864761ea977768e5f518bb6891be80000000000000000 +// 0x03b58e88c75313ec9d329eaaa18fb92f75215b17100000000000000000 +// 0x25179157c93ec73e23fa32aa4f9d3bda934d8ee6a00000000000000000 +// 0x0172ebad6ddc73c86d67c5faa71c245689c1079502400000000000000000 +// 0x0e7d34c64a9c85d4460dbbca87196b61618a4bd216800000000000000000 +// 0x90e40fbeea1d3a4abc8955e946fe31cdcf66f634e1000000000000000000 +// 0x05a8e89d75252446eb5d5d5b1cc5edf20a1a059e10ca000000000000000000 +// 0x3899162693736ac531a5a58f1fbb4b746504382ca7e4000000000000000000 +// 0x0235fadd81c2822bb3f07877973d50f28bf22a31be8ee8000000000000000000 +// 0x161bcca7119915b50764b4abe86529797775a5f1719510000000000000000000 +// 0xdd15fe86affad91249ef0eb713f39ebeaa987b6e6fd2a0000000000000000000 +// 0x09fffffffffffffff6 +// 0x63ffffffffffffff9c +// 0x03e7fffffffffffffc18 +// 0x270fffffffffffffd8f0 +// 0x01869ffffffffffffe7960 +// 0x0f423ffffffffffff0bdc0 +// 0x98967fffffffffff676980 +// 0x05f5e0fffffffffffa0a1f00 +// 0x3b9ac9ffffffffffc4653600 +// 0x02540be3fffffffffdabf41c00 +// 0x174876e7ffffffffe8b7891800 +// 0xe8d4a50fffffffff172b5af000 +// 0x09184e729ffffffff6e7b18d6000 +// 0x5af3107a3fffffffa50cef85c000 +// 0x038d7ea4c67ffffffc72815b398000 +// 0x2386f26fc0ffffffdc790d903f0000 +// 0x016345785d89fffffe9cba87a2760000 +// 0x0de0b6b3a763fffff21f494c589c0000 +// 0x8ac7230489e7ffff7538dcfb76180000 +// 0x056bc75e2d630ffffa9438a1d29cf00000 +// 0x3635c9adc5de9fffc9ca36523a21600000 +// 0x021e19e0c9bab23ffde1e61f36454dc00000 +// 0x152d02c7e14af67fead2fd381eb509800000 +// 0xd3c21bcecceda0ff2c3de43133125f000000 +// 0x0845951614014849f7ba6ae9ebfeb7b6000000 +// 0x52b7d2dcc80cd2e3ad482d2337f32d1c000000 +// 0x033b2e3c9fd0803ce4c4d1c3602f7fc318000000 +// 0x204fce5e3e250260efb031a1c1dafd9ef0000000 +// 0x01431e0fae6d7217c95ce1f051928de83560000000 +// 0x0c9f2c9cd04674eddda0d3632fb98b1215c0000000 +// 0x7e37be2022c0914aa84841dfdd3f6eb4d980000000 +// 0x04ee2d6d415b85acea92d292bea47a53107f00000000 +// 0x314dc6448d9338c129bc39bb726cc73ea4f600000000 +// 0x01ed09bead87c0378ba15a4152783fc872719c00000000 +// 0x13426172c74d822b744d868d38b27dd478701800000000 +// 0xc097ce7bc90715b28b07418436f8ea4cb460f000000000 +// 0x0785ee10d5da46d8f96e488f2a25b926ff0bc96000000000 +// 0x4b3b4ca85a86c479be4ed597a5793b85f675ddc000000000 +// 0x02f050fe938943acc16f1457ec76bc533ba09aa98000000000 +// 0x1d6329f1c35ca4bf8e56cb6f3ca35b4054460a9f0000000000 +// 0x0125dfa371a19e6f7b8f63f2585e6190834abc6a360000000000 +// 0x0b7abc627050305ad399e77773afcfa520eb5c261c0000000000 +// 0x72cb5bd86321e38c44030aaa84de1c734931997d180000000000 +// 0x047bf19673df52e37aa81e6aa930ad1c80dbeffee2f00000000000 +// 0x2cd76fe086b93ce2ca91302a9be6c31d08975ff4dd600000000000 +// 0x01c06a5ec5433c60dbe9abe1aa17039f2255e9bf90a5c00000000000 +// 0x118427b3b4a05bc89720b6d0a4e62437575b217ba679800000000000 +// 0xaf298d050e4395d5e747242670fd6a29698f4ed480bf000000000000 +// 0x06d79f82328ea3da5b08c7698069e6259e1f99144d0776000000000000 +// 0x446c3b15f99266878e57ca1f0422fd782d3bfacb024a9c000000000000 +// 0x02ac3a4edbbfb8014b8f6de536295de6b1c457cbee16ea18000000000000 +// 0x1aba4714957d300cf39a4af41d9dab02f1ab6df74ce524f0000000000000 +// 0x010b46c6cdd6e3e0818406ed892828ae1d70b24ba900f37160000000000000 +// 0x0a70c3c40a64e6c50f2845475b9196cd2666f6f49a09826dc0000000000000 +// 0x6867a5a867f103b29792b4c993afe4038005a58e045f184980000000000000 +// 0x04140c78940f6a24f9ebbb0fdfc4dee8230038778c2bb6f2df00000000000000 +// 0x28c87cb5c89a2571c3354e9ebdb0b5115e0234ab79b5257cb600000000000000 +// } From 5da33151f261f3313200fdc23d8c2f38f38759a0 Mon Sep 17 00:00:00 2001 From: Mohammad Rezaei Date: Wed, 23 Apr 2025 17:15:01 -0400 Subject: [PATCH 2/7] constant optimizer: a semantic test Mask generator optimizations --- Changelog.md | 1 + libevmasm/ConstantOptimiser.cpp | 42 +- .../optimizer_BlockDeDuplicator/output | 4 +- .../output | 2 +- .../output | 4 +- .../output.json | 8 +- .../viair_subobject_optimization/output | 4 +- .../constant_optimizer_runs_0.asm | 436 +++++++++--------- .../constant_optimizer_runs_200.asm | 166 +++---- ...tings_optimizer_constant_optimizer.asmjson | 8 +- ...expected_executions_per_deployment.asmjson | 6 +- test/libsolidity/gasTests/abiv2_optimised.sol | 6 +- .../abicoder/abi_encode_calldata_slice.sol | 8 +- .../semanticTests/abicoder/abi_encode_v2.sol | 4 +- ...2_in_function_inherited_in_v1_contract.sol | 6 +- .../copy_from_calldata_removes_bytes_data.sol | 2 +- .../array/byte_array_transitional_2.sol | 2 +- .../array_of_struct_memory_to_storage.sol | 2 +- .../array_storage_multi_items_per_slot.sol | 4 +- .../copying/calldata_array_to_mapping.sol | 2 +- .../array/copying/storage_memory_nested.sol | 4 +- .../storage_memory_nested_from_pointer.sol | 4 +- .../copying/storage_memory_nested_struct.sol | 2 +- .../array/create_memory_array.sol | 4 +- .../array/fixed_arrays_as_return_type.sol | 4 +- .../array/fixed_arrays_in_constructors.sol | 8 +- .../array/function_array_cross_calls.sol | 8 +- .../pop/byte_array_pop_long_storage_empty.sol | 4 +- .../push/array_push_struct_from_calldata.sol | 2 +- .../array/push/byte_array_push_transition.sol | 2 +- .../semanticTests/array/reusing_memory.sol | 4 +- .../semanticTests/constants/mask_tests.sol | 78 ++++ .../constructor_arguments_external.sol | 8 +- .../constructor/no_callvalue_check.sol | 2 +- .../errors/small_error_optimization.sol | 4 +- .../events/event_emit_from_other_contract.sol | 8 +- .../creation_function_call_with_args.sol | 8 +- .../creation_function_call_with_salt.sol | 8 +- .../external_call_to_nonexisting.sol | 8 +- ...ernal_call_to_nonexisting_debugstrings.sol | 10 +- .../functionCall/failed_create.sol | 4 +- .../functionCall/gas_and_value_basic.sol | 8 +- .../functionTypes/store_function.sol | 2 +- .../immutable/immutable_tag_too_large_bug.sol | 4 +- .../immutable/multi_creation.sol | 4 +- .../semanticTests/immutable/use_scratch.sol | 2 +- .../inheritance/constructor_with_params.sol | 2 +- ...ructor_with_params_diamond_inheritance.sol | 2 +- .../constructor_with_params_inheritance.sol | 2 +- ...ted_function_calldata_memory_interface.sol | 4 +- .../inheritance/value_for_constructor.sol | 8 +- .../transient_storage_selfdestruct.sol | 12 +- .../libraries/internal_types_in_library.sol | 2 +- .../operator_making_pure_external_call.sol | 8 +- .../operator_making_view_external_call.sol | 8 +- .../saltedCreate/salted_create_with_value.sol | 4 +- .../semanticTests/smoke/constructor.sol | 2 +- .../storage/packed_storage_structs_bytes.sol | 4 +- .../storageLayoutSpecifier/constructor.sol | 2 +- .../storage_reference_array.sol | 2 +- .../conversion/recursive_storage_memory.sol | 2 +- .../structs/memory_structs_nested_load.sol | 4 +- ...ata_to_storage_nested_dynamic_array_v2.sol | 4 +- .../struct_memory_to_storage_function_ptr.sol | 4 +- .../semanticTests/structs/structs.sol | 4 +- .../userDefinedValueType/erc20.sol | 8 +- .../various/different_call_type_transient.sol | 4 +- .../semanticTests/various/erc20.sol | 8 +- .../various/many_subassemblies.sol | 2 +- .../various/selfdestruct_post_cancun.sol | 8 +- ...uct_post_cancun_multiple_beneficiaries.sol | 16 +- .../selfdestruct_post_cancun_redeploy.sol | 14 +- .../semanticTests/various/senders_balance.sol | 8 +- .../various/staticcall_for_view_and_pure.sol | 2 +- .../viaYul/copy_struct_invalid_ir_bug.sol | 4 +- ...identical_subobjects_creation_deployed.yul | 15 +- 76 files changed, 605 insertions(+), 485 deletions(-) create mode 100644 test/libsolidity/semanticTests/constants/mask_tests.sol diff --git a/Changelog.md b/Changelog.md index 5112c051c4b2..84d2915270d7 100644 --- a/Changelog.md +++ b/Changelog.md @@ -96,6 +96,7 @@ Compiler Features: * EVM: Set default EVM Version to `prague`. * NatSpec: Capture Natspec documentation of `enum` values in the AST. +* Constant Optimizer: Compute masks using shifts when optimizing for size; use an ``--optimizer-runs`` value less than 200 for maximum size reduction. Bugfixes: * SMTChecker: Do not consider loop conditions as constant-condition verification target as this could cause incorrect reports and internal compiler errors. diff --git a/libevmasm/ConstantOptimiser.cpp b/libevmasm/ConstantOptimiser.cpp index 7cf00fc9ed41..467c84170ea5 100644 --- a/libevmasm/ConstantOptimiser.cpp +++ b/libevmasm/ConstantOptimiser.cpp @@ -253,7 +253,47 @@ AssemblyItems ComputeMethod::findRepresentation(u256 const& _value) if (_value < 0x10000) // Very small value, not worth computing return AssemblyItems{_value}; - else if (numberEncodingSize(~_value) < numberEncodingSize(_value)) + + // check for masks first + unsigned lowZeros = 0; + unsigned highOnes = 0; + for (; ((_value >> lowZeros) & 1) == 0 && lowZeros < 256; lowZeros++) {} + for (; ((_value >> (lowZeros + highOnes)) & 1) == 1 && highOnes < 256; highOnes++) {} + if (m_params.evmVersion.hasBitwiseShifting() && highOnes > 32 && + ((_value >> (lowZeros + highOnes)) == 0) && + ((lowZeros + highOnes < 256) || lowZeros > 16)) + { + // this is a big enough mask to use zero negation + AssemblyItems newRoutine = AssemblyItems{u256(0), Instruction::NOT}; + if ((highOnes + lowZeros) != 256) + newRoutine += AssemblyItems{u256(256 - highOnes), Instruction::SHR}; + if (lowZeros > 0) + newRoutine += AssemblyItems{u256(lowZeros), Instruction::SHL}; + return newRoutine; + } + // check powers of 10 + u256 divBy10 = _value; + unsigned pow10 = 0; + while (divBy10 > 0 && divBy10 % 10 == 0) + { + divBy10 = divBy10 / 10; + pow10++; + } + // 10^9 = 0x3b9aca00; requires 5 bytes with PUSH4; also 5 bytes with PUSH 5 PUSH 10 EXP + if (pow10 > 9 && divBy10 == 1) + { + // pure power of 10 + return AssemblyItems{u256(pow10), u256(10), Instruction::EXP}; + } + // 10^x * y can be encoded as: push x push 10 exp push y mul. That's about 7 bytes more than plain push + if (pow10 > 12) + { + AssemblyItems newRoutine = findRepresentation(divBy10); + newRoutine += AssemblyItems{u256(pow10), u256(10), Instruction::EXP, Instruction::MUL}; + return newRoutine; + } + if (numberEncodingSize(~_value) < numberEncodingSize(_value) && + (lowZeros+highOnes < 256 || highOnes > 16)) // Negated is shorter to represent return findRepresentation(~_value) + AssemblyItems{Instruction::NOT}; else diff --git a/test/cmdlineTests/optimizer_BlockDeDuplicator/output b/test/cmdlineTests/optimizer_BlockDeDuplicator/output index b3a645be3569..8bb023a12fc3 100644 --- a/test/cmdlineTests/optimizer_BlockDeDuplicator/output +++ b/test/cmdlineTests/optimizer_BlockDeDuplicator/output @@ -7,11 +7,11 @@ EVM assembly: 0x00 dup1 sload - not(sub(shl(0x40, 0x01), 0x01)) + shl(0x40, not(0x00)) and /* "input.sol":201:206 fun_x */ or(tag_0_7, shl(0x20, tag_2)) - sub(shl(0x40, 0x01), 0x01) + shr(0xc0, not(0x00)) /* "input.sol":179:210 function() r = true ? fun_x : f */ and or diff --git a/test/cmdlineTests/optimizer_inliner_dynamic_reference/output b/test/cmdlineTests/optimizer_inliner_dynamic_reference/output index 5313893fc735..d21c64e4f7aa 100644 --- a/test/cmdlineTests/optimizer_inliner_dynamic_reference/output +++ b/test/cmdlineTests/optimizer_inliner_dynamic_reference/output @@ -84,7 +84,7 @@ sub_0: assembly { /* "input.sol":147:152 x = f */ dup1 sload - not(0xffffffffffffffff) + shl(0x40, not(0x00)) and /* "input.sol":151:152 f */ tag_17 diff --git a/test/cmdlineTests/optimizer_inliner_dynamic_reference_constructor/output b/test/cmdlineTests/optimizer_inliner_dynamic_reference_constructor/output index 5997bd1c7b60..3be86be8c823 100644 --- a/test/cmdlineTests/optimizer_inliner_dynamic_reference_constructor/output +++ b/test/cmdlineTests/optimizer_inliner_dynamic_reference_constructor/output @@ -17,11 +17,11 @@ tag_1: /* "input.sol":93:98 x = f */ dup1 sload - not(sub(shl(0x40, 0x01), 0x01)) + shl(0x40, not(0x00)) and /* "input.sol":97:98 f */ or(tag_0_12, shl(0x20, tag_4)) - sub(shl(0x40, 0x01), 0x01) + shr(0xc0, not(0x00)) /* "input.sol":93:98 x = f */ and or diff --git a/test/cmdlineTests/standard_debug_info_in_evm_asm_via_ir_location/output.json b/test/cmdlineTests/standard_debug_info_in_evm_asm_via_ir_location/output.json index 4ef3c6df1873..19c41d97fc0a 100644 --- a/test/cmdlineTests/standard_debug_info_in_evm_asm_via_ir_location/output.json +++ b/test/cmdlineTests/standard_debug_info_in_evm_asm_via_ir_location/output.json @@ -20,7 +20,7 @@ dup4 add swap2 - sub(shl(0x40, 0x01), 0x01) + shr(0xc0, not(0x00)) dup4 gt dup5 @@ -104,7 +104,7 @@ sub_0: assembly { jumpi(tag_26, callvalue) jumpi(tag_26, slt(add(not(0x03), calldatasize), 0x00)) sload(0x00) - sub(shl(0xff, 0x01), 0x01) + shr(0x01, not(0x00)) dup2 eq tag_14 @@ -350,7 +350,7 @@ sub_0: assembly { dup4 add swap2 - sub(shl(0x40, 0x01), 0x01) + shr(0xc0, not(0x00)) dup4 gt dup5 @@ -450,7 +450,7 @@ sub_0: assembly { jumpi(tag_26, callvalue) jumpi(tag_26, slt(add(not(0x03), calldatasize), 0x00)) sload(0x00) - sub(shl(0xff, 0x01), 0x01) + shr(0x01, not(0x00)) dup2 eq tag_14 diff --git a/test/cmdlineTests/viair_subobject_optimization/output b/test/cmdlineTests/viair_subobject_optimization/output index 523cff79e0fa..a17f65e751f8 100644 --- a/test/cmdlineTests/viair_subobject_optimization/output +++ b/test/cmdlineTests/viair_subobject_optimization/output @@ -18,7 +18,7 @@ EVM assembly: dup4 add swap2 - sub(shl(0x40, 0x01), 0x01) + shr(0xc0, not(0x00)) dup4 gt dup5 @@ -223,7 +223,7 @@ sub_0: assembly { dup4 add swap2 - sub(shl(0x40, 0x01), 0x01) + shr(0xc0, not(0x00)) dup4 gt dup5 diff --git a/test/libevmasm/evmAssemblyTests/constant_optimizer_runs_0.asm b/test/libevmasm/evmAssemblyTests/constant_optimizer_runs_0.asm index c27b87c14a2b..9f87847c7632 100644 --- a/test/libevmasm/evmAssemblyTests/constant_optimizer_runs_0.asm +++ b/test/libevmasm/evmAssemblyTests/constant_optimizer_runs_0.asm @@ -436,7 +436,7 @@ PUSH 0x2 // shl(0xad, 0xff) // shl(0xc6, 0xff) // shl(0xdf, 0xff) -// not(sub(shl(0xf8, 0x01), 0x01)) +// shl(0xf8, 0xff) // 0xffff // 0xffff000000 // shl(0x30, 0xffff) @@ -447,7 +447,7 @@ PUSH 0x2 // shl(0xa8, 0xffff) // shl(0xc0, 0xffff) // shl(0xd8, 0xffff) -// not(sub(shl(0xf0, 0x01), 0x01)) +// shl(0xf0, 0xffff) // 0x7fffff // 0x3fffff800000 // shl(0x2e, 0x7fffff) @@ -458,7 +458,7 @@ PUSH 0x2 // shl(0xa3, 0x7fffff) // shl(0xba, 0x7fffff) // shl(0xd1, 0x7fffff) -// not(sub(shl(0xe9, 0x01), 0x01)) +// not(shr(0x17, not(0x00))) // 0xffffffff // 0x3fffffffc00000 // shl(0x2c, 0xffffffff) @@ -469,107 +469,107 @@ PUSH 0x2 // shl(0x9c, 0xffffffff) // shl(0xb3, 0xffffffff) // shl(0xc9, 0xffffffff) -// not(sub(shl(0xe0, 0x01), 0x01)) -// 0x7fffffffffff -// 0x07fffffffffff00000 -// shl(0x29, 0x7fffffffffff) -// shl(0x3e, 0x7fffffffffff) -// shl(0x53, 0x7fffffffffff) -// shl(0x68, 0x7fffffffffff) -// shl(0x7d, 0x7fffffffffff) -// shl(0x92, 0x7fffffffffff) -// shl(0xa7, 0x7fffffffffff) -// shl(0xbc, 0x7fffffffffff) -// not(sub(shl(0xd1, 0x01), 0x01)) -// sub(shl(0x40, 0x01), 0x01) -// sub(shl(0x53, 0x01), 0x080000) -// sub(shl(0x66, 0x01), shl(0x26, 0x01)) -// sub(shl(0x79, 0x01), shl(0x39, 0x01)) -// sub(shl(0x8c, 0x01), shl(0x4c, 0x01)) -// sub(shl(0xa0, 0x01), shl(0x60, 0x01)) -// sub(shl(0xb3, 0x01), shl(0x73, 0x01)) -// sub(shl(0xc6, 0x01), shl(0x86, 0x01)) -// sub(shl(0xd9, 0x01), shl(0x99, 0x01)) -// sub(shl(0xec, 0x01), shl(0xac, 0x01)) -// not(sub(shl(0xc0, 0x01), 0x01)) -// sub(shl(0x5c, 0x01), 0x01) -// sub(shl(0x6c, 0x01), 0x010000) -// sub(shl(0x7c, 0x01), shl(0x20, 0x01)) -// sub(shl(0x8d, 0x01), shl(0x31, 0x01)) -// sub(shl(0x9d, 0x01), shl(0x41, 0x01)) -// sub(shl(0xae, 0x01), shl(0x52, 0x01)) -// sub(shl(0xbe, 0x01), shl(0x62, 0x01)) -// sub(shl(0xce, 0x01), shl(0x72, 0x01)) -// sub(shl(0xdf, 0x01), shl(0x83, 0x01)) -// sub(shl(0xef, 0x01), shl(0x93, 0x01)) -// not(sub(shl(0xa4, 0x01), 0x01)) -// sub(shl(0x67, 0x01), 0x01) -// sub(shl(0x76, 0x01), 0x8000) -// sub(shl(0x85, 0x01), 0x40000000) -// sub(shl(0x94, 0x01), shl(0x2d, 0x01)) -// sub(shl(0xa4, 0x01), shl(0x3d, 0x01)) -// sub(shl(0xb3, 0x01), shl(0x4c, 0x01)) -// sub(shl(0xc2, 0x01), shl(0x5b, 0x01)) -// sub(shl(0xd2, 0x01), shl(0x6b, 0x01)) -// sub(shl(0xe1, 0x01), shl(0x7a, 0x01)) -// sub(shl(0xf0, 0x01), shl(0x89, 0x01)) -// not(sub(shl(0x99, 0x01), 0x01)) -// sub(shl(0x80, 0x01), 0x01) -// sub(shl(0x8c, 0x01), 0x1000) -// sub(shl(0x99, 0x01), 0x02000000) -// sub(shl(0xa6, 0x01), shl(0x26, 0x01)) -// sub(shl(0xb3, 0x01), shl(0x33, 0x01)) -// sub(shl(0xc0, 0x01), shl(0x40, 0x01)) -// sub(shl(0xcc, 0x01), shl(0x4c, 0x01)) -// sub(shl(0xd9, 0x01), shl(0x59, 0x01)) -// sub(shl(0xe6, 0x01), shl(0x66, 0x01)) -// sub(shl(0xf3, 0x01), shl(0x73, 0x01)) -// not(sub(shl(0x80, 0x01), 0x01)) -// sub(shl(0x85, 0x01), 0x01) -// sub(shl(0x91, 0x01), 0x1000) -// sub(shl(0x9d, 0x01), 0x01000000) -// sub(shl(0xa9, 0x01), shl(0x24, 0x01)) -// sub(shl(0xb6, 0x01), shl(0x31, 0x01)) -// sub(shl(0xc2, 0x01), shl(0x3d, 0x01)) -// sub(shl(0xce, 0x01), shl(0x49, 0x01)) -// sub(shl(0xdb, 0x01), shl(0x56, 0x01)) -// sub(shl(0xe7, 0x01), shl(0x62, 0x01)) -// sub(shl(0xf3, 0x01), shl(0x6e, 0x01)) -// not(sub(shl(0x7b, 0x01), 0x01)) -// sub(shl(0xa0, 0x01), 0x01) -// sub(shl(0xa9, 0x01), 0x0200) -// sub(shl(0xb3, 0x01), 0x080000) -// sub(shl(0xbc, 0x01), 0x10000000) -// sub(shl(0xc6, 0x01), shl(0x26, 0x01)) -// sub(shl(0xd0, 0x01), shl(0x30, 0x01)) -// sub(shl(0xd9, 0x01), shl(0x39, 0x01)) -// sub(shl(0xe3, 0x01), shl(0x43, 0x01)) -// sub(shl(0xec, 0x01), shl(0x4c, 0x01)) -// sub(shl(0xf6, 0x01), shl(0x56, 0x01)) -// not(sub(shl(0x60, 0x01), 0x01)) -// sub(shl(0xaf, 0x01), 0x01) -// sub(shl(0xb7, 0x01), 0x0100) -// sub(shl(0xbf, 0x01), 0x010000) -// sub(shl(0xc7, 0x01), 0x01000000) -// sub(shl(0xcf, 0x01), shl(0x20, 0x01)) -// sub(shl(0xd7, 0x01), shl(0x28, 0x01)) -// sub(shl(0xdf, 0x01), shl(0x30, 0x01)) -// sub(shl(0xe7, 0x01), shl(0x38, 0x01)) -// sub(shl(0xef, 0x01), shl(0x40, 0x01)) -// sub(shl(0xf7, 0x01), shl(0x48, 0x01)) -// not(sub(shl(0x51, 0x01), 0x01)) -// sub(shl(0xc8, 0x01), 0x01) -// sub(shl(0xcd, 0x01), 0x20) -// sub(shl(0xd3, 0x01), 0x0800) -// sub(shl(0xd8, 0x01), 0x010000) -// sub(shl(0xde, 0x01), 0x400000) -// sub(shl(0xe4, 0x01), 0x10000000) -// sub(shl(0xe9, 0x01), shl(0x21, 0x01)) -// sub(shl(0xef, 0x01), shl(0x27, 0x01)) -// sub(shl(0xf4, 0x01), shl(0x2c, 0x01)) -// sub(shl(0xfa, 0x01), shl(0x32, 0x01)) -// not(0xffffffffffffff) -// sub(shl(0xff, 0x01), 0x01) +// not(shr(0x20, not(0x00))) +// shr(0xd1, not(0x00)) +// shl(0x14, shr(0xd1, not(0x00))) +// shl(0x29, shr(0xd1, not(0x00))) +// shl(0x3e, shr(0xd1, not(0x00))) +// shl(0x53, shr(0xd1, not(0x00))) +// shl(0x68, shr(0xd1, not(0x00))) +// shl(0x7d, shr(0xd1, not(0x00))) +// shl(0x92, shr(0xd1, not(0x00))) +// shl(0xa7, shr(0xd1, not(0x00))) +// shl(0xbc, shr(0xd1, not(0x00))) +// shl(0xd1, not(0x00)) +// shr(0xc0, not(0x00)) +// shl(0x13, shr(0xc0, not(0x00))) +// shl(0x26, shr(0xc0, not(0x00))) +// shl(0x39, shr(0xc0, not(0x00))) +// shl(0x4c, shr(0xc0, not(0x00))) +// shl(0x60, shr(0xc0, not(0x00))) +// shl(0x73, shr(0xc0, not(0x00))) +// shl(0x86, shr(0xc0, not(0x00))) +// shl(0x99, shr(0xc0, not(0x00))) +// shl(0xac, shr(0xc0, not(0x00))) +// shl(0xc0, not(0x00)) +// shr(0xa4, not(0x00)) +// shl(0x10, shr(0xa4, not(0x00))) +// shl(0x20, shr(0xa4, not(0x00))) +// shl(0x31, shr(0xa4, not(0x00))) +// shl(0x41, shr(0xa4, not(0x00))) +// shl(0x52, shr(0xa4, not(0x00))) +// shl(0x62, shr(0xa4, not(0x00))) +// shl(0x72, shr(0xa4, not(0x00))) +// shl(0x83, shr(0xa4, not(0x00))) +// shl(0x93, shr(0xa4, not(0x00))) +// shl(0xa4, not(0x00)) +// shr(0x99, not(0x00)) +// shl(0x0f, shr(0x99, not(0x00))) +// shl(0x1e, shr(0x99, not(0x00))) +// shl(0x2d, shr(0x99, not(0x00))) +// shl(0x3d, shr(0x99, not(0x00))) +// shl(0x4c, shr(0x99, not(0x00))) +// shl(0x5b, shr(0x99, not(0x00))) +// shl(0x6b, shr(0x99, not(0x00))) +// shl(0x7a, shr(0x99, not(0x00))) +// shl(0x89, shr(0x99, not(0x00))) +// shl(0x99, not(0x00)) +// shr(0x80, not(0x00)) +// shl(0x0c, shr(0x80, not(0x00))) +// shl(0x19, shr(0x80, not(0x00))) +// shl(0x26, shr(0x80, not(0x00))) +// shl(0x33, shr(0x80, not(0x00))) +// shl(0x40, shr(0x80, not(0x00))) +// shl(0x4c, shr(0x80, not(0x00))) +// shl(0x59, shr(0x80, not(0x00))) +// shl(0x66, shr(0x80, not(0x00))) +// shl(0x73, shr(0x80, not(0x00))) +// shl(0x80, not(0x00)) +// shr(0x7b, not(0x00)) +// shl(0x0c, shr(0x7b, not(0x00))) +// shl(0x18, shr(0x7b, not(0x00))) +// shl(0x24, shr(0x7b, not(0x00))) +// shl(0x31, shr(0x7b, not(0x00))) +// shl(0x3d, shr(0x7b, not(0x00))) +// shl(0x49, shr(0x7b, not(0x00))) +// shl(0x56, shr(0x7b, not(0x00))) +// shl(0x62, shr(0x7b, not(0x00))) +// shl(0x6e, shr(0x7b, not(0x00))) +// shl(0x7b, not(0x00)) +// shr(0x60, not(0x00)) +// shl(0x09, shr(0x60, not(0x00))) +// shl(0x13, shr(0x60, not(0x00))) +// shl(0x1c, shr(0x60, not(0x00))) +// shl(0x26, shr(0x60, not(0x00))) +// shl(0x30, shr(0x60, not(0x00))) +// shl(0x39, shr(0x60, not(0x00))) +// shl(0x43, shr(0x60, not(0x00))) +// shl(0x4c, shr(0x60, not(0x00))) +// shl(0x56, shr(0x60, not(0x00))) +// shl(0x60, not(0x00)) +// shr(0x51, not(0x00)) +// shl(0x08, shr(0x51, not(0x00))) +// shl(0x10, shr(0x51, not(0x00))) +// shl(0x18, shr(0x51, not(0x00))) +// shl(0x20, shr(0x51, not(0x00))) +// shl(0x28, shr(0x51, not(0x00))) +// shl(0x30, shr(0x51, not(0x00))) +// shl(0x38, shr(0x51, not(0x00))) +// shl(0x40, shr(0x51, not(0x00))) +// shl(0x48, shr(0x51, not(0x00))) +// shl(0x51, not(0x00)) +// shr(0x38, not(0x00)) +// shl(0x05, shr(0x38, not(0x00))) +// shl(0x0b, shr(0x38, not(0x00))) +// shl(0x10, shr(0x38, not(0x00))) +// shl(0x16, shr(0x38, not(0x00))) +// shl(0x1c, shr(0x38, not(0x00))) +// shl(0x21, shr(0x38, not(0x00))) +// shl(0x27, shr(0x38, not(0x00))) +// shl(0x2c, shr(0x38, not(0x00))) +// shl(0x32, shr(0x38, not(0x00))) +// shl(0x38, not(0x00)) +// shr(0x01, not(0x00)) // not(0x01) // not(0x00) // 0x0a @@ -581,74 +581,74 @@ PUSH 0x2 // 0x989680 // 0x05f5e100 // 0x3b9aca00 -// 0x02540be400 -// 0x174876e800 -// 0xe8d4a51000 -// 0x09184e72a000 -// 0x5af3107a4000 -// 0x038d7ea4c68000 -// 0x2386f26fc10000 -// 0x016345785d8a0000 -// 0x0de0b6b3a7640000 -// 0x8ac7230489e80000 -// 0x056bc75e2d63100000 -// 0x3635c9adc5dea00000 -// 0x021e19e0c9bab2400000 -// 0x152d02c7e14af6800000 -// 0xd3c21bcecceda1000000 -// 0x084595161401484a000000 -// 0x52b7d2dcc80cd2e4000000 -// shl(0x1b, 0x6765c793fa10079d) -// 0x204fce5e3e25026110000000 -// shl(0x1d, 0x0a18f07d736b90be55) -// shl(0x1e, 0x327cb2734119d3b7a9) -// shl(0x1f, 0xfc6f7c40458122964d) -// shl(0x20, 0x04ee2d6d415b85acef81) -// shl(0x21, 0x18a6e32246c99c60ad85) -// shl(0x22, 0x7b426fab61f00de36399) -// shl(0x23, 0x02684c2e58e9b04570f1fd) -// shl(0x24, 0x0c097ce7bc90715b34b9f1) -// shl(0x25, 0x3c2f7086aed236c807a1b5) -// shl(0x26, 0x012ced32a16a1b11e8262889) -// shl(0x27, 0x05e0a1fd2712875988becaad) -// shl(0x28, 0x1d6329f1c35ca4bfabb9f561) -// shl(0x29, 0x92efd1b8d0cf37be5aa1cae5) -// shl(0x2a, 0x02deaf189c140c16b7c528f679) -// shl(0x2b, 0x0e596b7b0c643c7196d9ccd05d) -// shl(0x2c, 0x47bf19673df52e37f2410011d1) -// shl(0x2d, 0x0166bb7f0435c9e717bb45005915) -// shl(0x2e, 0x0701a97b150cf18376a85901bd69) -// shl(0x2f, 0x23084f676940b7915149bd08b30d) -// shl(0x30, 0xaf298d050e4395d69670b12b7f41) -// shl(0x31, 0x036bcfc1194751ed30f03375d97c45) -// shl(0x32, 0x111b0ec57e6499a1f4b1014d3f6d59) -// shl(0x33, 0x558749db77f70029c77506823d22bd) -// shl(0x34, 0x01aba4714957d300d0e549208b31adb1) -// shl(0x35, 0x085a36366eb71f04147a6da2b7f86475) -// shl(0x36, 0x29c30f1029939b146664242d97d9f649) -// shl(0x37, 0xd0cf4b50cfe20765fff4b4e3f741cf6d) -// shl(0x38, 0x04140c78940f6a24fdffc78873d4490d21) -// shl(0x39, 0x14643e5ae44d12b8f5fee5aa43256d41a5) -// shl(0x3a, 0x65f537c675815d9ccdfa7c534fbb224839) -// shl(0x3b, 0x01fdca16e04b86d41005e46da08ea7ab691d) -// shl(0x3c, 0x09f4f2726179a224501d762422c946590d91) -// shl(0x3d, 0x31c8bc3be7602ab590934eb4adee5fbd43d5) -// shl(0x3e, 0xf8ebad2b84e0d58bd2e0898765a7deb25329) -// shl(0x3f, 0x04dc9a61d998642bbb1e62afa4fc47597b9fcd) -// shl(0x40, 0x184f03e93ff9f4daa797ed6e38ed64bf6a1f01) -// shl(0x41, 0x798b138e3fe1c84545f7a3271ca2f7bd129b05) -// shl(0x42, 0x025fb761c73f68e95a5dd62fc38f2ed6b15d0719) -// shl(0x43, 0x0bde94e8e43d0c8ec3d52eeed1cbea3176d1237d) -// shl(0x44, 0x3b58e88c75313ec9d329eaaa18fb92f75215b171) -// shl(0x45, 0x0128bc8abe49f639f11fd195527ce9ded49a6c7735) -// shl(0x46, 0x05cbaeb5b771cf21b59f17ea9c70915a27041e5409) -// shl(0x47, 0x1cfa698c95390ba88c1b77950e32d6c2c31497a42d) -// shl(0x48, 0x90e40fbeea1d3a4abc8955e946fe31cdcf66f634e1) -// shl(0x49, 0x02d4744eba92922375aeaead8e62f6f9050d02cf0865) -// shl(0x4a, 0x0e264589a4dcdab14c696963c7eed2dd19410e0b29f9) -// shl(0x4b, 0x46bf5bb0385045767e0f0ef2e7aa1e517e454637d1dd) -// shl(0x4c, 0x0161bcca7119915b50764b4abe86529797775a5f171951) -// shl(0x4d, 0x06e8aff4357fd6c8924f7875b89f9cf5f554c3db737e95) +// exp(0x0a, 0x0a) +// exp(0x0a, 0x0b) +// exp(0x0a, 0x0c) +// exp(0x0a, 0x0d) +// exp(0x0a, 0x0e) +// exp(0x0a, 0x0f) +// exp(0x0a, 0x10) +// exp(0x0a, 0x11) +// exp(0x0a, 0x12) +// exp(0x0a, 0x13) +// exp(0x0a, 0x14) +// exp(0x0a, 0x15) +// exp(0x0a, 0x16) +// exp(0x0a, 0x17) +// exp(0x0a, 0x18) +// exp(0x0a, 0x19) +// exp(0x0a, 0x1a) +// exp(0x0a, 0x1b) +// exp(0x0a, 0x1c) +// exp(0x0a, 0x1d) +// exp(0x0a, 0x1e) +// exp(0x0a, 0x1f) +// exp(0x0a, 0x20) +// exp(0x0a, 0x21) +// exp(0x0a, 0x22) +// exp(0x0a, 0x23) +// exp(0x0a, 0x24) +// exp(0x0a, 0x25) +// exp(0x0a, 0x26) +// exp(0x0a, 0x27) +// exp(0x0a, 0x28) +// exp(0x0a, 0x29) +// exp(0x0a, 0x2a) +// exp(0x0a, 0x2b) +// exp(0x0a, 0x2c) +// exp(0x0a, 0x2d) +// exp(0x0a, 0x2e) +// exp(0x0a, 0x2f) +// exp(0x0a, 0x30) +// exp(0x0a, 0x31) +// exp(0x0a, 0x32) +// exp(0x0a, 0x33) +// exp(0x0a, 0x34) +// exp(0x0a, 0x35) +// exp(0x0a, 0x36) +// exp(0x0a, 0x37) +// exp(0x0a, 0x38) +// exp(0x0a, 0x39) +// exp(0x0a, 0x3a) +// exp(0x0a, 0x3b) +// exp(0x0a, 0x3c) +// exp(0x0a, 0x3d) +// exp(0x0a, 0x3e) +// exp(0x0a, 0x3f) +// exp(0x0a, 0x40) +// exp(0x0a, 0x41) +// exp(0x0a, 0x42) +// exp(0x0a, 0x43) +// exp(0x0a, 0x44) +// exp(0x0a, 0x45) +// exp(0x0a, 0x46) +// exp(0x0a, 0x47) +// exp(0x0a, 0x48) +// exp(0x0a, 0x49) +// exp(0x0a, 0x4a) +// exp(0x0a, 0x4b) +// exp(0x0a, 0x4c) +// exp(0x0a, 0x4d) // sub(shl(0x41, 0x05), 0x0a) // sub(shl(0x42, 0x19), 0x64) // sub(shl(0x43, 0x7d), 0x03e8) @@ -658,52 +658,52 @@ PUSH 0x2 // 0x98967fffffffffff676980 // 0x05f5e0fffffffffffa0a1f00 // 0x3b9ac9ffffffffffc4653600 -// 0x02540be3fffffffffdabf41c00 +// sub(shl(0x4a, 0x9502f9), exp(0x0a, 0x0a)) // 0x174876e7ffffffffe8b7891800 // 0xe8d4a50fffffffff172b5af000 -// 0x09184e729ffffffff6e7b18d6000 -// 0x5af3107a3fffffffa50cef85c000 -// 0x038d7ea4c67ffffffc72815b398000 -// 0x2386f26fc0ffffffdc790d903f0000 -// 0x016345785d89fffffe9cba87a2760000 -// 0x0de0b6b3a763fffff21f494c589c0000 -// 0x8ac7230489e7ffff7538dcfb76180000 -// 0x056bc75e2d630ffffa9438a1d29cf00000 -// 0x3635c9adc5de9fffc9ca36523a21600000 -// 0x021e19e0c9bab23ffde1e61f36454dc00000 -// 0x152d02c7e14af67fead2fd381eb509800000 -// 0xd3c21bcecceda0ff2c3de43133125f000000 -// 0x0845951614014849f7ba6ae9ebfeb7b6000000 -// 0x52b7d2dcc80cd2e3ad482d2337f32d1c000000 -// shl(0x1b, 0x6765c793fa10079c989a386c05eff863) -// 0x204fce5e3e250260efb031a1c1dafd9ef0000000 -// shl(0x1d, 0x0a18f07d736b90be4ae70f828c946f41ab) -// shl(0x1e, 0x327cb2734119d3b776834d8cbee62c4857) -// shl(0x1f, 0xfc6f7c4045812295509083bfba7edd69b3) -// shl(0x20, 0x04ee2d6d415b85acea92d292bea47a53107f) -// shl(0x21, 0x18a6e32246c99c6094de1cddb936639f527b) -// shl(0x22, 0x7b426fab61f00de2e85690549e0ff21c9c67) -// shl(0x23, 0x02684c2e58e9b0456e89b0d1a7164fba8f0e03) -// shl(0x24, 0x0c097ce7bc90715b28b07418436f8ea4cb460f) -// shl(0x25, 0x3c2f7086aed236c7cb724479512dc937f85e4b) -// shl(0x26, 0x012ced32a16a1b11e6f93b565e95e4ee17d9d777) -// shl(0x27, 0x05e0a1fd2712875982de28afd8ed78a677413553) -// shl(0x28, 0x1d6329f1c35ca4bf8e56cb6f3ca35b4054460a9f) -// shl(0x29, 0x92efd1b8d0cf37bdc7b1f92c2f30c841a55e351b) -// shl(0x2a, 0x02deaf189c140c16b4e679dddcebf3e9483ad70987) -// shl(0x2b, 0x0e596b7b0c643c7188806155509bc38e6926332fa3) -// shl(0x2c, 0x47bf19673df52e37aa81e6aa930ad1c80dbeffee2f) -// shl(0x2d, 0x0166bb7f0435c9e71654898154df3618e844baffa6eb) -// shl(0x2e, 0x0701a97b150cf1836fa6af86a85c0e7c8957a6fe4297) -// shl(0x2f, 0x23084f676940b7912e416da149cc486eaeb642f74cf3) -// shl(0x30, 0xaf298d050e4395d5e747242670fd6a29698f4ed480bf) -// shl(0x31, 0x036bcfc1194751ed2d8463b4c034f312cf0fcc8a2683bb) -// shl(0x32, 0x111b0ec57e6499a1e395f287c108bf5e0b4efeb2c092a7) -// shl(0x33, 0x558749db77f7002971edbca6c52bbcd6388af97dc2dd43) -// shl(0x34, 0x01aba4714957d300cf39a4af41d9dab02f1ab6df74ce524f) -// shl(0x35, 0x085a36366eb71f040c20376c49414570eb85925d48079b8b) -// shl(0x36, 0x29c30f1029939b143ca1151d6e465b34999bdbd2682609b7) -// shl(0x37, 0xd0cf4b50cfe207652f256993275fc807000b4b1c08be3093) -// shl(0x38, 0x04140c78940f6a24f9ebbb0fdfc4dee8230038778c2bb6f2df) -// shl(0x39, 0x14643e5ae44d12b8e19aa74f5ed85a88af011a55bcda92be5b) +// mul(exp(0x0a, 0x0d), shr(0xc0, not(0x00))) +// mul(exp(0x0a, 0x0e), shr(0xc0, not(0x00))) +// mul(exp(0x0a, 0x0f), shr(0xc0, not(0x00))) +// mul(exp(0x0a, 0x10), shr(0xc0, not(0x00))) +// mul(exp(0x0a, 0x11), shr(0xc0, not(0x00))) +// mul(exp(0x0a, 0x12), shr(0xc0, not(0x00))) +// mul(exp(0x0a, 0x13), shr(0xc0, not(0x00))) +// mul(exp(0x0a, 0x14), shr(0xc0, not(0x00))) +// mul(exp(0x0a, 0x15), shr(0xc0, not(0x00))) +// mul(exp(0x0a, 0x16), shr(0xc0, not(0x00))) +// mul(exp(0x0a, 0x17), shr(0xc0, not(0x00))) +// mul(exp(0x0a, 0x18), shr(0xc0, not(0x00))) +// mul(exp(0x0a, 0x19), shr(0xc0, not(0x00))) +// mul(exp(0x0a, 0x1a), shr(0xc0, not(0x00))) +// mul(exp(0x0a, 0x1b), shr(0xc0, not(0x00))) +// mul(exp(0x0a, 0x1c), shr(0xc0, not(0x00))) +// mul(exp(0x0a, 0x1d), shr(0xc0, not(0x00))) +// mul(exp(0x0a, 0x1e), shr(0xc0, not(0x00))) +// mul(exp(0x0a, 0x1f), shr(0xc0, not(0x00))) +// mul(exp(0x0a, 0x20), shr(0xc0, not(0x00))) +// mul(exp(0x0a, 0x21), shr(0xc0, not(0x00))) +// mul(exp(0x0a, 0x22), shr(0xc0, not(0x00))) +// mul(exp(0x0a, 0x23), shr(0xc0, not(0x00))) +// mul(exp(0x0a, 0x24), shr(0xc0, not(0x00))) +// mul(exp(0x0a, 0x25), shr(0xc0, not(0x00))) +// mul(exp(0x0a, 0x26), shr(0xc0, not(0x00))) +// mul(exp(0x0a, 0x27), shr(0xc0, not(0x00))) +// mul(exp(0x0a, 0x28), shr(0xc0, not(0x00))) +// mul(exp(0x0a, 0x29), shr(0xc0, not(0x00))) +// mul(exp(0x0a, 0x2a), shr(0xc0, not(0x00))) +// mul(exp(0x0a, 0x2b), shr(0xc0, not(0x00))) +// mul(exp(0x0a, 0x2c), shr(0xc0, not(0x00))) +// mul(exp(0x0a, 0x2d), shr(0xc0, not(0x00))) +// mul(exp(0x0a, 0x2e), shr(0xc0, not(0x00))) +// mul(exp(0x0a, 0x2f), shr(0xc0, not(0x00))) +// mul(exp(0x0a, 0x30), shr(0xc0, not(0x00))) +// mul(exp(0x0a, 0x31), shr(0xc0, not(0x00))) +// mul(exp(0x0a, 0x32), shr(0xc0, not(0x00))) +// mul(exp(0x0a, 0x33), shr(0xc0, not(0x00))) +// mul(exp(0x0a, 0x34), shr(0xc0, not(0x00))) +// mul(exp(0x0a, 0x35), shr(0xc0, not(0x00))) +// mul(exp(0x0a, 0x36), shr(0xc0, not(0x00))) +// mul(exp(0x0a, 0x37), shr(0xc0, not(0x00))) +// mul(exp(0x0a, 0x38), shr(0xc0, not(0x00))) +// mul(exp(0x0a, 0x39), shr(0xc0, not(0x00))) // } diff --git a/test/libevmasm/evmAssemblyTests/constant_optimizer_runs_200.asm b/test/libevmasm/evmAssemblyTests/constant_optimizer_runs_200.asm index 85597757daa4..805af2f806f8 100644 --- a/test/libevmasm/evmAssemblyTests/constant_optimizer_runs_200.asm +++ b/test/libevmasm/evmAssemblyTests/constant_optimizer_runs_200.asm @@ -436,7 +436,7 @@ PUSH 0x2 // shl(0xad, 0xff) // shl(0xc6, 0xff) // shl(0xdf, 0xff) -// not(sub(shl(0xf8, 0x01), 0x01)) +// shl(0xf8, 0xff) // 0xffff // 0xffff000000 // 0xffff000000000000 @@ -447,7 +447,7 @@ PUSH 0x2 // shl(0xa8, 0xffff) // shl(0xc0, 0xffff) // shl(0xd8, 0xffff) -// not(sub(shl(0xf0, 0x01), 0x01)) +// shl(0xf0, 0xffff) // 0x7fffff // 0x3fffff800000 // 0x1fffffc00000000000 @@ -458,7 +458,7 @@ PUSH 0x2 // shl(0xa3, 0x7fffff) // shl(0xba, 0x7fffff) // shl(0xd1, 0x7fffff) -// not(sub(shl(0xe9, 0x01), 0x01)) +// not(shr(0x17, not(0x00))) // 0xffffffff // 0x3fffffffc00000 // 0x0ffffffff00000000000 @@ -469,107 +469,107 @@ PUSH 0x2 // shl(0x9c, 0xffffffff) // shl(0xb3, 0xffffffff) // shl(0xc9, 0xffffffff) -// not(sub(shl(0xe0, 0x01), 0x01)) +// not(shr(0x20, not(0x00))) // 0x7fffffffffff // 0x07fffffffffff00000 // 0xfffffffffffe0000000000 // 0x1fffffffffffc000000000000000 -// shl(0x53, 0x7fffffffffff) -// shl(0x68, 0x7fffffffffff) -// shl(0x7d, 0x7fffffffffff) -// shl(0x92, 0x7fffffffffff) -// shl(0xa7, 0x7fffffffffff) -// shl(0xbc, 0x7fffffffffff) -// not(sub(shl(0xd1, 0x01), 0x01)) +// 0x03fffffffffff800000000000000000000 +// 0x7fffffffffff00000000000000000000000000 +// shl(0x7d, shr(0xd1, not(0x00))) +// shl(0x92, shr(0xd1, not(0x00))) +// shl(0xa7, shr(0xd1, not(0x00))) +// shl(0xbc, shr(0xd1, not(0x00))) +// shl(0xd1, not(0x00)) // 0xffffffffffffffff // 0x07fffffffffffffff80000 // 0x3fffffffffffffffc000000000 // 0x01fffffffffffffffe00000000000000 -// shl(0x4c, 0xffffffffffffffff) -// shl(0x60, 0xffffffffffffffff) -// shl(0x73, 0xffffffffffffffff) -// shl(0x86, 0xffffffffffffffff) -// shl(0x99, 0xffffffffffffffff) -// shl(0xac, 0xffffffffffffffff) -// not(sub(shl(0xc0, 0x01), 0x01)) +// 0x0ffffffffffffffff0000000000000000000 +// 0xffffffffffffffff000000000000000000000000 +// shl(0x73, shr(0xc0, not(0x00))) +// shl(0x86, shr(0xc0, not(0x00))) +// shl(0x99, shr(0xc0, not(0x00))) +// shl(0xac, shr(0xc0, not(0x00))) +// shl(0xc0, not(0x00)) // 0x0fffffffffffffffffffffff // 0x0fffffffffffffffffffffff0000 // 0x0fffffffffffffffffffffff00000000 // 0x1ffffffffffffffffffffffe000000000000 // 0x1ffffffffffffffffffffffe0000000000000000 -// shl(0x52, 0x0fffffffffffffffffffffff) -// shl(0x62, 0x0fffffffffffffffffffffff) -// shl(0x72, 0x0fffffffffffffffffffffff) -// shl(0x83, 0x0fffffffffffffffffffffff) -// shl(0x93, 0x0fffffffffffffffffffffff) -// not(sub(shl(0xa4, 0x01), 0x01)) -// 0x7fffffffffffffffffffffffff +// shl(0x52, shr(0xa4, not(0x00))) +// shl(0x62, shr(0xa4, not(0x00))) +// shl(0x72, shr(0xa4, not(0x00))) +// shl(0x83, shr(0xa4, not(0x00))) +// shl(0x93, shr(0xa4, not(0x00))) +// shl(0xa4, not(0x00)) +// shr(0x99, not(0x00)) // 0x3fffffffffffffffffffffffff8000 // 0x1fffffffffffffffffffffffffc0000000 // 0x0fffffffffffffffffffffffffe00000000000 // 0x0fffffffffffffffffffffffffe000000000000000 -// shl(0x4c, 0x7fffffffffffffffffffffffff) -// shl(0x5b, 0x7fffffffffffffffffffffffff) -// shl(0x6b, 0x7fffffffffffffffffffffffff) -// shl(0x7a, 0x7fffffffffffffffffffffffff) -// shl(0x89, 0x7fffffffffffffffffffffffff) -// not(sub(shl(0x99, 0x01), 0x01)) -// 0xffffffffffffffffffffffffffffffff +// shl(0x4c, shr(0x99, not(0x00))) +// shl(0x5b, shr(0x99, not(0x00))) +// shl(0x6b, shr(0x99, not(0x00))) +// shl(0x7a, shr(0x99, not(0x00))) +// shl(0x89, shr(0x99, not(0x00))) +// shl(0x99, not(0x00)) +// shr(0x80, not(0x00)) // 0x0ffffffffffffffffffffffffffffffff000 // 0x01fffffffffffffffffffffffffffffffe000000 // 0x3fffffffffffffffffffffffffffffffc000000000 -// 0x07fffffffffffffffffffffffffffffff8000000000000 -// 0xffffffffffffffffffffffffffffffff0000000000000000 -// shl(0x4c, 0xffffffffffffffffffffffffffffffff) -// shl(0x59, 0xffffffffffffffffffffffffffffffff) -// shl(0x66, 0xffffffffffffffffffffffffffffffff) -// shl(0x73, 0xffffffffffffffffffffffffffffffff) -// not(0xffffffffffffffffffffffffffffffff) -// 0x1fffffffffffffffffffffffffffffffff +// shl(0x33, shr(0x80, not(0x00))) +// shl(0x40, shr(0x80, not(0x00))) +// shl(0x4c, shr(0x80, not(0x00))) +// shl(0x59, shr(0x80, not(0x00))) +// shl(0x66, shr(0x80, not(0x00))) +// shl(0x73, shr(0x80, not(0x00))) +// shl(0x80, not(0x00)) +// shr(0x7b, not(0x00)) // 0x01fffffffffffffffffffffffffffffffff000 // 0x1fffffffffffffffffffffffffffffffff000000 -// 0x01fffffffffffffffffffffffffffffffff000000000 -// 0x3ffffffffffffffffffffffffffffffffe000000000000 -// 0x03ffffffffffffffffffffffffffffffffe000000000000000 -// 0x3ffffffffffffffffffffffffffffffffe000000000000000000 -// shl(0x56, 0x1fffffffffffffffffffffffffffffffff) -// shl(0x62, 0x1fffffffffffffffffffffffffffffffff) -// shl(0x6e, 0x1fffffffffffffffffffffffffffffffff) -// not(0x07ffffffffffffffffffffffffffffff) -// sub(shl(0xa0, 0x01), 0x01) -// sub(shl(0xa9, 0x01), 0x0200) -// sub(shl(0xb3, 0x01), 0x080000) -// sub(shl(0xbc, 0x01), 0x10000000) -// sub(shl(0xc6, 0x01), 0x4000000000) -// sub(shl(0xd0, 0x01), 0x01000000000000) -// sub(shl(0xd9, 0x01), 0x0200000000000000) -// sub(shl(0xe3, 0x01), 0x080000000000000000) -// sub(shl(0xec, 0x01), 0x10000000000000000000) -// sub(shl(0xf6, 0x01), shl(0x56, 0x01)) -// not(0xffffffffffffffffffffffff) -// sub(shl(0xaf, 0x01), 0x01) -// sub(shl(0xb7, 0x01), 0x0100) -// sub(shl(0xbf, 0x01), 0x010000) -// sub(shl(0xc7, 0x01), 0x01000000) -// sub(shl(0xcf, 0x01), 0x0100000000) -// sub(shl(0xd7, 0x01), 0x010000000000) -// sub(shl(0xdf, 0x01), 0x01000000000000) -// sub(shl(0xe7, 0x01), 0x0100000000000000) -// sub(shl(0xef, 0x01), 0x010000000000000000) -// sub(shl(0xf7, 0x01), 0x01000000000000000000) -// not(0x01ffffffffffffffffffff) -// sub(shl(0xc8, 0x01), 0x01) -// sub(shl(0xcd, 0x01), 0x20) -// sub(shl(0xd3, 0x01), 0x0800) -// sub(shl(0xd8, 0x01), 0x010000) -// sub(shl(0xde, 0x01), 0x400000) -// sub(shl(0xe4, 0x01), 0x10000000) -// sub(shl(0xe9, 0x01), 0x0200000000) -// sub(shl(0xef, 0x01), 0x8000000000) -// sub(shl(0xf4, 0x01), 0x100000000000) -// sub(shl(0xfa, 0x01), 0x04000000000000) -// not(0xffffffffffffff) -// sub(shl(0xff, 0x01), 0x01) +// shl(0x24, shr(0x7b, not(0x00))) +// shl(0x31, shr(0x7b, not(0x00))) +// shl(0x3d, shr(0x7b, not(0x00))) +// shl(0x49, shr(0x7b, not(0x00))) +// shl(0x56, shr(0x7b, not(0x00))) +// shl(0x62, shr(0x7b, not(0x00))) +// shl(0x6e, shr(0x7b, not(0x00))) +// shl(0x7b, not(0x00)) +// shr(0x60, not(0x00)) +// shl(0x09, shr(0x60, not(0x00))) +// shl(0x13, shr(0x60, not(0x00))) +// shl(0x1c, shr(0x60, not(0x00))) +// shl(0x26, shr(0x60, not(0x00))) +// shl(0x30, shr(0x60, not(0x00))) +// shl(0x39, shr(0x60, not(0x00))) +// shl(0x43, shr(0x60, not(0x00))) +// shl(0x4c, shr(0x60, not(0x00))) +// shl(0x56, shr(0x60, not(0x00))) +// shl(0x60, not(0x00)) +// shr(0x51, not(0x00)) +// shl(0x08, shr(0x51, not(0x00))) +// shl(0x10, shr(0x51, not(0x00))) +// shl(0x18, shr(0x51, not(0x00))) +// shl(0x20, shr(0x51, not(0x00))) +// shl(0x28, shr(0x51, not(0x00))) +// shl(0x30, shr(0x51, not(0x00))) +// shl(0x38, shr(0x51, not(0x00))) +// shl(0x40, shr(0x51, not(0x00))) +// shl(0x48, shr(0x51, not(0x00))) +// shl(0x51, not(0x00)) +// shr(0x38, not(0x00)) +// shl(0x05, shr(0x38, not(0x00))) +// shl(0x0b, shr(0x38, not(0x00))) +// shl(0x10, shr(0x38, not(0x00))) +// shl(0x16, shr(0x38, not(0x00))) +// shl(0x1c, shr(0x38, not(0x00))) +// shl(0x21, shr(0x38, not(0x00))) +// shl(0x27, shr(0x38, not(0x00))) +// shl(0x2c, shr(0x38, not(0x00))) +// shl(0x32, shr(0x38, not(0x00))) +// shl(0x38, not(0x00)) +// shr(0x01, not(0x00)) // not(0x01) // not(0x00) // 0x0a @@ -646,7 +646,7 @@ PUSH 0x2 // 0x90e40fbeea1d3a4abc8955e946fe31cdcf66f634e1000000000000000000 // 0x05a8e89d75252446eb5d5d5b1cc5edf20a1a059e10ca000000000000000000 // 0x3899162693736ac531a5a58f1fbb4b746504382ca7e4000000000000000000 -// shl(0x4b, 0x46bf5bb0385045767e0f0ef2e7aa1e517e454637d1dd) +// 0x0235fadd81c2822bb3f07877973d50f28bf22a31be8ee8000000000000000000 // 0x161bcca7119915b50764b4abe86529797775a5f1719510000000000000000000 // 0xdd15fe86affad91249ef0eb713f39ebeaa987b6e6fd2a0000000000000000000 // 0x09fffffffffffffff6 diff --git a/test/libevmasm/evmAssemblyTests/isoltestTesting/settings_optimizer_constant_optimizer.asmjson b/test/libevmasm/evmAssemblyTests/isoltestTesting/settings_optimizer_constant_optimizer.asmjson index a3610217fbaf..710f8da81c25 100644 --- a/test/libevmasm/evmAssemblyTests/isoltestTesting/settings_optimizer_constant_optimizer.asmjson +++ b/test/libevmasm/evmAssemblyTests/isoltestTesting/settings_optimizer_constant_optimizer.asmjson @@ -8,7 +8,7 @@ // optimizer.constantOptimizer: true // ---- // Assembly: -// sub(shl(0x40, 0x01), 0x01) -// Bytecode: 6001600160401b03 -// Opcodes: PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB -// SourceMappings: :::-:0;;;; +// shr(0xc0, not(0x00)) +// Bytecode: 5f1960c01c +// Opcodes: PUSH0 NOT PUSH1 0xC0 SHR +// SourceMappings: :::-:0;;; diff --git a/test/libevmasm/evmAssemblyTests/isoltestTesting/settings_optimizer_expected_executions_per_deployment.asmjson b/test/libevmasm/evmAssemblyTests/isoltestTesting/settings_optimizer_expected_executions_per_deployment.asmjson index b9fd814d5c8e..780704849fb8 100644 --- a/test/libevmasm/evmAssemblyTests/isoltestTesting/settings_optimizer_expected_executions_per_deployment.asmjson +++ b/test/libevmasm/evmAssemblyTests/isoltestTesting/settings_optimizer_expected_executions_per_deployment.asmjson @@ -19,8 +19,8 @@ // stop // // sub_0: assembly { -// sub(shl(0x40, 0x01), 0x01) +// shr(0xc0, not(0x00)) // } -// Bytecode: 6003fe6001600160401b03 -// Opcodes: PUSH1 0x3 INVALID PUSH1 0x1 PUSH1 0x1 PUSH1 0x40 SHL SUB +// Bytecode: 6003fe5f1960c01c +// Opcodes: PUSH1 0x3 INVALID PUSH0 NOT PUSH1 0xC0 SHR // SourceMappings: :::-:0 diff --git a/test/libsolidity/gasTests/abiv2_optimised.sol b/test/libsolidity/gasTests/abiv2_optimised.sol index e23a7bff2562..912a8466c7da 100644 --- a/test/libsolidity/gasTests/abiv2_optimised.sol +++ b/test/libsolidity/gasTests/abiv2_optimised.sol @@ -19,9 +19,9 @@ contract C { // optimize-yul: true // ---- // creation: -// codeDepositCost: 618200 -// executionCost: 649 -// totalCost: 618849 +// codeDepositCost: 605600 +// executionCost: 636 +// totalCost: 606236 // external: // a(): 2283 // b(uint256): 4649 diff --git a/test/libsolidity/semanticTests/abicoder/abi_encode_calldata_slice.sol b/test/libsolidity/semanticTests/abicoder/abi_encode_calldata_slice.sol index a6a4f8fd870d..930c375fc549 100644 --- a/test/libsolidity/semanticTests/abicoder/abi_encode_calldata_slice.sol +++ b/test/libsolidity/semanticTests/abicoder/abi_encode_calldata_slice.sol @@ -59,10 +59,10 @@ contract C { // EVMVersion: >homestead // ---- // test_bytes() -> -// gas irOptimized: 314884 +// gas irOptimized: 302904 // gas legacy: 305816 -// gas legacyOptimized: 253573 +// gas legacyOptimized: 244887 // test_uint256() -> -// gas irOptimized: 448346 +// gas irOptimized: 428338 // gas legacy: 421304 -// gas legacyOptimized: 351544 +// gas legacyOptimized: 337032 diff --git a/test/libsolidity/semanticTests/abicoder/abi_encode_v2.sol b/test/libsolidity/semanticTests/abicoder/abi_encode_v2.sol index edfe075ddd79..49f7cd6d0bc0 100644 --- a/test/libsolidity/semanticTests/abicoder/abi_encode_v2.sol +++ b/test/libsolidity/semanticTests/abicoder/abi_encode_v2.sol @@ -50,6 +50,6 @@ contract C { // f2() -> 0x20, 0xa0, 0x1, 0x60, 0x2, 0x3, "abc" // f3() -> 0x20, 0xa0, 0x1, 0x60, 0x2, 0x3, "abc" // f4() -> 0x20, 0x160, 0x1, 0x80, 0xc0, 0x2, 0x3, "abc", 0x7, 0x40, 0x2, 0x2, 0x3 -// gas irOptimized: 111816 +// gas irOptimized: 111807 // gas legacy: 113890 -// gas legacyOptimized: 111658 +// gas legacyOptimized: 111649 diff --git a/test/libsolidity/semanticTests/abicoder/abi_encode_v2_in_function_inherited_in_v1_contract.sol b/test/libsolidity/semanticTests/abicoder/abi_encode_v2_in_function_inherited_in_v1_contract.sol index bb3ad1aad1a9..4c85d0566ef6 100644 --- a/test/libsolidity/semanticTests/abicoder/abi_encode_v2_in_function_inherited_in_v1_contract.sol +++ b/test/libsolidity/semanticTests/abicoder/abi_encode_v2_in_function_inherited_in_v1_contract.sol @@ -30,9 +30,9 @@ contract C is B { } // ---- // test() -> 77 -// gas irOptimized: 55117 -// gas irOptimized code: 56800 +// gas irOptimized: 55177 +// gas irOptimized code: 54400 // gas legacy: 57266 // gas legacy code: 94600 -// gas legacyOptimized: 55195 +// gas legacyOptimized: 55191 // gas legacyOptimized code: 55000 diff --git a/test/libsolidity/semanticTests/abicoder/calldataDecoding/copy_from_calldata_removes_bytes_data.sol b/test/libsolidity/semanticTests/abicoder/calldataDecoding/copy_from_calldata_removes_bytes_data.sol index c3f2e8d751e5..1f087dc8cf92 100644 --- a/test/libsolidity/semanticTests/abicoder/calldataDecoding/copy_from_calldata_removes_bytes_data.sol +++ b/test/libsolidity/semanticTests/abicoder/calldataDecoding/copy_from_calldata_removes_bytes_data.sol @@ -9,7 +9,7 @@ contract c { // EVMVersion: >=byzantium // ---- // (): 1, 2, 3, 4, 5 -> -// gas irOptimized: 155122 +// gas irOptimized: 155130 // gas legacy: 155473 // gas legacyOptimized: 155296 // checkIfDataIsEmpty() -> false diff --git a/test/libsolidity/semanticTests/array/byte_array_transitional_2.sol b/test/libsolidity/semanticTests/array/byte_array_transitional_2.sol index e83cc545809d..8d711f26acc4 100644 --- a/test/libsolidity/semanticTests/array/byte_array_transitional_2.sol +++ b/test/libsolidity/semanticTests/array/byte_array_transitional_2.sol @@ -19,4 +19,4 @@ contract c { // test() -> 0 // gas irOptimized: 122717 // gas legacy: 147108 -// gas legacyOptimized: 144200 +// gas legacyOptimized: 143790 diff --git a/test/libsolidity/semanticTests/array/copying/array_of_struct_memory_to_storage.sol b/test/libsolidity/semanticTests/array/copying/array_of_struct_memory_to_storage.sol index 5b3fe1f7016f..35f896f26e22 100644 --- a/test/libsolidity/semanticTests/array/copying/array_of_struct_memory_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/array_of_struct_memory_to_storage.sol @@ -19,4 +19,4 @@ contract C { // compileViaYul: true // ---- // f() -> 10, 11, 12 -// gas irOptimized: 118796 +// gas irOptimized: 118834 diff --git a/test/libsolidity/semanticTests/array/copying/array_storage_multi_items_per_slot.sol b/test/libsolidity/semanticTests/array/copying/array_storage_multi_items_per_slot.sol index 3578f0a81e73..486511fdccfd 100644 --- a/test/libsolidity/semanticTests/array/copying/array_storage_multi_items_per_slot.sol +++ b/test/libsolidity/semanticTests/array/copying/array_storage_multi_items_per_slot.sol @@ -12,6 +12,6 @@ contract C { } // ---- // f() -> 1, 2, 3 -// gas irOptimized: 131939 +// gas irOptimized: 131953 // gas legacy: 134605 -// gas legacyOptimized: 131938 +// gas legacyOptimized: 131952 diff --git a/test/libsolidity/semanticTests/array/copying/calldata_array_to_mapping.sol b/test/libsolidity/semanticTests/array/copying/calldata_array_to_mapping.sol index 48460586d280..938f1c6994f0 100644 --- a/test/libsolidity/semanticTests/array/copying/calldata_array_to_mapping.sol +++ b/test/libsolidity/semanticTests/array/copying/calldata_array_to_mapping.sol @@ -14,4 +14,4 @@ contract C { // compileViaYul: true // ---- // from_calldata(uint8[][]): 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14 -> 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14 -// gas irOptimized: 139587 +// gas irOptimized: 139651 diff --git a/test/libsolidity/semanticTests/array/copying/storage_memory_nested.sol b/test/libsolidity/semanticTests/array/copying/storage_memory_nested.sol index 2a486d256355..b9652316d2e6 100644 --- a/test/libsolidity/semanticTests/array/copying/storage_memory_nested.sol +++ b/test/libsolidity/semanticTests/array/copying/storage_memory_nested.sol @@ -17,6 +17,6 @@ contract C { } // ---- // f() -> 1, 2, 3, 4, 5, 6, 7 -// gas irOptimized: 206440 +// gas irOptimized: 206419 // gas legacy: 211758 -// gas legacyOptimized: 211179 +// gas legacyOptimized: 210977 diff --git a/test/libsolidity/semanticTests/array/copying/storage_memory_nested_from_pointer.sol b/test/libsolidity/semanticTests/array/copying/storage_memory_nested_from_pointer.sol index 5ec2cbcf43dc..0dd1594fd0db 100644 --- a/test/libsolidity/semanticTests/array/copying/storage_memory_nested_from_pointer.sol +++ b/test/libsolidity/semanticTests/array/copying/storage_memory_nested_from_pointer.sol @@ -18,6 +18,6 @@ contract C { } // ---- // f() -> 1, 2, 3, 4, 5, 6, 7 -// gas irOptimized: 206440 +// gas irOptimized: 206419 // gas legacy: 211770 -// gas legacyOptimized: 211191 +// gas legacyOptimized: 210989 diff --git a/test/libsolidity/semanticTests/array/copying/storage_memory_nested_struct.sol b/test/libsolidity/semanticTests/array/copying/storage_memory_nested_struct.sol index b37aa96ea6e0..8412c7f0621d 100644 --- a/test/libsolidity/semanticTests/array/copying/storage_memory_nested_struct.sol +++ b/test/libsolidity/semanticTests/array/copying/storage_memory_nested_struct.sol @@ -24,6 +24,6 @@ contract C { } // ---- // f() -> 11, 0x0c, 1, 0x15, 22, 4 -// gas irOptimized: 291212 +// gas irOptimized: 291340 // gas legacy: 293398 // gas legacyOptimized: 290218 diff --git a/test/libsolidity/semanticTests/array/create_memory_array.sol b/test/libsolidity/semanticTests/array/create_memory_array.sol index 00f32a6e0860..ebe84c045130 100644 --- a/test/libsolidity/semanticTests/array/create_memory_array.sol +++ b/test/libsolidity/semanticTests/array/create_memory_array.sol @@ -18,6 +18,6 @@ contract C { } // ---- // f() -> "A", 8, 4, "B" -// gas irOptimized: 136664 +// gas irOptimized: 136655 // gas legacy: 121380 -// gas legacyOptimized: 115488 +// gas legacyOptimized: 115462 diff --git a/test/libsolidity/semanticTests/array/fixed_arrays_as_return_type.sol b/test/libsolidity/semanticTests/array/fixed_arrays_as_return_type.sol index e4bf3a7197e7..05dd9630c215 100644 --- a/test/libsolidity/semanticTests/array/fixed_arrays_as_return_type.sol +++ b/test/libsolidity/semanticTests/array/fixed_arrays_as_return_type.sol @@ -18,9 +18,9 @@ contract B { } // ---- // f() -> 2, 3, 4, 5, 6, 1000, 1001, 1002, 1003, 1004 -// gas irOptimized: 59212 +// gas irOptimized: 59208 // gas irOptimized code: 56600 // gas legacy: 68001 // gas legacy code: 162000 -// gas legacyOptimized: 59997 +// gas legacyOptimized: 59989 // gas legacyOptimized code: 70600 diff --git a/test/libsolidity/semanticTests/array/fixed_arrays_in_constructors.sol b/test/libsolidity/semanticTests/array/fixed_arrays_in_constructors.sol index 8e9780e3376f..544691d0929e 100644 --- a/test/libsolidity/semanticTests/array/fixed_arrays_in_constructors.sol +++ b/test/libsolidity/semanticTests/array/fixed_arrays_in_constructors.sol @@ -9,11 +9,11 @@ contract Creator { } // ---- // constructor(): 1, 2, 3, 4 -> -// gas irOptimized: 104102 -// gas irOptimized code: 22400 +// gas irOptimized: 103767 +// gas irOptimized code: 21800 // gas legacy: 115185 // gas legacy code: 59000 -// gas legacyOptimized: 104908 -// gas legacyOptimized code: 23800 +// gas legacyOptimized: 104565 +// gas legacyOptimized code: 22600 // r() -> 4 // ch() -> 3 diff --git a/test/libsolidity/semanticTests/array/function_array_cross_calls.sol b/test/libsolidity/semanticTests/array/function_array_cross_calls.sol index f3dea83bfbab..6997386a2006 100644 --- a/test/libsolidity/semanticTests/array/function_array_cross_calls.sol +++ b/test/libsolidity/semanticTests/array/function_array_cross_calls.sol @@ -42,9 +42,9 @@ contract C { } // ---- // test() -> 5, 6, 7 -// gas irOptimized: 86484 -// gas irOptimized code: 161200 +// gas irOptimized: 86728 +// gas irOptimized code: 155400 // gas legacy: 97551 // gas legacy code: 342800 -// gas legacyOptimized: 87808 -// gas legacyOptimized code: 193000 +// gas legacyOptimized: 87911 +// gas legacyOptimized code: 188600 diff --git a/test/libsolidity/semanticTests/array/pop/byte_array_pop_long_storage_empty.sol b/test/libsolidity/semanticTests/array/pop/byte_array_pop_long_storage_empty.sol index 18afa649c8c5..230f80bba035 100644 --- a/test/libsolidity/semanticTests/array/pop/byte_array_pop_long_storage_empty.sol +++ b/test/libsolidity/semanticTests/array/pop/byte_array_pop_long_storage_empty.sol @@ -16,7 +16,7 @@ contract c { } // ---- // test() -> true -// gas irOptimized: 138795 +// gas irOptimized: 138500 // gas legacy: 178396 -// gas legacyOptimized: 163832 +// gas legacyOptimized: 163569 // storageEmpty -> 1 diff --git a/test/libsolidity/semanticTests/array/push/array_push_struct_from_calldata.sol b/test/libsolidity/semanticTests/array/push/array_push_struct_from_calldata.sol index 254c14b061cf..b497a6813bd6 100644 --- a/test/libsolidity/semanticTests/array/push/array_push_struct_from_calldata.sol +++ b/test/libsolidity/semanticTests/array/push/array_push_struct_from_calldata.sol @@ -18,4 +18,4 @@ contract c { // test((uint16,uint16,uint16[3],uint16[])): 0x20, 2, 3, 0, 0, 4, 0xC0, 4, 0, 0, 5, 0, 0 -> 2, 3, 4, 5 // gas irOptimized: 137153 // gas legacy: 142414 -// gas legacyOptimized: 137975 +// gas legacyOptimized: 137999 diff --git a/test/libsolidity/semanticTests/array/push/byte_array_push_transition.sol b/test/libsolidity/semanticTests/array/push/byte_array_push_transition.sol index ffc47eaa395b..1958cc2798c6 100644 --- a/test/libsolidity/semanticTests/array/push/byte_array_push_transition.sol +++ b/test/libsolidity/semanticTests/array/push/byte_array_push_transition.sol @@ -17,4 +17,4 @@ contract c { // test() -> 0 // gas irOptimized: 167569 // gas legacy: 206218 -// gas legacyOptimized: 197297 +// gas legacyOptimized: 196478 diff --git a/test/libsolidity/semanticTests/array/reusing_memory.sol b/test/libsolidity/semanticTests/array/reusing_memory.sol index fd352dd61afd..ca1efa3d3b98 100644 --- a/test/libsolidity/semanticTests/array/reusing_memory.sol +++ b/test/libsolidity/semanticTests/array/reusing_memory.sol @@ -24,9 +24,9 @@ contract Main { } // ---- // f(uint256): 0x34 -> 0x46bddb1178e94d7f2892ff5f366840eb658911794f2c3a44c450aa2c505186c1 -// gas irOptimized: 99552 +// gas irOptimized: 99536 // gas irOptimized code: 12400 // gas legacy: 101551 // gas legacy code: 23600 -// gas legacyOptimized: 99612 +// gas legacyOptimized: 99608 // gas legacyOptimized code: 13400 diff --git a/test/libsolidity/semanticTests/constants/mask_tests.sol b/test/libsolidity/semanticTests/constants/mask_tests.sol new file mode 100644 index 000000000000..591988bfeb42 --- /dev/null +++ b/test/libsolidity/semanticTests/constants/mask_tests.sol @@ -0,0 +1,78 @@ +// test various masks, some generated by the compiler internally + +contract MaskTests { + struct FitsInU256 { + uint8 oneByte; + uint96 bigNightySixer; + uint64 sixtyFourMiddle; + uint16 sixteener; + uint72 seventyTwo; + } + + FitsInU256 first; + + constructor() { + first = FitsInU256(0x98, 0x010203040506070809a1b2c3, 0xdeadcafefeedbead, 0x1234, 0x102030405060708090); + } + + // the compiler generates masks for these functions + function firstOneByte() external view returns (uint8) { + return first.oneByte; + } + + function firstBigNightySixer() external view returns (uint96) { + return first.bigNightySixer; + } + + function firstSixtyFourMiddle() external view returns (uint64) { + return first.sixtyFourMiddle; + } + + function firstSixteener() external view returns (uint16) { + return first.sixteener; + } + + function firstSeventyTwo() external view returns (uint72) { + return first.seventyTwo; + } + + function setMiddleSixtyFour(uint64 x) external returns (uint96) { + first.sixtyFourMiddle = x; + return first.bigNightySixer + first.sixtyFourMiddle + first.sixteener; + } + + // hand coded masks + function add55(uint x) external pure returns (uint) { + return x + ((uint(1) << 55) - 1); + } + + function add155(uint x) external pure returns (uint) { + return x + ((uint(1) << 155) - 1); + } + + function add55shift(uint x) external pure returns (uint) { + return x + (((uint(1) << 55) - 1) << 67); + } + + function add155shift(uint x) external pure returns (uint) { + return x + (((uint(1) << 155) - 1) << 67); + } +} +// ==== +// EVMVersion: =current +// ---- +// firstOneByte() -> 0x98 +// firstBigNightySixer() -> 0x010203040506070809a1b2c3 +// firstSixtyFourMiddle() -> 0xdeadcafefeedbead +// firstSixteener() -> 0x1234 +// firstSeventyTwo() -> 0x102030405060708090 +// add55(uint256): 1 -> 0x80000000000000 +// add55(uint256): 2 -> 0x80000000000001 +// add55(uint256): 0x1000000000000000 -> 0x107fffffffffffff +// add155(uint256): 1 -> 0x800000000000000000000000000000000000000 +// add55shift(uint256): 1 -> 0x3fffffffffffff80000000000000001 +// add55shift(uint256): 0x80000000000000000 -> 0x4000000000000000000000000000000 +// add155shift(uint256): 1 -> 0x3ffffffffffffffffffffffffffffffffffffff80000000000000001 +// add155shift(uint256): 0x80000000000000000 -> 0x40000000000000000000000000000000000000000000000000000000 +// setMiddleSixtyFour(uint64): 0 -> 0x010203040506070809a1c4f7 +// setMiddleSixtyFour(uint64): 0xffffffffffffffff -> 0x010203050506070809a1c4f6 diff --git a/test/libsolidity/semanticTests/constructor/constructor_arguments_external.sol b/test/libsolidity/semanticTests/constructor/constructor_arguments_external.sol index e59cb4214a23..3e3c4bdabcbf 100644 --- a/test/libsolidity/semanticTests/constructor/constructor_arguments_external.sol +++ b/test/libsolidity/semanticTests/constructor/constructor_arguments_external.sol @@ -19,11 +19,11 @@ contract Main { // bytecodeFormat: legacy,>=EOFv1 // ---- // constructor(): "abc", true -// gas irOptimized: 80174 -// gas irOptimized code: 24200 +// gas irOptimized: 80022 +// gas irOptimized code: 23600 // gas legacy: 85098 // gas legacy code: 58200 -// gas legacyOptimized: 80132 -// gas legacyOptimized code: 22800 +// gas legacyOptimized: 80021 +// gas legacyOptimized code: 22200 // getFlag() -> true // getName() -> "abc" diff --git a/test/libsolidity/semanticTests/constructor/no_callvalue_check.sol b/test/libsolidity/semanticTests/constructor/no_callvalue_check.sol index a46b6a6a8e8d..2d08d2d8efa5 100644 --- a/test/libsolidity/semanticTests/constructor/no_callvalue_check.sol +++ b/test/libsolidity/semanticTests/constructor/no_callvalue_check.sol @@ -19,7 +19,7 @@ contract C { // EVMVersion: >=constantinople // ---- // f(), 2000 ether -> true -// gas irOptimized: 117688 +// gas irOptimized: 117712 // gas irOptimized code: 1800 // gas legacy: 117889 // gas legacy code: 4800 diff --git a/test/libsolidity/semanticTests/errors/small_error_optimization.sol b/test/libsolidity/semanticTests/errors/small_error_optimization.sol index 8128193b7056..61e8f219bb45 100644 --- a/test/libsolidity/semanticTests/errors/small_error_optimization.sol +++ b/test/libsolidity/semanticTests/errors/small_error_optimization.sol @@ -14,9 +14,9 @@ contract B { } // ---- // f() -> FAILURE, hex"92bbf6e8" -// gas irOptimized: 221918 +// gas irOptimized: 221914 // gas irOptimized code: 42800 // gas legacy: 233752 // gas legacy code: 38000 -// gas legacyOptimized: 224863 +// gas legacyOptimized: 224859 // gas legacyOptimized code: 34200 diff --git a/test/libsolidity/semanticTests/events/event_emit_from_other_contract.sol b/test/libsolidity/semanticTests/events/event_emit_from_other_contract.sol index e6d800d9b229..77f816f30e08 100644 --- a/test/libsolidity/semanticTests/events/event_emit_from_other_contract.sol +++ b/test/libsolidity/semanticTests/events/event_emit_from_other_contract.sol @@ -19,11 +19,11 @@ contract C { // bytecodeFormat: legacy // ---- // constructor() -> -// gas irOptimized: 113970 -// gas irOptimized code: 51400 +// gas irOptimized: 113747 +// gas irOptimized code: 50800 // gas legacy: 119791 // gas legacy code: 125200 -// gas legacyOptimized: 114187 -// gas legacyOptimized code: 57400 +// gas legacyOptimized: 114016 +// gas legacyOptimized code: 56800 // deposit(bytes32), 18 wei: 0x1234 -> // ~ emit Deposit(address,bytes32,uint256) from 0x137aa4dfc0911524504fcd4d98501f179bc13b4a: #0xc06afe3a8444fc0004668591e8306bfb9968e79e, #0x1234, 0x00 diff --git a/test/libsolidity/semanticTests/functionCall/creation_function_call_with_args.sol b/test/libsolidity/semanticTests/functionCall/creation_function_call_with_args.sol index 08e9f36f5981..1932d3448d24 100644 --- a/test/libsolidity/semanticTests/functionCall/creation_function_call_with_args.sol +++ b/test/libsolidity/semanticTests/functionCall/creation_function_call_with_args.sol @@ -15,10 +15,10 @@ contract D { } // ---- // constructor(): 2 -> -// gas irOptimized: 138930 -// gas irOptimized code: 53800 +// gas irOptimized: 138598 +// gas irOptimized code: 53200 // gas legacy: 145569 // gas legacy code: 95600 -// gas legacyOptimized: 138297 -// gas legacyOptimized code: 54600 +// gas legacyOptimized: 138078 +// gas legacyOptimized code: 53400 // f() -> 2 diff --git a/test/libsolidity/semanticTests/functionCall/creation_function_call_with_salt.sol b/test/libsolidity/semanticTests/functionCall/creation_function_call_with_salt.sol index 320b105637f1..c758bab09958 100644 --- a/test/libsolidity/semanticTests/functionCall/creation_function_call_with_salt.sol +++ b/test/libsolidity/semanticTests/functionCall/creation_function_call_with_salt.sol @@ -17,10 +17,10 @@ contract D { // EVMVersion: >=constantinople // ---- // constructor(): 2 -> -// gas irOptimized: 139112 -// gas irOptimized code: 53800 +// gas irOptimized: 138774 +// gas irOptimized code: 53200 // gas legacy: 145935 // gas legacy code: 95600 -// gas legacyOptimized: 138529 -// gas legacyOptimized code: 54600 +// gas legacyOptimized: 138310 +// gas legacyOptimized code: 53400 // f() -> 2 diff --git a/test/libsolidity/semanticTests/functionCall/external_call_to_nonexisting.sol b/test/libsolidity/semanticTests/functionCall/external_call_to_nonexisting.sol index 0031059c021a..a59b86712981 100644 --- a/test/libsolidity/semanticTests/functionCall/external_call_to_nonexisting.sol +++ b/test/libsolidity/semanticTests/functionCall/external_call_to_nonexisting.sol @@ -24,12 +24,12 @@ contract C { // bytecodeFormat: legacy // ---- // constructor(), 1 ether -> -// gas irOptimized: 88853 -// gas irOptimized code: 164400 +// gas irOptimized: 88320 +// gas irOptimized code: 158400 // gas legacy: 102721 // gas legacy code: 334400 -// gas legacyOptimized: 91499 -// gas legacyOptimized code: 196400 +// gas legacyOptimized: 90894 +// gas legacyOptimized code: 189800 // f(uint256): 0 -> FAILURE // f(uint256): 1 -> FAILURE // f(uint256): 2 -> FAILURE diff --git a/test/libsolidity/semanticTests/functionCall/external_call_to_nonexisting_debugstrings.sol b/test/libsolidity/semanticTests/functionCall/external_call_to_nonexisting_debugstrings.sol index a8eafb38ea1a..71c8a35f87ee 100644 --- a/test/libsolidity/semanticTests/functionCall/external_call_to_nonexisting_debugstrings.sol +++ b/test/libsolidity/semanticTests/functionCall/external_call_to_nonexisting_debugstrings.sol @@ -22,16 +22,16 @@ contract C { } // ==== // EVMVersion: >=byzantium -// revertStrings: debug // bytecodeFormat: legacy +// revertStrings: debug // ---- // constructor(), 1 ether -> -// gas irOptimized: 98698 -// gas irOptimized code: 284200 +// gas irOptimized: 98141 +// gas irOptimized code: 278200 // gas legacy: 123258 // gas legacy code: 682400 -// gas legacyOptimized: 106969 -// gas legacyOptimized code: 386400 +// gas legacyOptimized: 106364 +// gas legacyOptimized code: 379800 // f(uint256): 0 -> FAILURE, hex"08c379a0", 0x20, 37, "Target contract does not contain", " code" // f(uint256): 1 -> FAILURE, hex"08c379a0", 0x20, 37, "Target contract does not contain", " code" // f(uint256): 2 -> FAILURE, hex"08c379a0", 0x20, 37, "Target contract does not contain", " code" diff --git a/test/libsolidity/semanticTests/functionCall/failed_create.sol b/test/libsolidity/semanticTests/functionCall/failed_create.sol index 87bd12d58b75..063dbf10c867 100644 --- a/test/libsolidity/semanticTests/functionCall/failed_create.sol +++ b/test/libsolidity/semanticTests/functionCall/failed_create.sol @@ -17,8 +17,8 @@ contract C { // EVMVersion: >=constantinople // ---- // constructor(), 20 wei -// gas irOptimized: 59688 -// gas irOptimized code: 81800 +// gas irOptimized: 59496 +// gas irOptimized code: 79400 // gas legacy: 64468 // gas legacy code: 145400 // gas legacyOptimized: 60443 diff --git a/test/libsolidity/semanticTests/functionCall/gas_and_value_basic.sol b/test/libsolidity/semanticTests/functionCall/gas_and_value_basic.sol index 7415accabcd2..d7b7c27b0125 100644 --- a/test/libsolidity/semanticTests/functionCall/gas_and_value_basic.sol +++ b/test/libsolidity/semanticTests/functionCall/gas_and_value_basic.sol @@ -38,12 +38,12 @@ contract test { // bytecodeFormat: legacy // ---- // constructor(), 20 wei -> -// gas irOptimized: 120218 -// gas irOptimized code: 132000 +// gas irOptimized: 119899 +// gas irOptimized code: 130200 // gas legacy: 130583 // gas legacy code: 261200 -// gas legacyOptimized: 121069 -// gas legacyOptimized code: 147000 +// gas legacyOptimized: 120706 +// gas legacyOptimized code: 144000 // sendAmount(uint256): 5 -> 5 // outOfGas() -> FAILURE # call to helper should not succeed but amount should be transferred anyway # // checkState() -> false, 15 diff --git a/test/libsolidity/semanticTests/functionTypes/store_function.sol b/test/libsolidity/semanticTests/functionTypes/store_function.sol index 904bc705f725..4e63272f3968 100644 --- a/test/libsolidity/semanticTests/functionTypes/store_function.sol +++ b/test/libsolidity/semanticTests/functionTypes/store_function.sol @@ -29,5 +29,5 @@ contract C { // gas irOptimized code: 19000 // gas legacy: 79492 // gas legacy code: 69600 -// gas legacyOptimized: 77587 +// gas legacyOptimized: 77583 // gas legacyOptimized code: 28600 diff --git a/test/libsolidity/semanticTests/immutable/immutable_tag_too_large_bug.sol b/test/libsolidity/semanticTests/immutable/immutable_tag_too_large_bug.sol index fed424628c0e..f67871eb9d89 100644 --- a/test/libsolidity/semanticTests/immutable/immutable_tag_too_large_bug.sol +++ b/test/libsolidity/semanticTests/immutable/immutable_tag_too_large_bug.sol @@ -41,8 +41,8 @@ contract C { // compileViaYul: true // ---- // constructor() -> -// gas irOptimized: 73171 -// gas irOptimized code: 291200 +// gas irOptimized: 73067 +// gas irOptimized code: 290600 // gas legacy: 83499 // gas legacy code: 408800 // f() -> -1, 1 diff --git a/test/libsolidity/semanticTests/immutable/multi_creation.sol b/test/libsolidity/semanticTests/immutable/multi_creation.sol index 515dd41bb1b1..4fb99372d0de 100644 --- a/test/libsolidity/semanticTests/immutable/multi_creation.sol +++ b/test/libsolidity/semanticTests/immutable/multi_creation.sol @@ -29,11 +29,11 @@ contract C { // EVMVersion: >=constantinople // ---- // f() -> 3, 7, 5 -// gas irOptimized: 86892 +// gas irOptimized: 86916 // gas irOptimized code: 37200 // gas legacy: 87839 // gas legacy code: 60800 -// gas legacyOptimized: 86870 +// gas legacyOptimized: 86862 // gas legacyOptimized code: 37200 // x() -> 7 // y() -> 5 diff --git a/test/libsolidity/semanticTests/immutable/use_scratch.sol b/test/libsolidity/semanticTests/immutable/use_scratch.sol index 432c3c207206..2ac583d600fa 100644 --- a/test/libsolidity/semanticTests/immutable/use_scratch.sol +++ b/test/libsolidity/semanticTests/immutable/use_scratch.sol @@ -15,7 +15,7 @@ contract C { } // ---- // constructor(): 3 -> -// gas irOptimized: 81194 +// gas irOptimized: 81138 // gas irOptimized code: 42400 // gas legacy: 88244 // gas legacy code: 109400 diff --git a/test/libsolidity/semanticTests/inheritance/constructor_with_params.sol b/test/libsolidity/semanticTests/inheritance/constructor_with_params.sol index c88802029258..338758fc28a7 100644 --- a/test/libsolidity/semanticTests/inheritance/constructor_with_params.sol +++ b/test/libsolidity/semanticTests/inheritance/constructor_with_params.sol @@ -9,7 +9,7 @@ contract C { } // ---- // constructor(): 2, 0 -> -// gas irOptimized: 81170 +// gas irOptimized: 81118 // gas irOptimized code: 20200 // gas legacy: 83613 // gas legacy code: 32000 diff --git a/test/libsolidity/semanticTests/inheritance/constructor_with_params_diamond_inheritance.sol b/test/libsolidity/semanticTests/inheritance/constructor_with_params_diamond_inheritance.sol index decb6fc259d4..648f01d0e3e3 100644 --- a/test/libsolidity/semanticTests/inheritance/constructor_with_params_diamond_inheritance.sol +++ b/test/libsolidity/semanticTests/inheritance/constructor_with_params_diamond_inheritance.sol @@ -21,7 +21,7 @@ contract D is B, C { } // ---- // constructor(): 2, 0 -> -// gas irOptimized: 124350 +// gas irOptimized: 124298 // gas irOptimized code: 27600 // gas legacy: 128222 // gas legacy code: 40400 diff --git a/test/libsolidity/semanticTests/inheritance/constructor_with_params_inheritance.sol b/test/libsolidity/semanticTests/inheritance/constructor_with_params_inheritance.sol index 097e2f8088c9..07fb1a7adfa2 100644 --- a/test/libsolidity/semanticTests/inheritance/constructor_with_params_inheritance.sol +++ b/test/libsolidity/semanticTests/inheritance/constructor_with_params_inheritance.sol @@ -12,7 +12,7 @@ contract D is C { } // ---- // constructor(): 2, 0 -> -// gas irOptimized: 101581 +// gas irOptimized: 101529 // gas irOptimized code: 20200 // gas legacy: 105192 // gas legacy code: 32000 diff --git a/test/libsolidity/semanticTests/inheritance/inherited_function_calldata_memory_interface.sol b/test/libsolidity/semanticTests/inheritance/inherited_function_calldata_memory_interface.sol index 36ed3706243a..99fc73ae386b 100644 --- a/test/libsolidity/semanticTests/inheritance/inherited_function_calldata_memory_interface.sol +++ b/test/libsolidity/semanticTests/inheritance/inherited_function_calldata_memory_interface.sol @@ -26,5 +26,5 @@ contract B { // gas irOptimized code: 42000 // gas legacy: 56839 // gas legacy code: 123600 -// gas legacyOptimized: 55001 -// gas legacyOptimized code: 60600 +// gas legacyOptimized: 55013 +// gas legacyOptimized code: 58200 diff --git a/test/libsolidity/semanticTests/inheritance/value_for_constructor.sol b/test/libsolidity/semanticTests/inheritance/value_for_constructor.sol index 39b25c005f0e..7092cd210f47 100644 --- a/test/libsolidity/semanticTests/inheritance/value_for_constructor.sol +++ b/test/libsolidity/semanticTests/inheritance/value_for_constructor.sol @@ -39,12 +39,12 @@ contract Main { } // ---- // constructor(), 22 wei -> -// gas irOptimized: 143864 -// gas irOptimized code: 118000 +// gas irOptimized: 143297 +// gas irOptimized code: 114400 // gas legacy: 156599 // gas legacy code: 236400 -// gas legacyOptimized: 143592 -// gas legacyOptimized code: 118000 +// gas legacyOptimized: 143022 +// gas legacyOptimized code: 113200 // getFlag() -> true // getName() -> "abc" // getBalances() -> 12, 10 diff --git a/test/libsolidity/semanticTests/inlineAssembly/transient_storage_selfdestruct.sol b/test/libsolidity/semanticTests/inlineAssembly/transient_storage_selfdestruct.sol index 26bb09edca7a..bd15299f4fce 100644 --- a/test/libsolidity/semanticTests/inlineAssembly/transient_storage_selfdestruct.sol +++ b/test/libsolidity/semanticTests/inlineAssembly/transient_storage_selfdestruct.sol @@ -41,15 +41,15 @@ contract D { // bytecodeFormat: legacy // ---- // constructor() -> -// gas irOptimized: 127596 -// gas irOptimized code: 221000 +// gas irOptimized: 126919 +// gas irOptimized code: 214800 // gas legacy: 149480 // gas legacy code: 501200 -// gas legacyOptimized: 125846 -// gas legacyOptimized code: 203400 +// gas legacyOptimized: 125119 +// gas legacyOptimized code: 196000 // destroy() -> // createAndDestroy() -> // gas legacy: 67048 // gas legacy code: 92600 -// gas legacyOptimized: 65677 -// gas legacyOptimized code: 39400 +// gas legacyOptimized: 65640 +// gas legacyOptimized code: 38200 diff --git a/test/libsolidity/semanticTests/libraries/internal_types_in_library.sol b/test/libsolidity/semanticTests/libraries/internal_types_in_library.sol index d59cedfdc860..9f65cc44789d 100644 --- a/test/libsolidity/semanticTests/libraries/internal_types_in_library.sol +++ b/test/libsolidity/semanticTests/libraries/internal_types_in_library.sol @@ -24,4 +24,4 @@ contract Test { // f() -> 4, 0x11 // gas irOptimized: 111419 // gas legacy: 132930 -// gas legacyOptimized: 118020 +// gas legacyOptimized: 118012 diff --git a/test/libsolidity/semanticTests/operators/userDefined/operator_making_pure_external_call.sol b/test/libsolidity/semanticTests/operators/userDefined/operator_making_pure_external_call.sol index b901cab0351a..c75659bfa381 100644 --- a/test/libsolidity/semanticTests/operators/userDefined/operator_making_pure_external_call.sol +++ b/test/libsolidity/semanticTests/operators/userDefined/operator_making_pure_external_call.sol @@ -58,12 +58,12 @@ contract C { // gas irOptimized code: 40600 // gas legacy: 57117 // gas legacy code: 127000 -// gas legacyOptimized: 55246 -// gas legacyOptimized code: 68400 +// gas legacyOptimized: 55242 +// gas legacyOptimized code: 68200 // testInc(int32): 42 -> 43 // gas irOptimized: 54621 // gas irOptimized code: 40600 // gas legacy: 56378 // gas legacy code: 127000 -// gas legacyOptimized: 54943 -// gas legacyOptimized code: 68400 +// gas legacyOptimized: 54944 +// gas legacyOptimized code: 68200 diff --git a/test/libsolidity/semanticTests/operators/userDefined/operator_making_view_external_call.sol b/test/libsolidity/semanticTests/operators/userDefined/operator_making_view_external_call.sol index 15501b3fc24e..009c7d969a8e 100644 --- a/test/libsolidity/semanticTests/operators/userDefined/operator_making_view_external_call.sol +++ b/test/libsolidity/semanticTests/operators/userDefined/operator_making_view_external_call.sol @@ -64,12 +64,12 @@ contract C { // gas irOptimized code: 40600 // gas legacy: 57117 // gas legacy code: 127000 -// gas legacyOptimized: 55246 -// gas legacyOptimized code: 68400 +// gas legacyOptimized: 55242 +// gas legacyOptimized code: 68200 // testInc(int32): 42 -> 43 // gas irOptimized: 54621 // gas irOptimized code: 40600 // gas legacy: 56378 // gas legacy code: 127000 -// gas legacyOptimized: 54943 -// gas legacyOptimized code: 68400 +// gas legacyOptimized: 54944 +// gas legacyOptimized code: 68200 diff --git a/test/libsolidity/semanticTests/saltedCreate/salted_create_with_value.sol b/test/libsolidity/semanticTests/saltedCreate/salted_create_with_value.sol index c810000e5b3c..bbc4fc11d0d3 100644 --- a/test/libsolidity/semanticTests/saltedCreate/salted_create_with_value.sol +++ b/test/libsolidity/semanticTests/saltedCreate/salted_create_with_value.sol @@ -22,9 +22,9 @@ contract A { // bytecodeFormat: legacy // ---- // f(), 10 ether -> 3007, 3008, 3009 -// gas irOptimized: 187022 +// gas irOptimized: 187046 // gas irOptimized code: 67200 // gas legacy: 190858 // gas legacy code: 190200 -// gas legacyOptimized: 187256 +// gas legacyOptimized: 187244 // gas legacyOptimized code: 92400 diff --git a/test/libsolidity/semanticTests/smoke/constructor.sol b/test/libsolidity/semanticTests/smoke/constructor.sol index d5c5280aef4b..8391b38cdc2d 100644 --- a/test/libsolidity/semanticTests/smoke/constructor.sol +++ b/test/libsolidity/semanticTests/smoke/constructor.sol @@ -12,7 +12,7 @@ contract C { } // ---- // constructor(), 2 wei: 3 -> -// gas irOptimized: 78996 +// gas irOptimized: 78944 // gas irOptimized code: 25400 // gas legacy: 83055 // gas legacy code: 65200 diff --git a/test/libsolidity/semanticTests/storage/packed_storage_structs_bytes.sol b/test/libsolidity/semanticTests/storage/packed_storage_structs_bytes.sol index 7d19bc47162e..08f6c5045914 100644 --- a/test/libsolidity/semanticTests/storage/packed_storage_structs_bytes.sol +++ b/test/libsolidity/semanticTests/storage/packed_storage_structs_bytes.sol @@ -42,6 +42,6 @@ contract C { } // ---- // test() -> true -// gas irOptimized: 132633 +// gas irOptimized: 132549 // gas legacy: 136010 -// gas legacyOptimized: 133478 +// gas legacyOptimized: 133394 diff --git a/test/libsolidity/semanticTests/storageLayoutSpecifier/constructor.sol b/test/libsolidity/semanticTests/storageLayoutSpecifier/constructor.sol index c30f9dab98a7..c5a90c134912 100644 --- a/test/libsolidity/semanticTests/storageLayoutSpecifier/constructor.sol +++ b/test/libsolidity/semanticTests/storageLayoutSpecifier/constructor.sol @@ -18,7 +18,7 @@ contract C is B layout at 7 { } // ---- // constructor(): 1, 2, 3 -// gas irOptimized: 104178 +// gas irOptimized: 104118 // gas irOptimized code: 30000 // gas legacy: 114749 // gas legacy code: 71400 diff --git a/test/libsolidity/semanticTests/storageLayoutSpecifier/storage_reference_array.sol b/test/libsolidity/semanticTests/storageLayoutSpecifier/storage_reference_array.sol index db14ef55874c..c173501288cb 100644 --- a/test/libsolidity/semanticTests/storageLayoutSpecifier/storage_reference_array.sol +++ b/test/libsolidity/semanticTests/storageLayoutSpecifier/storage_reference_array.sol @@ -14,7 +14,7 @@ contract C layout at 42 { } // ---- // initUsingReference() -> -// gas irOptimized: 273556 +// gas irOptimized: 273564 // gas legacy: 274795 // gas legacyOptimized: 271954 // array(uint256): 0 -> 1 diff --git a/test/libsolidity/semanticTests/structs/conversion/recursive_storage_memory.sol b/test/libsolidity/semanticTests/structs/conversion/recursive_storage_memory.sol index 8ec31a5c109a..f0e776237e46 100644 --- a/test/libsolidity/semanticTests/structs/conversion/recursive_storage_memory.sol +++ b/test/libsolidity/semanticTests/structs/conversion/recursive_storage_memory.sol @@ -23,6 +23,6 @@ contract CopyTest { } // ---- // run() -> 2, 23, 42 -// gas irOptimized: 192828 +// gas irOptimized: 194468 // gas legacy: 185730 // gas legacyOptimized: 184457 diff --git a/test/libsolidity/semanticTests/structs/memory_structs_nested_load.sol b/test/libsolidity/semanticTests/structs/memory_structs_nested_load.sol index 6785f2108b13..1950228d2cb9 100644 --- a/test/libsolidity/semanticTests/structs/memory_structs_nested_load.sol +++ b/test/libsolidity/semanticTests/structs/memory_structs_nested_load.sol @@ -66,7 +66,7 @@ contract Test { } // ---- // load() -> 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 -// gas irOptimized: 110772 +// gas irOptimized: 110777 // gas legacy: 112959 -// gas legacyOptimized: 110876 +// gas legacyOptimized: 110881 // store() -> 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 diff --git a/test/libsolidity/semanticTests/structs/struct_copy_calldata_to_storage_nested_dynamic_array_v2.sol b/test/libsolidity/semanticTests/structs/struct_copy_calldata_to_storage_nested_dynamic_array_v2.sol index 2767486131d8..e8888c51dcc4 100644 --- a/test/libsolidity/semanticTests/structs/struct_copy_calldata_to_storage_nested_dynamic_array_v2.sol +++ b/test/libsolidity/semanticTests/structs/struct_copy_calldata_to_storage_nested_dynamic_array_v2.sol @@ -16,6 +16,6 @@ contract C { } // ---- // f(uint32,(uint128,uint256[][2],uint32)): 55, 0x40, 77, 0x60, 88, 0x40, 0x40, 2, 1, 2 -> 55, 77, 1, 2, 88 -// gas irOptimized: 202902 +// gas irOptimized: 202946 // gas legacy: 207376 -// gas legacyOptimized: 203583 +// gas legacyOptimized: 203632 diff --git a/test/libsolidity/semanticTests/structs/struct_memory_to_storage_function_ptr.sol b/test/libsolidity/semanticTests/structs/struct_memory_to_storage_function_ptr.sol index 0de21947a4e7..1f8abcf66dbf 100644 --- a/test/libsolidity/semanticTests/structs/struct_memory_to_storage_function_ptr.sol +++ b/test/libsolidity/semanticTests/structs/struct_memory_to_storage_function_ptr.sol @@ -28,6 +28,6 @@ contract C { } // ---- // f() -> 42, 23, 34, 42, 42 -// gas irOptimized: 110682 +// gas irOptimized: 110722 // gas legacy: 111990 -// gas legacyOptimized: 110546 +// gas legacyOptimized: 110536 diff --git a/test/libsolidity/semanticTests/structs/structs.sol b/test/libsolidity/semanticTests/structs/structs.sol index 96503fa11e1f..1ddd55a521d8 100644 --- a/test/libsolidity/semanticTests/structs/structs.sol +++ b/test/libsolidity/semanticTests/structs/structs.sol @@ -30,7 +30,7 @@ contract test { // ---- // check() -> false // set() -> -// gas irOptimized: 134073 +// gas irOptimized: 134078 // gas legacy: 135243 -// gas legacyOptimized: 134062 +// gas legacyOptimized: 134067 // check() -> true diff --git a/test/libsolidity/semanticTests/userDefinedValueType/erc20.sol b/test/libsolidity/semanticTests/userDefinedValueType/erc20.sol index acd9ea840895..9dcc85cb15fc 100644 --- a/test/libsolidity/semanticTests/userDefinedValueType/erc20.sol +++ b/test/libsolidity/semanticTests/userDefinedValueType/erc20.sol @@ -113,12 +113,12 @@ contract ERC20 { // ---- // constructor() // ~ emit Transfer(address,address,uint256): #0x00, #0x1212121212121212121212121212120000000012, 0x14 -// gas irOptimized: 121322 -// gas irOptimized code: 234600 +// gas irOptimized: 120932 +// gas irOptimized code: 229800 // gas legacy: 163350 // gas legacy code: 671400 -// gas legacyOptimized: 127464 -// gas legacyOptimized code: 285400 +// gas legacyOptimized: 126678 +// gas legacyOptimized code: 277600 // totalSupply() -> 20 // gas irOptimized: 23334 // gas legacy: 23645 diff --git a/test/libsolidity/semanticTests/various/different_call_type_transient.sol b/test/libsolidity/semanticTests/various/different_call_type_transient.sol index 399cbd02dfa1..9abc50c006c2 100644 --- a/test/libsolidity/semanticTests/various/different_call_type_transient.sol +++ b/test/libsolidity/semanticTests/various/different_call_type_transient.sol @@ -46,6 +46,6 @@ contract Test { // testDelegate() -> 7, 0 // testCall() -> 0, 8 // testStatic() -> false -// gas irOptimized: 96900694 +// gas irOptimized: 96900693 // gas legacy: 96901136 -// gas legacyOptimized: 96900725 +// gas legacyOptimized: 96900724 diff --git a/test/libsolidity/semanticTests/various/erc20.sol b/test/libsolidity/semanticTests/various/erc20.sol index 13b914d9b80b..a42d398f0866 100644 --- a/test/libsolidity/semanticTests/various/erc20.sol +++ b/test/libsolidity/semanticTests/various/erc20.sol @@ -96,12 +96,12 @@ contract ERC20 { // ---- // constructor() // ~ emit Transfer(address,address,uint256): #0x00, #0x1212121212121212121212121212120000000012, 0x14 -// gas irOptimized: 121632 -// gas irOptimized code: 236800 +// gas irOptimized: 121248 +// gas irOptimized code: 232000 // gas legacy: 159957 // gas legacy code: 647600 -// gas legacyOptimized: 126934 -// gas legacyOptimized code: 282000 +// gas legacyOptimized: 126106 +// gas legacyOptimized code: 274200 // totalSupply() -> 20 // gas irOptimized: 23334 // gas legacy: 23519 diff --git a/test/libsolidity/semanticTests/various/many_subassemblies.sol b/test/libsolidity/semanticTests/various/many_subassemblies.sol index a320a2aa3eca..53d461d49668 100644 --- a/test/libsolidity/semanticTests/various/many_subassemblies.sol +++ b/test/libsolidity/semanticTests/various/many_subassemblies.sol @@ -32,7 +32,7 @@ contract D { // EVMVersion: >=constantinople // ---- // run() -> -// gas irOptimized: 375192 +// gas irOptimized: 375280 // gas irOptimized code: 6600 // gas legacy: 375404 // gas legacy code: 17600 diff --git a/test/libsolidity/semanticTests/various/selfdestruct_post_cancun.sol b/test/libsolidity/semanticTests/various/selfdestruct_post_cancun.sol index bf70caee5b54..414c17732e4f 100644 --- a/test/libsolidity/semanticTests/various/selfdestruct_post_cancun.sol +++ b/test/libsolidity/semanticTests/various/selfdestruct_post_cancun.sol @@ -65,12 +65,12 @@ contract D { // bytecodeFormat: legacy // ---- // constructor(), 1 ether -> -// gas irOptimized: 67028 -// gas irOptimized code: 175400 +// gas irOptimized: 66279 +// gas irOptimized code: 166200 // gas legacy: 76227 // gas legacy code: 298200 -// gas legacyOptimized: 66516 -// gas legacyOptimized code: 168000 +// gas legacyOptimized: 66074 +// gas legacyOptimized code: 162400 // exists() -> false // test_create_and_terminate() -> // exists() -> false diff --git a/test/libsolidity/semanticTests/various/selfdestruct_post_cancun_multiple_beneficiaries.sol b/test/libsolidity/semanticTests/various/selfdestruct_post_cancun_multiple_beneficiaries.sol index 7629fabc1ce2..3c09594846f7 100644 --- a/test/libsolidity/semanticTests/various/selfdestruct_post_cancun_multiple_beneficiaries.sol +++ b/test/libsolidity/semanticTests/various/selfdestruct_post_cancun_multiple_beneficiaries.sol @@ -36,23 +36,23 @@ contract D { // bytecodeFormat: legacy // ---- // constructor(), 2 ether -> -// gas irOptimized: 108104 -// gas irOptimized code: 119200 +// gas irOptimized: 107630 +// gas irOptimized code: 114400 // gas legacy: 120439 // gas legacy code: 253800 -// gas legacyOptimized: 109015 -// gas legacyOptimized code: 130800 +// gas legacyOptimized: 108382 +// gas legacyOptimized code: 124000 // balance: 0x1111111111111111111111111111111111111111 -> 0 // balance: 0x2222222222222222222222222222222222222222 -> 0 // balance -> 2000000000000000000 // exists() -> false // test_deploy_and_terminate_twice() -> -// gas irOptimized: 121395 -// gas irOptimized code: 14000 +// gas irOptimized: 121363 +// gas irOptimized code: 13400 // gas legacy: 122386 // gas legacy code: 43200 -// gas legacyOptimized: 121596 -// gas legacyOptimized code: 22800 +// gas legacyOptimized: 121545 +// gas legacyOptimized code: 21600 // exists() -> false // balance: 0x1111111111111111111111111111111111111111 -> 1000000000000000000 // balance: 0x2222222222222222222222222222222222222222 -> 0 diff --git a/test/libsolidity/semanticTests/various/selfdestruct_post_cancun_redeploy.sol b/test/libsolidity/semanticTests/various/selfdestruct_post_cancun_redeploy.sol index c9f50046c07d..ecb0e7123659 100644 --- a/test/libsolidity/semanticTests/various/selfdestruct_post_cancun_redeploy.sol +++ b/test/libsolidity/semanticTests/various/selfdestruct_post_cancun_redeploy.sol @@ -83,20 +83,20 @@ contract D { // bytecodeFormat: legacy // ---- // constructor(), 1 ether -> -// gas irOptimized: 132974 -// gas irOptimized code: 293800 +// gas irOptimized: 131902 +// gas irOptimized code: 282800 // gas legacy: 151236 // gas legacy code: 533800 -// gas legacyOptimized: 131436 -// gas legacyOptimized code: 276600 +// gas legacyOptimized: 130256 +// gas legacyOptimized code: 263600 // exists() -> false // test_deploy_and_terminate() -> // ~ emit Deployed(address,bytes32) from 0x137aa4dfc0911524504fcd4d98501f179bc13b4a: 0x7e6580007e709ac52945fae182c61131d42634e8, 0x1234000000000000000000000000000000000000000000000000000000000000 -// gas irOptimized: 96528 +// gas irOptimized: 96480 // gas irOptimized code: 20800 // gas legacy: 97788 // gas legacy code: 20800 -// gas legacyOptimized: 96043 +// gas legacyOptimized: 95984 // gas legacyOptimized code: 20800 // exists() -> false // deploy_create2() -> @@ -107,6 +107,6 @@ contract D { // test_balance_after_selfdestruct() -> // exists() -> true // deploy_create2() -> FAILURE -// gas irOptimized: 96903654 +// gas irOptimized: 96903653 // gas legacy: 96903658 // gas legacyOptimized: 96903639 diff --git a/test/libsolidity/semanticTests/various/senders_balance.sol b/test/libsolidity/semanticTests/various/senders_balance.sol index fff16befe69e..73c728feb656 100644 --- a/test/libsolidity/semanticTests/various/senders_balance.sol +++ b/test/libsolidity/semanticTests/various/senders_balance.sol @@ -16,10 +16,10 @@ contract D { } // ---- // constructor(), 27 wei -> -// gas irOptimized: 114057 -// gas irOptimized code: 53800 +// gas irOptimized: 113834 +// gas irOptimized code: 53200 // gas legacy: 117834 // gas legacy code: 100600 -// gas legacyOptimized: 113676 -// gas legacyOptimized code: 53600 +// gas legacyOptimized: 113457 +// gas legacyOptimized code: 52400 // f() -> 27 diff --git a/test/libsolidity/semanticTests/various/staticcall_for_view_and_pure.sol b/test/libsolidity/semanticTests/various/staticcall_for_view_and_pure.sol index 2a9834aab7e8..6190c104e115 100644 --- a/test/libsolidity/semanticTests/various/staticcall_for_view_and_pure.sol +++ b/test/libsolidity/semanticTests/various/staticcall_for_view_and_pure.sol @@ -45,7 +45,7 @@ contract D { // gas legacyOptimized: 98425379 // gas legacyOptimized code: 13200 // fpure() -> FAILURE -// gas irOptimized: 98425388 +// gas irOptimized: 98425389 // gas irOptimized code: 13200 // gas legacy: 98413173 // gas legacy code: 25600 diff --git a/test/libsolidity/semanticTests/viaYul/copy_struct_invalid_ir_bug.sol b/test/libsolidity/semanticTests/viaYul/copy_struct_invalid_ir_bug.sol index 0db482c040db..da7007742253 100644 --- a/test/libsolidity/semanticTests/viaYul/copy_struct_invalid_ir_bug.sol +++ b/test/libsolidity/semanticTests/viaYul/copy_struct_invalid_ir_bug.sol @@ -21,6 +21,6 @@ contract C { } // ---- // f() -> -// gas irOptimized: 113117 +// gas irOptimized: 113091 // gas legacy: 112888 -// gas legacyOptimized: 112580 +// gas legacyOptimized: 112562 diff --git a/test/libyul/objectCompiler/identical_subobjects_creation_deployed.yul b/test/libyul/objectCompiler/identical_subobjects_creation_deployed.yul index 4a29c1498d0e..8829de2327ab 100644 --- a/test/libyul/objectCompiler/identical_subobjects_creation_deployed.yul +++ b/test/libyul/objectCompiler/identical_subobjects_creation_deployed.yul @@ -65,42 +65,43 @@ object "A" { } // ==== // EVMVersion: >=constantinople +// bytecodeFormat: legacy // optimizationPreset: full // outputs: Assembly // ---- // Assembly: -// sstore(calldataload(sub(shl(0xff, 0x01), shl(0x7f, 0x01))), calldataload(0x01)) +// sstore(calldataload(shl(0x7f, shr(0x80, not(0x00)))), calldataload(0x01)) // stop // stop // // sub_0: assembly { -// sstore(calldataload(shl(0x7f, 0xffffffffffffffffffffffffffffffff)), calldataload(0x01)) +// sstore(calldataload(shl(0x7f, shr(0x80, not(0x00)))), calldataload(0x01)) // stop // stop // // sub_0: assembly { -// sstore(calldataload(sub(shl(0xff, 0x01), shl(0x7f, 0x01))), calldataload(0x01)) +// sstore(calldataload(shl(0x7f, shr(0x80, not(0x00)))), calldataload(0x01)) // stop // stop // // sub_0: assembly { -// sstore(calldataload(shl(0x7f, 0xffffffffffffffffffffffffffffffff)), calldataload(0x01)) +// sstore(calldataload(shl(0x7f, shr(0x80, not(0x00)))), calldataload(0x01)) // stop // } // // sub_1: assembly { -// sstore(calldataload(sub(shl(0xff, 0x01), shl(0x7f, 0x01))), calldataload(0x01)) +// sstore(calldataload(shl(0x7f, shr(0x80, not(0x00)))), calldataload(0x01)) // stop // } // } // } // // sub_1: assembly { -// sstore(calldataload(shl(0x7f, 0xffffffffffffffffffffffffffffffff)), calldataload(0x01)) +// sstore(calldataload(shl(0x7f, shr(0x80, not(0x00)))), calldataload(0x01)) // stop // } // // sub_2: assembly { -// sstore(calldataload(sub(shl(0xff, 0x01), shl(0x7f, 0x01))), calldataload(0x01)) +// sstore(calldataload(shl(0x7f, shr(0x80, not(0x00)))), calldataload(0x01)) // stop // } From 8ec3bc48c3cc4d3f8cd46dfcfe449b774b39e78a Mon Sep 17 00:00:00 2001 From: Mohammad Rezaei Date: Fri, 16 May 2025 17:17:38 -0400 Subject: [PATCH 3/7] formatting and comments --- Changelog.md | 3 +- libevmasm/ConstantOptimiser.cpp | 50 ++-- ...sm => constant_optimizer_masks_runs_0.asm} | 270 ------------------ ... => constant_optimizer_masks_runs_200.asm} | 270 ------------------ ...m => constant_optimizer_masks_runs_2M.asm} | 270 ------------------ 5 files changed, 23 insertions(+), 840 deletions(-) rename test/libevmasm/evmAssemblyTests/{constant_optimizer_runs_0.asm => constant_optimizer_masks_runs_0.asm} (61%) rename test/libevmasm/evmAssemblyTests/{constant_optimizer_runs_200.asm => constant_optimizer_masks_runs_200.asm} (57%) rename test/libevmasm/evmAssemblyTests/{constant_optimizer_runs_2M.asm => constant_optimizer_masks_runs_2M.asm} (62%) diff --git a/Changelog.md b/Changelog.md index 84d2915270d7..ca7db5ff1196 100644 --- a/Changelog.md +++ b/Changelog.md @@ -3,6 +3,7 @@ Language Features: Compiler Features: +* Constant Optimizer: Compute masks using shifts when optimizing for size; use an ``--optimizer-runs`` value less than 200 for maximum size reduction. Bugfixes: * NatSpec: Disallow `@return` tag in event documentation. @@ -96,8 +97,6 @@ Compiler Features: * EVM: Set default EVM Version to `prague`. * NatSpec: Capture Natspec documentation of `enum` values in the AST. -* Constant Optimizer: Compute masks using shifts when optimizing for size; use an ``--optimizer-runs`` value less than 200 for maximum size reduction. - Bugfixes: * SMTChecker: Do not consider loop conditions as constant-condition verification target as this could cause incorrect reports and internal compiler errors. * SMTChecker: Fix incorrect analysis when only a subset of contracts is selected with `--model-checker-contracts`. diff --git a/libevmasm/ConstantOptimiser.cpp b/libevmasm/ConstantOptimiser.cpp index 467c84170ea5..18967ed20ae9 100644 --- a/libevmasm/ConstantOptimiser.cpp +++ b/libevmasm/ConstantOptimiser.cpp @@ -255,13 +255,21 @@ AssemblyItems ComputeMethod::findRepresentation(u256 const& _value) return AssemblyItems{_value}; // check for masks first + // high ones low zeros + // |----------||--------------| + // 0x000000000000000000000000000000000000ffffffffffff0000000000000000 unsigned lowZeros = 0; unsigned highOnes = 0; - for (; ((_value >> lowZeros) & 1) == 0 && lowZeros < 256; lowZeros++) {} - for (; ((_value >> (lowZeros + highOnes)) & 1) == 1 && highOnes < 256; highOnes++) {} - if (m_params.evmVersion.hasBitwiseShifting() && highOnes > 32 && - ((_value >> (lowZeros + highOnes)) == 0) && - ((lowZeros + highOnes < 256) || lowZeros > 16)) + while (((_value >> lowZeros) & 1) == 0 && lowZeros < 256) + ++lowZeros; + while (((_value >> (lowZeros + highOnes)) & 1) == 1 && highOnes < 256) + ++highOnes; + if ( + m_params.evmVersion.hasBitwiseShifting() && + highOnes > 32 && // push would be more efficient otherwise + ((_value >> (lowZeros + highOnes)) == 0) && // this is a pure mask + ((lowZeros + highOnes < 256) || lowZeros > 16) // otherwise negation is more effective + ) { // this is a big enough mask to use zero negation AssemblyItems newRoutine = AssemblyItems{u256(0), Instruction::NOT}; @@ -271,29 +279,15 @@ AssemblyItems ComputeMethod::findRepresentation(u256 const& _value) newRoutine += AssemblyItems{u256(lowZeros), Instruction::SHL}; return newRoutine; } - // check powers of 10 - u256 divBy10 = _value; - unsigned pow10 = 0; - while (divBy10 > 0 && divBy10 % 10 == 0) - { - divBy10 = divBy10 / 10; - pow10++; - } - // 10^9 = 0x3b9aca00; requires 5 bytes with PUSH4; also 5 bytes with PUSH 5 PUSH 10 EXP - if (pow10 > 9 && divBy10 == 1) - { - // pure power of 10 - return AssemblyItems{u256(pow10), u256(10), Instruction::EXP}; - } - // 10^x * y can be encoded as: push x push 10 exp push y mul. That's about 7 bytes more than plain push - if (pow10 > 12) - { - AssemblyItems newRoutine = findRepresentation(divBy10); - newRoutine += AssemblyItems{u256(pow10), u256(10), Instruction::EXP, Instruction::MUL}; - return newRoutine; - } - if (numberEncodingSize(~_value) < numberEncodingSize(_value) && - (lowZeros+highOnes < 256 || highOnes > 16)) + // pure negation can sometimes produce bad results + // example: 0xff00000000000000000000000000000000000000000000000000000000000000 + // 0xff at the most significant byte of u256 + // without the extra condition: not(sub(shl(0xf8, 0x01), 0x01)) + // the extra condition turns that into: shl(0xf8, 0xff) + if ( + numberEncodingSize(~_value) < numberEncodingSize(_value) && + (lowZeros+highOnes < 256 || highOnes > 16) + ) // Negated is shorter to represent return findRepresentation(~_value) + AssemblyItems{Instruction::NOT}; else diff --git a/test/libevmasm/evmAssemblyTests/constant_optimizer_runs_0.asm b/test/libevmasm/evmAssemblyTests/constant_optimizer_masks_runs_0.asm similarity index 61% rename from test/libevmasm/evmAssemblyTests/constant_optimizer_runs_0.asm rename to test/libevmasm/evmAssemblyTests/constant_optimizer_masks_runs_0.asm index 9f87847c7632..ae3c0d51cfc4 100644 --- a/test/libevmasm/evmAssemblyTests/constant_optimizer_runs_0.asm +++ b/test/libevmasm/evmAssemblyTests/constant_optimizer_masks_runs_0.asm @@ -223,142 +223,6 @@ PUSH 0x2 PUSH 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe // masks with 256 bits PUSH 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - // powers of 10 - PUSH 0xa - PUSH 0x64 - PUSH 0x3e8 - PUSH 0x2710 - PUSH 0x186a0 - PUSH 0xf4240 - PUSH 0x989680 - PUSH 0x5f5e100 - PUSH 0x3b9aca00 - PUSH 0x2540be400 - PUSH 0x174876e800 - PUSH 0xe8d4a51000 - PUSH 0x9184e72a000 - PUSH 0x5af3107a4000 - PUSH 0x38d7ea4c68000 - PUSH 0x2386f26fc10000 - PUSH 0x16345785d8a0000 - PUSH 0xde0b6b3a7640000 - PUSH 0x8ac7230489e80000 - PUSH 0x56bc75e2d63100000 - PUSH 0x3635c9adc5dea00000 - PUSH 0x21e19e0c9bab2400000 - PUSH 0x152d02c7e14af6800000 - PUSH 0xd3c21bcecceda1000000 - PUSH 0x84595161401484a000000 - PUSH 0x52b7d2dcc80cd2e4000000 - PUSH 0x33b2e3c9fd0803ce8000000 - PUSH 0x204fce5e3e25026110000000 - PUSH 0x1431e0fae6d7217caa0000000 - PUSH 0xc9f2c9cd04674edea40000000 - PUSH 0x7e37be2022c0914b2680000000 - PUSH 0x4ee2d6d415b85acef8100000000 - PUSH 0x314dc6448d9338c15b0a00000000 - PUSH 0x1ed09bead87c0378d8e6400000000 - PUSH 0x13426172c74d822b878fe800000000 - PUSH 0xc097ce7bc90715b34b9f1000000000 - PUSH 0x785ee10d5da46d900f436a000000000 - PUSH 0x4b3b4ca85a86c47a098a224000000000 - PUSH 0x2f050fe938943acc45f65568000000000 - PUSH 0x1d6329f1c35ca4bfabb9f5610000000000 - PUSH 0x125dfa371a19e6f7cb54395ca0000000000 - PUSH 0xb7abc627050305adf14a3d9e40000000000 - PUSH 0x72cb5bd86321e38cb6ce6682e80000000000 - PUSH 0x47bf19673df52e37f2410011d100000000000 - PUSH 0x2cd76fe086b93ce2f768a00b22a00000000000 - PUSH 0x1c06a5ec5433c60ddaa16406f5a400000000000 - PUSH 0x118427b3b4a05bc8a8a4de845986800000000000 - PUSH 0xaf298d050e4395d69670b12b7f41000000000000 - PUSH 0x6d79f82328ea3da61e066ebb2f88a000000000000 - PUSH 0x446c3b15f9926687d2c40534fdb564000000000000 - PUSH 0x2ac3a4edbbfb8014e3ba83411e915e8000000000000 - PUSH 0x1aba4714957d300d0e549208b31adb10000000000000 - PUSH 0x10b46c6cdd6e3e0828f4db456ff0c8ea0000000000000 - PUSH 0xa70c3c40a64e6c51999090b65f67d9240000000000000 - PUSH 0x6867a5a867f103b2fffa5a71fba0e7b680000000000000 - PUSH 0x4140c78940f6a24fdffc78873d4490d2100000000000000 - PUSH 0x28c87cb5c89a2571ebfdcb54864ada834a00000000000000 - PUSH 0x197d4df19d605767337e9f14d3eec8920e400000000000000 - PUSH 0xfee50b7025c36a0802f236d04753d5b48e800000000000000 - PUSH 0x9f4f2726179a224501d762422c946590d91000000000000000 - PUSH 0x63917877cec0556b21269d695bdcbf7a87aa000000000000000 - PUSH 0x3e3aeb4ae1383562f4b82261d969f7ac94ca4000000000000000 - PUSH 0x26e4d30eccc3215dd8f3157d27e23acbdcfe68000000000000000 - PUSH 0x184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000 - PUSH 0xf316271c7fc3908a8bef464e3945ef7a25360a0000000000000000 - PUSH 0x97edd871cfda3a5697758bf0e3cbb5ac5741c640000000000000000 - PUSH 0x5ef4a74721e864761ea977768e5f518bb6891be80000000000000000 - PUSH 0x3b58e88c75313ec9d329eaaa18fb92f75215b17100000000000000000 - PUSH 0x25179157c93ec73e23fa32aa4f9d3bda934d8ee6a00000000000000000 - PUSH 0x172ebad6ddc73c86d67c5faa71c245689c1079502400000000000000000 - PUSH 0xe7d34c64a9c85d4460dbbca87196b61618a4bd216800000000000000000 - PUSH 0x90e40fbeea1d3a4abc8955e946fe31cdcf66f634e1000000000000000000 - PUSH 0x5a8e89d75252446eb5d5d5b1cc5edf20a1a059e10ca000000000000000000 - PUSH 0x3899162693736ac531a5a58f1fbb4b746504382ca7e4000000000000000000 - PUSH 0x235fadd81c2822bb3f07877973d50f28bf22a31be8ee8000000000000000000 - PUSH 0x161bcca7119915b50764b4abe86529797775a5f1719510000000000000000000 - PUSH 0xdd15fe86affad91249ef0eb713f39ebeaa987b6e6fd2a0000000000000000000 - // powers of 10 multiplied by ffffffffffffffff - PUSH 0x9fffffffffffffff6 - PUSH 0x63ffffffffffffff9c - PUSH 0x3e7fffffffffffffc18 - PUSH 0x270fffffffffffffd8f0 - PUSH 0x1869ffffffffffffe7960 - PUSH 0xf423ffffffffffff0bdc0 - PUSH 0x98967fffffffffff676980 - PUSH 0x5f5e0fffffffffffa0a1f00 - PUSH 0x3b9ac9ffffffffffc4653600 - PUSH 0x2540be3fffffffffdabf41c00 - PUSH 0x174876e7ffffffffe8b7891800 - PUSH 0xe8d4a50fffffffff172b5af000 - PUSH 0x9184e729ffffffff6e7b18d6000 - PUSH 0x5af3107a3fffffffa50cef85c000 - PUSH 0x38d7ea4c67ffffffc72815b398000 - PUSH 0x2386f26fc0ffffffdc790d903f0000 - PUSH 0x16345785d89fffffe9cba87a2760000 - PUSH 0xde0b6b3a763fffff21f494c589c0000 - PUSH 0x8ac7230489e7ffff7538dcfb76180000 - PUSH 0x56bc75e2d630ffffa9438a1d29cf00000 - PUSH 0x3635c9adc5de9fffc9ca36523a21600000 - PUSH 0x21e19e0c9bab23ffde1e61f36454dc00000 - PUSH 0x152d02c7e14af67fead2fd381eb509800000 - PUSH 0xd3c21bcecceda0ff2c3de43133125f000000 - PUSH 0x845951614014849f7ba6ae9ebfeb7b6000000 - PUSH 0x52b7d2dcc80cd2e3ad482d2337f32d1c000000 - PUSH 0x33b2e3c9fd0803ce4c4d1c3602f7fc318000000 - PUSH 0x204fce5e3e250260efb031a1c1dafd9ef0000000 - PUSH 0x1431e0fae6d7217c95ce1f051928de83560000000 - PUSH 0xc9f2c9cd04674eddda0d3632fb98b1215c0000000 - PUSH 0x7e37be2022c0914aa84841dfdd3f6eb4d980000000 - PUSH 0x4ee2d6d415b85acea92d292bea47a53107f00000000 - PUSH 0x314dc6448d9338c129bc39bb726cc73ea4f600000000 - PUSH 0x1ed09bead87c0378ba15a4152783fc872719c00000000 - PUSH 0x13426172c74d822b744d868d38b27dd478701800000000 - PUSH 0xc097ce7bc90715b28b07418436f8ea4cb460f000000000 - PUSH 0x785ee10d5da46d8f96e488f2a25b926ff0bc96000000000 - PUSH 0x4b3b4ca85a86c479be4ed597a5793b85f675ddc000000000 - PUSH 0x2f050fe938943acc16f1457ec76bc533ba09aa98000000000 - PUSH 0x1d6329f1c35ca4bf8e56cb6f3ca35b4054460a9f0000000000 - PUSH 0x125dfa371a19e6f7b8f63f2585e6190834abc6a360000000000 - PUSH 0xb7abc627050305ad399e77773afcfa520eb5c261c0000000000 - PUSH 0x72cb5bd86321e38c44030aaa84de1c734931997d180000000000 - PUSH 0x47bf19673df52e37aa81e6aa930ad1c80dbeffee2f00000000000 - PUSH 0x2cd76fe086b93ce2ca91302a9be6c31d08975ff4dd600000000000 - PUSH 0x1c06a5ec5433c60dbe9abe1aa17039f2255e9bf90a5c00000000000 - PUSH 0x118427b3b4a05bc89720b6d0a4e62437575b217ba679800000000000 - PUSH 0xaf298d050e4395d5e747242670fd6a29698f4ed480bf000000000000 - PUSH 0x6d79f82328ea3da5b08c7698069e6259e1f99144d0776000000000000 - PUSH 0x446c3b15f99266878e57ca1f0422fd782d3bfacb024a9c000000000000 - PUSH 0x2ac3a4edbbfb8014b8f6de536295de6b1c457cbee16ea18000000000000 - PUSH 0x1aba4714957d300cf39a4af41d9dab02f1ab6df74ce524f0000000000000 - PUSH 0x10b46c6cdd6e3e0818406ed892828ae1d70b24ba900f37160000000000000 - PUSH 0xa70c3c40a64e6c50f2845475b9196cd2666f6f49a09826dc0000000000000 - PUSH 0x6867a5a867f103b29792b4c993afe4038005a58e045f184980000000000000 - PUSH 0x4140c78940f6a24f9ebbb0fdfc4dee8230038778c2bb6f2df00000000000000 - PUSH 0x28c87cb5c89a2571c3354e9ebdb0b5115e0234ab79b5257cb600000000000000 // ==== // optimizationPreset: none // optimizer.constantOptimizer: true @@ -572,138 +436,4 @@ PUSH 0x2 // shr(0x01, not(0x00)) // not(0x01) // not(0x00) -// 0x0a -// 0x64 -// 0x03e8 -// 0x2710 -// 0x0186a0 -// 0x0f4240 -// 0x989680 -// 0x05f5e100 -// 0x3b9aca00 -// exp(0x0a, 0x0a) -// exp(0x0a, 0x0b) -// exp(0x0a, 0x0c) -// exp(0x0a, 0x0d) -// exp(0x0a, 0x0e) -// exp(0x0a, 0x0f) -// exp(0x0a, 0x10) -// exp(0x0a, 0x11) -// exp(0x0a, 0x12) -// exp(0x0a, 0x13) -// exp(0x0a, 0x14) -// exp(0x0a, 0x15) -// exp(0x0a, 0x16) -// exp(0x0a, 0x17) -// exp(0x0a, 0x18) -// exp(0x0a, 0x19) -// exp(0x0a, 0x1a) -// exp(0x0a, 0x1b) -// exp(0x0a, 0x1c) -// exp(0x0a, 0x1d) -// exp(0x0a, 0x1e) -// exp(0x0a, 0x1f) -// exp(0x0a, 0x20) -// exp(0x0a, 0x21) -// exp(0x0a, 0x22) -// exp(0x0a, 0x23) -// exp(0x0a, 0x24) -// exp(0x0a, 0x25) -// exp(0x0a, 0x26) -// exp(0x0a, 0x27) -// exp(0x0a, 0x28) -// exp(0x0a, 0x29) -// exp(0x0a, 0x2a) -// exp(0x0a, 0x2b) -// exp(0x0a, 0x2c) -// exp(0x0a, 0x2d) -// exp(0x0a, 0x2e) -// exp(0x0a, 0x2f) -// exp(0x0a, 0x30) -// exp(0x0a, 0x31) -// exp(0x0a, 0x32) -// exp(0x0a, 0x33) -// exp(0x0a, 0x34) -// exp(0x0a, 0x35) -// exp(0x0a, 0x36) -// exp(0x0a, 0x37) -// exp(0x0a, 0x38) -// exp(0x0a, 0x39) -// exp(0x0a, 0x3a) -// exp(0x0a, 0x3b) -// exp(0x0a, 0x3c) -// exp(0x0a, 0x3d) -// exp(0x0a, 0x3e) -// exp(0x0a, 0x3f) -// exp(0x0a, 0x40) -// exp(0x0a, 0x41) -// exp(0x0a, 0x42) -// exp(0x0a, 0x43) -// exp(0x0a, 0x44) -// exp(0x0a, 0x45) -// exp(0x0a, 0x46) -// exp(0x0a, 0x47) -// exp(0x0a, 0x48) -// exp(0x0a, 0x49) -// exp(0x0a, 0x4a) -// exp(0x0a, 0x4b) -// exp(0x0a, 0x4c) -// exp(0x0a, 0x4d) -// sub(shl(0x41, 0x05), 0x0a) -// sub(shl(0x42, 0x19), 0x64) -// sub(shl(0x43, 0x7d), 0x03e8) -// sub(shl(0x44, 0x0271), 0x2710) -// sub(shl(0x45, 0x0c35), 0x0186a0) -// sub(shl(0x46, 0x3d09), 0x0f4240) -// 0x98967fffffffffff676980 -// 0x05f5e0fffffffffffa0a1f00 -// 0x3b9ac9ffffffffffc4653600 -// sub(shl(0x4a, 0x9502f9), exp(0x0a, 0x0a)) -// 0x174876e7ffffffffe8b7891800 -// 0xe8d4a50fffffffff172b5af000 -// mul(exp(0x0a, 0x0d), shr(0xc0, not(0x00))) -// mul(exp(0x0a, 0x0e), shr(0xc0, not(0x00))) -// mul(exp(0x0a, 0x0f), shr(0xc0, not(0x00))) -// mul(exp(0x0a, 0x10), shr(0xc0, not(0x00))) -// mul(exp(0x0a, 0x11), shr(0xc0, not(0x00))) -// mul(exp(0x0a, 0x12), shr(0xc0, not(0x00))) -// mul(exp(0x0a, 0x13), shr(0xc0, not(0x00))) -// mul(exp(0x0a, 0x14), shr(0xc0, not(0x00))) -// mul(exp(0x0a, 0x15), shr(0xc0, not(0x00))) -// mul(exp(0x0a, 0x16), shr(0xc0, not(0x00))) -// mul(exp(0x0a, 0x17), shr(0xc0, not(0x00))) -// mul(exp(0x0a, 0x18), shr(0xc0, not(0x00))) -// mul(exp(0x0a, 0x19), shr(0xc0, not(0x00))) -// mul(exp(0x0a, 0x1a), shr(0xc0, not(0x00))) -// mul(exp(0x0a, 0x1b), shr(0xc0, not(0x00))) -// mul(exp(0x0a, 0x1c), shr(0xc0, not(0x00))) -// mul(exp(0x0a, 0x1d), shr(0xc0, not(0x00))) -// mul(exp(0x0a, 0x1e), shr(0xc0, not(0x00))) -// mul(exp(0x0a, 0x1f), shr(0xc0, not(0x00))) -// mul(exp(0x0a, 0x20), shr(0xc0, not(0x00))) -// mul(exp(0x0a, 0x21), shr(0xc0, not(0x00))) -// mul(exp(0x0a, 0x22), shr(0xc0, not(0x00))) -// mul(exp(0x0a, 0x23), shr(0xc0, not(0x00))) -// mul(exp(0x0a, 0x24), shr(0xc0, not(0x00))) -// mul(exp(0x0a, 0x25), shr(0xc0, not(0x00))) -// mul(exp(0x0a, 0x26), shr(0xc0, not(0x00))) -// mul(exp(0x0a, 0x27), shr(0xc0, not(0x00))) -// mul(exp(0x0a, 0x28), shr(0xc0, not(0x00))) -// mul(exp(0x0a, 0x29), shr(0xc0, not(0x00))) -// mul(exp(0x0a, 0x2a), shr(0xc0, not(0x00))) -// mul(exp(0x0a, 0x2b), shr(0xc0, not(0x00))) -// mul(exp(0x0a, 0x2c), shr(0xc0, not(0x00))) -// mul(exp(0x0a, 0x2d), shr(0xc0, not(0x00))) -// mul(exp(0x0a, 0x2e), shr(0xc0, not(0x00))) -// mul(exp(0x0a, 0x2f), shr(0xc0, not(0x00))) -// mul(exp(0x0a, 0x30), shr(0xc0, not(0x00))) -// mul(exp(0x0a, 0x31), shr(0xc0, not(0x00))) -// mul(exp(0x0a, 0x32), shr(0xc0, not(0x00))) -// mul(exp(0x0a, 0x33), shr(0xc0, not(0x00))) -// mul(exp(0x0a, 0x34), shr(0xc0, not(0x00))) -// mul(exp(0x0a, 0x35), shr(0xc0, not(0x00))) -// mul(exp(0x0a, 0x36), shr(0xc0, not(0x00))) -// mul(exp(0x0a, 0x37), shr(0xc0, not(0x00))) -// mul(exp(0x0a, 0x38), shr(0xc0, not(0x00))) -// mul(exp(0x0a, 0x39), shr(0xc0, not(0x00))) // } diff --git a/test/libevmasm/evmAssemblyTests/constant_optimizer_runs_200.asm b/test/libevmasm/evmAssemblyTests/constant_optimizer_masks_runs_200.asm similarity index 57% rename from test/libevmasm/evmAssemblyTests/constant_optimizer_runs_200.asm rename to test/libevmasm/evmAssemblyTests/constant_optimizer_masks_runs_200.asm index 805af2f806f8..7ef9f8cb26d1 100644 --- a/test/libevmasm/evmAssemblyTests/constant_optimizer_runs_200.asm +++ b/test/libevmasm/evmAssemblyTests/constant_optimizer_masks_runs_200.asm @@ -223,142 +223,6 @@ PUSH 0x2 PUSH 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe // masks with 256 bits PUSH 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - // powers of 10 - PUSH 0xa - PUSH 0x64 - PUSH 0x3e8 - PUSH 0x2710 - PUSH 0x186a0 - PUSH 0xf4240 - PUSH 0x989680 - PUSH 0x5f5e100 - PUSH 0x3b9aca00 - PUSH 0x2540be400 - PUSH 0x174876e800 - PUSH 0xe8d4a51000 - PUSH 0x9184e72a000 - PUSH 0x5af3107a4000 - PUSH 0x38d7ea4c68000 - PUSH 0x2386f26fc10000 - PUSH 0x16345785d8a0000 - PUSH 0xde0b6b3a7640000 - PUSH 0x8ac7230489e80000 - PUSH 0x56bc75e2d63100000 - PUSH 0x3635c9adc5dea00000 - PUSH 0x21e19e0c9bab2400000 - PUSH 0x152d02c7e14af6800000 - PUSH 0xd3c21bcecceda1000000 - PUSH 0x84595161401484a000000 - PUSH 0x52b7d2dcc80cd2e4000000 - PUSH 0x33b2e3c9fd0803ce8000000 - PUSH 0x204fce5e3e25026110000000 - PUSH 0x1431e0fae6d7217caa0000000 - PUSH 0xc9f2c9cd04674edea40000000 - PUSH 0x7e37be2022c0914b2680000000 - PUSH 0x4ee2d6d415b85acef8100000000 - PUSH 0x314dc6448d9338c15b0a00000000 - PUSH 0x1ed09bead87c0378d8e6400000000 - PUSH 0x13426172c74d822b878fe800000000 - PUSH 0xc097ce7bc90715b34b9f1000000000 - PUSH 0x785ee10d5da46d900f436a000000000 - PUSH 0x4b3b4ca85a86c47a098a224000000000 - PUSH 0x2f050fe938943acc45f65568000000000 - PUSH 0x1d6329f1c35ca4bfabb9f5610000000000 - PUSH 0x125dfa371a19e6f7cb54395ca0000000000 - PUSH 0xb7abc627050305adf14a3d9e40000000000 - PUSH 0x72cb5bd86321e38cb6ce6682e80000000000 - PUSH 0x47bf19673df52e37f2410011d100000000000 - PUSH 0x2cd76fe086b93ce2f768a00b22a00000000000 - PUSH 0x1c06a5ec5433c60ddaa16406f5a400000000000 - PUSH 0x118427b3b4a05bc8a8a4de845986800000000000 - PUSH 0xaf298d050e4395d69670b12b7f41000000000000 - PUSH 0x6d79f82328ea3da61e066ebb2f88a000000000000 - PUSH 0x446c3b15f9926687d2c40534fdb564000000000000 - PUSH 0x2ac3a4edbbfb8014e3ba83411e915e8000000000000 - PUSH 0x1aba4714957d300d0e549208b31adb10000000000000 - PUSH 0x10b46c6cdd6e3e0828f4db456ff0c8ea0000000000000 - PUSH 0xa70c3c40a64e6c51999090b65f67d9240000000000000 - PUSH 0x6867a5a867f103b2fffa5a71fba0e7b680000000000000 - PUSH 0x4140c78940f6a24fdffc78873d4490d2100000000000000 - PUSH 0x28c87cb5c89a2571ebfdcb54864ada834a00000000000000 - PUSH 0x197d4df19d605767337e9f14d3eec8920e400000000000000 - PUSH 0xfee50b7025c36a0802f236d04753d5b48e800000000000000 - PUSH 0x9f4f2726179a224501d762422c946590d91000000000000000 - PUSH 0x63917877cec0556b21269d695bdcbf7a87aa000000000000000 - PUSH 0x3e3aeb4ae1383562f4b82261d969f7ac94ca4000000000000000 - PUSH 0x26e4d30eccc3215dd8f3157d27e23acbdcfe68000000000000000 - PUSH 0x184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000 - PUSH 0xf316271c7fc3908a8bef464e3945ef7a25360a0000000000000000 - PUSH 0x97edd871cfda3a5697758bf0e3cbb5ac5741c640000000000000000 - PUSH 0x5ef4a74721e864761ea977768e5f518bb6891be80000000000000000 - PUSH 0x3b58e88c75313ec9d329eaaa18fb92f75215b17100000000000000000 - PUSH 0x25179157c93ec73e23fa32aa4f9d3bda934d8ee6a00000000000000000 - PUSH 0x172ebad6ddc73c86d67c5faa71c245689c1079502400000000000000000 - PUSH 0xe7d34c64a9c85d4460dbbca87196b61618a4bd216800000000000000000 - PUSH 0x90e40fbeea1d3a4abc8955e946fe31cdcf66f634e1000000000000000000 - PUSH 0x5a8e89d75252446eb5d5d5b1cc5edf20a1a059e10ca000000000000000000 - PUSH 0x3899162693736ac531a5a58f1fbb4b746504382ca7e4000000000000000000 - PUSH 0x235fadd81c2822bb3f07877973d50f28bf22a31be8ee8000000000000000000 - PUSH 0x161bcca7119915b50764b4abe86529797775a5f1719510000000000000000000 - PUSH 0xdd15fe86affad91249ef0eb713f39ebeaa987b6e6fd2a0000000000000000000 - // powers of 10 multiplied by ffffffffffffffff - PUSH 0x9fffffffffffffff6 - PUSH 0x63ffffffffffffff9c - PUSH 0x3e7fffffffffffffc18 - PUSH 0x270fffffffffffffd8f0 - PUSH 0x1869ffffffffffffe7960 - PUSH 0xf423ffffffffffff0bdc0 - PUSH 0x98967fffffffffff676980 - PUSH 0x5f5e0fffffffffffa0a1f00 - PUSH 0x3b9ac9ffffffffffc4653600 - PUSH 0x2540be3fffffffffdabf41c00 - PUSH 0x174876e7ffffffffe8b7891800 - PUSH 0xe8d4a50fffffffff172b5af000 - PUSH 0x9184e729ffffffff6e7b18d6000 - PUSH 0x5af3107a3fffffffa50cef85c000 - PUSH 0x38d7ea4c67ffffffc72815b398000 - PUSH 0x2386f26fc0ffffffdc790d903f0000 - PUSH 0x16345785d89fffffe9cba87a2760000 - PUSH 0xde0b6b3a763fffff21f494c589c0000 - PUSH 0x8ac7230489e7ffff7538dcfb76180000 - PUSH 0x56bc75e2d630ffffa9438a1d29cf00000 - PUSH 0x3635c9adc5de9fffc9ca36523a21600000 - PUSH 0x21e19e0c9bab23ffde1e61f36454dc00000 - PUSH 0x152d02c7e14af67fead2fd381eb509800000 - PUSH 0xd3c21bcecceda0ff2c3de43133125f000000 - PUSH 0x845951614014849f7ba6ae9ebfeb7b6000000 - PUSH 0x52b7d2dcc80cd2e3ad482d2337f32d1c000000 - PUSH 0x33b2e3c9fd0803ce4c4d1c3602f7fc318000000 - PUSH 0x204fce5e3e250260efb031a1c1dafd9ef0000000 - PUSH 0x1431e0fae6d7217c95ce1f051928de83560000000 - PUSH 0xc9f2c9cd04674eddda0d3632fb98b1215c0000000 - PUSH 0x7e37be2022c0914aa84841dfdd3f6eb4d980000000 - PUSH 0x4ee2d6d415b85acea92d292bea47a53107f00000000 - PUSH 0x314dc6448d9338c129bc39bb726cc73ea4f600000000 - PUSH 0x1ed09bead87c0378ba15a4152783fc872719c00000000 - PUSH 0x13426172c74d822b744d868d38b27dd478701800000000 - PUSH 0xc097ce7bc90715b28b07418436f8ea4cb460f000000000 - PUSH 0x785ee10d5da46d8f96e488f2a25b926ff0bc96000000000 - PUSH 0x4b3b4ca85a86c479be4ed597a5793b85f675ddc000000000 - PUSH 0x2f050fe938943acc16f1457ec76bc533ba09aa98000000000 - PUSH 0x1d6329f1c35ca4bf8e56cb6f3ca35b4054460a9f0000000000 - PUSH 0x125dfa371a19e6f7b8f63f2585e6190834abc6a360000000000 - PUSH 0xb7abc627050305ad399e77773afcfa520eb5c261c0000000000 - PUSH 0x72cb5bd86321e38c44030aaa84de1c734931997d180000000000 - PUSH 0x47bf19673df52e37aa81e6aa930ad1c80dbeffee2f00000000000 - PUSH 0x2cd76fe086b93ce2ca91302a9be6c31d08975ff4dd600000000000 - PUSH 0x1c06a5ec5433c60dbe9abe1aa17039f2255e9bf90a5c00000000000 - PUSH 0x118427b3b4a05bc89720b6d0a4e62437575b217ba679800000000000 - PUSH 0xaf298d050e4395d5e747242670fd6a29698f4ed480bf000000000000 - PUSH 0x6d79f82328ea3da5b08c7698069e6259e1f99144d0776000000000000 - PUSH 0x446c3b15f99266878e57ca1f0422fd782d3bfacb024a9c000000000000 - PUSH 0x2ac3a4edbbfb8014b8f6de536295de6b1c457cbee16ea18000000000000 - PUSH 0x1aba4714957d300cf39a4af41d9dab02f1ab6df74ce524f0000000000000 - PUSH 0x10b46c6cdd6e3e0818406ed892828ae1d70b24ba900f37160000000000000 - PUSH 0xa70c3c40a64e6c50f2845475b9196cd2666f6f49a09826dc0000000000000 - PUSH 0x6867a5a867f103b29792b4c993afe4038005a58e045f184980000000000000 - PUSH 0x4140c78940f6a24f9ebbb0fdfc4dee8230038778c2bb6f2df00000000000000 - PUSH 0x28c87cb5c89a2571c3354e9ebdb0b5115e0234ab79b5257cb600000000000000 // ==== // optimizationPreset: none // optimizer.constantOptimizer: true @@ -572,138 +436,4 @@ PUSH 0x2 // shr(0x01, not(0x00)) // not(0x01) // not(0x00) -// 0x0a -// 0x64 -// 0x03e8 -// 0x2710 -// 0x0186a0 -// 0x0f4240 -// 0x989680 -// 0x05f5e100 -// 0x3b9aca00 -// 0x02540be400 -// 0x174876e800 -// 0xe8d4a51000 -// 0x09184e72a000 -// 0x5af3107a4000 -// 0x038d7ea4c68000 -// 0x2386f26fc10000 -// 0x016345785d8a0000 -// 0x0de0b6b3a7640000 -// 0x8ac7230489e80000 -// 0x056bc75e2d63100000 -// 0x3635c9adc5dea00000 -// 0x021e19e0c9bab2400000 -// 0x152d02c7e14af6800000 -// 0xd3c21bcecceda1000000 -// 0x084595161401484a000000 -// 0x52b7d2dcc80cd2e4000000 -// 0x033b2e3c9fd0803ce8000000 -// 0x204fce5e3e25026110000000 -// 0x01431e0fae6d7217caa0000000 -// 0x0c9f2c9cd04674edea40000000 -// 0x7e37be2022c0914b2680000000 -// 0x04ee2d6d415b85acef8100000000 -// 0x314dc6448d9338c15b0a00000000 -// 0x01ed09bead87c0378d8e6400000000 -// 0x13426172c74d822b878fe800000000 -// 0xc097ce7bc90715b34b9f1000000000 -// 0x0785ee10d5da46d900f436a000000000 -// 0x4b3b4ca85a86c47a098a224000000000 -// 0x02f050fe938943acc45f65568000000000 -// 0x1d6329f1c35ca4bfabb9f5610000000000 -// 0x0125dfa371a19e6f7cb54395ca0000000000 -// 0x0b7abc627050305adf14a3d9e40000000000 -// 0x72cb5bd86321e38cb6ce6682e80000000000 -// 0x047bf19673df52e37f2410011d100000000000 -// 0x2cd76fe086b93ce2f768a00b22a00000000000 -// 0x01c06a5ec5433c60ddaa16406f5a400000000000 -// 0x118427b3b4a05bc8a8a4de845986800000000000 -// 0xaf298d050e4395d69670b12b7f41000000000000 -// 0x06d79f82328ea3da61e066ebb2f88a000000000000 -// 0x446c3b15f9926687d2c40534fdb564000000000000 -// 0x02ac3a4edbbfb8014e3ba83411e915e8000000000000 -// 0x1aba4714957d300d0e549208b31adb10000000000000 -// 0x010b46c6cdd6e3e0828f4db456ff0c8ea0000000000000 -// 0x0a70c3c40a64e6c51999090b65f67d9240000000000000 -// 0x6867a5a867f103b2fffa5a71fba0e7b680000000000000 -// 0x04140c78940f6a24fdffc78873d4490d2100000000000000 -// 0x28c87cb5c89a2571ebfdcb54864ada834a00000000000000 -// 0x0197d4df19d605767337e9f14d3eec8920e400000000000000 -// 0x0fee50b7025c36a0802f236d04753d5b48e800000000000000 -// 0x9f4f2726179a224501d762422c946590d91000000000000000 -// 0x063917877cec0556b21269d695bdcbf7a87aa000000000000000 -// 0x3e3aeb4ae1383562f4b82261d969f7ac94ca4000000000000000 -// 0x026e4d30eccc3215dd8f3157d27e23acbdcfe68000000000000000 -// 0x184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000 -// 0xf316271c7fc3908a8bef464e3945ef7a25360a0000000000000000 -// 0x097edd871cfda3a5697758bf0e3cbb5ac5741c640000000000000000 -// 0x5ef4a74721e864761ea977768e5f518bb6891be80000000000000000 -// 0x03b58e88c75313ec9d329eaaa18fb92f75215b17100000000000000000 -// 0x25179157c93ec73e23fa32aa4f9d3bda934d8ee6a00000000000000000 -// 0x0172ebad6ddc73c86d67c5faa71c245689c1079502400000000000000000 -// 0x0e7d34c64a9c85d4460dbbca87196b61618a4bd216800000000000000000 -// 0x90e40fbeea1d3a4abc8955e946fe31cdcf66f634e1000000000000000000 -// 0x05a8e89d75252446eb5d5d5b1cc5edf20a1a059e10ca000000000000000000 -// 0x3899162693736ac531a5a58f1fbb4b746504382ca7e4000000000000000000 -// 0x0235fadd81c2822bb3f07877973d50f28bf22a31be8ee8000000000000000000 -// 0x161bcca7119915b50764b4abe86529797775a5f1719510000000000000000000 -// 0xdd15fe86affad91249ef0eb713f39ebeaa987b6e6fd2a0000000000000000000 -// 0x09fffffffffffffff6 -// 0x63ffffffffffffff9c -// 0x03e7fffffffffffffc18 -// 0x270fffffffffffffd8f0 -// 0x01869ffffffffffffe7960 -// 0x0f423ffffffffffff0bdc0 -// 0x98967fffffffffff676980 -// 0x05f5e0fffffffffffa0a1f00 -// 0x3b9ac9ffffffffffc4653600 -// 0x02540be3fffffffffdabf41c00 -// 0x174876e7ffffffffe8b7891800 -// 0xe8d4a50fffffffff172b5af000 -// 0x09184e729ffffffff6e7b18d6000 -// 0x5af3107a3fffffffa50cef85c000 -// 0x038d7ea4c67ffffffc72815b398000 -// 0x2386f26fc0ffffffdc790d903f0000 -// 0x016345785d89fffffe9cba87a2760000 -// 0x0de0b6b3a763fffff21f494c589c0000 -// 0x8ac7230489e7ffff7538dcfb76180000 -// 0x056bc75e2d630ffffa9438a1d29cf00000 -// 0x3635c9adc5de9fffc9ca36523a21600000 -// 0x021e19e0c9bab23ffde1e61f36454dc00000 -// 0x152d02c7e14af67fead2fd381eb509800000 -// 0xd3c21bcecceda0ff2c3de43133125f000000 -// 0x0845951614014849f7ba6ae9ebfeb7b6000000 -// 0x52b7d2dcc80cd2e3ad482d2337f32d1c000000 -// 0x033b2e3c9fd0803ce4c4d1c3602f7fc318000000 -// 0x204fce5e3e250260efb031a1c1dafd9ef0000000 -// 0x01431e0fae6d7217c95ce1f051928de83560000000 -// 0x0c9f2c9cd04674eddda0d3632fb98b1215c0000000 -// 0x7e37be2022c0914aa84841dfdd3f6eb4d980000000 -// 0x04ee2d6d415b85acea92d292bea47a53107f00000000 -// 0x314dc6448d9338c129bc39bb726cc73ea4f600000000 -// 0x01ed09bead87c0378ba15a4152783fc872719c00000000 -// 0x13426172c74d822b744d868d38b27dd478701800000000 -// 0xc097ce7bc90715b28b07418436f8ea4cb460f000000000 -// 0x0785ee10d5da46d8f96e488f2a25b926ff0bc96000000000 -// 0x4b3b4ca85a86c479be4ed597a5793b85f675ddc000000000 -// 0x02f050fe938943acc16f1457ec76bc533ba09aa98000000000 -// 0x1d6329f1c35ca4bf8e56cb6f3ca35b4054460a9f0000000000 -// 0x0125dfa371a19e6f7b8f63f2585e6190834abc6a360000000000 -// 0x0b7abc627050305ad399e77773afcfa520eb5c261c0000000000 -// 0x72cb5bd86321e38c44030aaa84de1c734931997d180000000000 -// 0x047bf19673df52e37aa81e6aa930ad1c80dbeffee2f00000000000 -// 0x2cd76fe086b93ce2ca91302a9be6c31d08975ff4dd600000000000 -// 0x01c06a5ec5433c60dbe9abe1aa17039f2255e9bf90a5c00000000000 -// 0x118427b3b4a05bc89720b6d0a4e62437575b217ba679800000000000 -// 0xaf298d050e4395d5e747242670fd6a29698f4ed480bf000000000000 -// 0x06d79f82328ea3da5b08c7698069e6259e1f99144d0776000000000000 -// 0x446c3b15f99266878e57ca1f0422fd782d3bfacb024a9c000000000000 -// 0x02ac3a4edbbfb8014b8f6de536295de6b1c457cbee16ea18000000000000 -// 0x1aba4714957d300cf39a4af41d9dab02f1ab6df74ce524f0000000000000 -// 0x010b46c6cdd6e3e0818406ed892828ae1d70b24ba900f37160000000000000 -// 0x0a70c3c40a64e6c50f2845475b9196cd2666f6f49a09826dc0000000000000 -// 0x6867a5a867f103b29792b4c993afe4038005a58e045f184980000000000000 -// 0x04140c78940f6a24f9ebbb0fdfc4dee8230038778c2bb6f2df00000000000000 -// 0x28c87cb5c89a2571c3354e9ebdb0b5115e0234ab79b5257cb600000000000000 // } diff --git a/test/libevmasm/evmAssemblyTests/constant_optimizer_runs_2M.asm b/test/libevmasm/evmAssemblyTests/constant_optimizer_masks_runs_2M.asm similarity index 62% rename from test/libevmasm/evmAssemblyTests/constant_optimizer_runs_2M.asm rename to test/libevmasm/evmAssemblyTests/constant_optimizer_masks_runs_2M.asm index a7be38817353..b191f63f0ec3 100644 --- a/test/libevmasm/evmAssemblyTests/constant_optimizer_runs_2M.asm +++ b/test/libevmasm/evmAssemblyTests/constant_optimizer_masks_runs_2M.asm @@ -223,142 +223,6 @@ PUSH 0x2 PUSH 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe // masks with 256 bits PUSH 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff - // powers of 10 - PUSH 0xa - PUSH 0x64 - PUSH 0x3e8 - PUSH 0x2710 - PUSH 0x186a0 - PUSH 0xf4240 - PUSH 0x989680 - PUSH 0x5f5e100 - PUSH 0x3b9aca00 - PUSH 0x2540be400 - PUSH 0x174876e800 - PUSH 0xe8d4a51000 - PUSH 0x9184e72a000 - PUSH 0x5af3107a4000 - PUSH 0x38d7ea4c68000 - PUSH 0x2386f26fc10000 - PUSH 0x16345785d8a0000 - PUSH 0xde0b6b3a7640000 - PUSH 0x8ac7230489e80000 - PUSH 0x56bc75e2d63100000 - PUSH 0x3635c9adc5dea00000 - PUSH 0x21e19e0c9bab2400000 - PUSH 0x152d02c7e14af6800000 - PUSH 0xd3c21bcecceda1000000 - PUSH 0x84595161401484a000000 - PUSH 0x52b7d2dcc80cd2e4000000 - PUSH 0x33b2e3c9fd0803ce8000000 - PUSH 0x204fce5e3e25026110000000 - PUSH 0x1431e0fae6d7217caa0000000 - PUSH 0xc9f2c9cd04674edea40000000 - PUSH 0x7e37be2022c0914b2680000000 - PUSH 0x4ee2d6d415b85acef8100000000 - PUSH 0x314dc6448d9338c15b0a00000000 - PUSH 0x1ed09bead87c0378d8e6400000000 - PUSH 0x13426172c74d822b878fe800000000 - PUSH 0xc097ce7bc90715b34b9f1000000000 - PUSH 0x785ee10d5da46d900f436a000000000 - PUSH 0x4b3b4ca85a86c47a098a224000000000 - PUSH 0x2f050fe938943acc45f65568000000000 - PUSH 0x1d6329f1c35ca4bfabb9f5610000000000 - PUSH 0x125dfa371a19e6f7cb54395ca0000000000 - PUSH 0xb7abc627050305adf14a3d9e40000000000 - PUSH 0x72cb5bd86321e38cb6ce6682e80000000000 - PUSH 0x47bf19673df52e37f2410011d100000000000 - PUSH 0x2cd76fe086b93ce2f768a00b22a00000000000 - PUSH 0x1c06a5ec5433c60ddaa16406f5a400000000000 - PUSH 0x118427b3b4a05bc8a8a4de845986800000000000 - PUSH 0xaf298d050e4395d69670b12b7f41000000000000 - PUSH 0x6d79f82328ea3da61e066ebb2f88a000000000000 - PUSH 0x446c3b15f9926687d2c40534fdb564000000000000 - PUSH 0x2ac3a4edbbfb8014e3ba83411e915e8000000000000 - PUSH 0x1aba4714957d300d0e549208b31adb10000000000000 - PUSH 0x10b46c6cdd6e3e0828f4db456ff0c8ea0000000000000 - PUSH 0xa70c3c40a64e6c51999090b65f67d9240000000000000 - PUSH 0x6867a5a867f103b2fffa5a71fba0e7b680000000000000 - PUSH 0x4140c78940f6a24fdffc78873d4490d2100000000000000 - PUSH 0x28c87cb5c89a2571ebfdcb54864ada834a00000000000000 - PUSH 0x197d4df19d605767337e9f14d3eec8920e400000000000000 - PUSH 0xfee50b7025c36a0802f236d04753d5b48e800000000000000 - PUSH 0x9f4f2726179a224501d762422c946590d91000000000000000 - PUSH 0x63917877cec0556b21269d695bdcbf7a87aa000000000000000 - PUSH 0x3e3aeb4ae1383562f4b82261d969f7ac94ca4000000000000000 - PUSH 0x26e4d30eccc3215dd8f3157d27e23acbdcfe68000000000000000 - PUSH 0x184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000 - PUSH 0xf316271c7fc3908a8bef464e3945ef7a25360a0000000000000000 - PUSH 0x97edd871cfda3a5697758bf0e3cbb5ac5741c640000000000000000 - PUSH 0x5ef4a74721e864761ea977768e5f518bb6891be80000000000000000 - PUSH 0x3b58e88c75313ec9d329eaaa18fb92f75215b17100000000000000000 - PUSH 0x25179157c93ec73e23fa32aa4f9d3bda934d8ee6a00000000000000000 - PUSH 0x172ebad6ddc73c86d67c5faa71c245689c1079502400000000000000000 - PUSH 0xe7d34c64a9c85d4460dbbca87196b61618a4bd216800000000000000000 - PUSH 0x90e40fbeea1d3a4abc8955e946fe31cdcf66f634e1000000000000000000 - PUSH 0x5a8e89d75252446eb5d5d5b1cc5edf20a1a059e10ca000000000000000000 - PUSH 0x3899162693736ac531a5a58f1fbb4b746504382ca7e4000000000000000000 - PUSH 0x235fadd81c2822bb3f07877973d50f28bf22a31be8ee8000000000000000000 - PUSH 0x161bcca7119915b50764b4abe86529797775a5f1719510000000000000000000 - PUSH 0xdd15fe86affad91249ef0eb713f39ebeaa987b6e6fd2a0000000000000000000 - // powers of 10 multiplied by ffffffffffffffff - PUSH 0x9fffffffffffffff6 - PUSH 0x63ffffffffffffff9c - PUSH 0x3e7fffffffffffffc18 - PUSH 0x270fffffffffffffd8f0 - PUSH 0x1869ffffffffffffe7960 - PUSH 0xf423ffffffffffff0bdc0 - PUSH 0x98967fffffffffff676980 - PUSH 0x5f5e0fffffffffffa0a1f00 - PUSH 0x3b9ac9ffffffffffc4653600 - PUSH 0x2540be3fffffffffdabf41c00 - PUSH 0x174876e7ffffffffe8b7891800 - PUSH 0xe8d4a50fffffffff172b5af000 - PUSH 0x9184e729ffffffff6e7b18d6000 - PUSH 0x5af3107a3fffffffa50cef85c000 - PUSH 0x38d7ea4c67ffffffc72815b398000 - PUSH 0x2386f26fc0ffffffdc790d903f0000 - PUSH 0x16345785d89fffffe9cba87a2760000 - PUSH 0xde0b6b3a763fffff21f494c589c0000 - PUSH 0x8ac7230489e7ffff7538dcfb76180000 - PUSH 0x56bc75e2d630ffffa9438a1d29cf00000 - PUSH 0x3635c9adc5de9fffc9ca36523a21600000 - PUSH 0x21e19e0c9bab23ffde1e61f36454dc00000 - PUSH 0x152d02c7e14af67fead2fd381eb509800000 - PUSH 0xd3c21bcecceda0ff2c3de43133125f000000 - PUSH 0x845951614014849f7ba6ae9ebfeb7b6000000 - PUSH 0x52b7d2dcc80cd2e3ad482d2337f32d1c000000 - PUSH 0x33b2e3c9fd0803ce4c4d1c3602f7fc318000000 - PUSH 0x204fce5e3e250260efb031a1c1dafd9ef0000000 - PUSH 0x1431e0fae6d7217c95ce1f051928de83560000000 - PUSH 0xc9f2c9cd04674eddda0d3632fb98b1215c0000000 - PUSH 0x7e37be2022c0914aa84841dfdd3f6eb4d980000000 - PUSH 0x4ee2d6d415b85acea92d292bea47a53107f00000000 - PUSH 0x314dc6448d9338c129bc39bb726cc73ea4f600000000 - PUSH 0x1ed09bead87c0378ba15a4152783fc872719c00000000 - PUSH 0x13426172c74d822b744d868d38b27dd478701800000000 - PUSH 0xc097ce7bc90715b28b07418436f8ea4cb460f000000000 - PUSH 0x785ee10d5da46d8f96e488f2a25b926ff0bc96000000000 - PUSH 0x4b3b4ca85a86c479be4ed597a5793b85f675ddc000000000 - PUSH 0x2f050fe938943acc16f1457ec76bc533ba09aa98000000000 - PUSH 0x1d6329f1c35ca4bf8e56cb6f3ca35b4054460a9f0000000000 - PUSH 0x125dfa371a19e6f7b8f63f2585e6190834abc6a360000000000 - PUSH 0xb7abc627050305ad399e77773afcfa520eb5c261c0000000000 - PUSH 0x72cb5bd86321e38c44030aaa84de1c734931997d180000000000 - PUSH 0x47bf19673df52e37aa81e6aa930ad1c80dbeffee2f00000000000 - PUSH 0x2cd76fe086b93ce2ca91302a9be6c31d08975ff4dd600000000000 - PUSH 0x1c06a5ec5433c60dbe9abe1aa17039f2255e9bf90a5c00000000000 - PUSH 0x118427b3b4a05bc89720b6d0a4e62437575b217ba679800000000000 - PUSH 0xaf298d050e4395d5e747242670fd6a29698f4ed480bf000000000000 - PUSH 0x6d79f82328ea3da5b08c7698069e6259e1f99144d0776000000000000 - PUSH 0x446c3b15f99266878e57ca1f0422fd782d3bfacb024a9c000000000000 - PUSH 0x2ac3a4edbbfb8014b8f6de536295de6b1c457cbee16ea18000000000000 - PUSH 0x1aba4714957d300cf39a4af41d9dab02f1ab6df74ce524f0000000000000 - PUSH 0x10b46c6cdd6e3e0818406ed892828ae1d70b24ba900f37160000000000000 - PUSH 0xa70c3c40a64e6c50f2845475b9196cd2666f6f49a09826dc0000000000000 - PUSH 0x6867a5a867f103b29792b4c993afe4038005a58e045f184980000000000000 - PUSH 0x4140c78940f6a24f9ebbb0fdfc4dee8230038778c2bb6f2df00000000000000 - PUSH 0x28c87cb5c89a2571c3354e9ebdb0b5115e0234ab79b5257cb600000000000000 // ==== // optimizationPreset: none // optimizer.constantOptimizer: true @@ -572,138 +436,4 @@ PUSH 0x2 // 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff // 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe // 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -// 0x0a -// 0x64 -// 0x03e8 -// 0x2710 -// 0x0186a0 -// 0x0f4240 -// 0x989680 -// 0x05f5e100 -// 0x3b9aca00 -// 0x02540be400 -// 0x174876e800 -// 0xe8d4a51000 -// 0x09184e72a000 -// 0x5af3107a4000 -// 0x038d7ea4c68000 -// 0x2386f26fc10000 -// 0x016345785d8a0000 -// 0x0de0b6b3a7640000 -// 0x8ac7230489e80000 -// 0x056bc75e2d63100000 -// 0x3635c9adc5dea00000 -// 0x021e19e0c9bab2400000 -// 0x152d02c7e14af6800000 -// 0xd3c21bcecceda1000000 -// 0x084595161401484a000000 -// 0x52b7d2dcc80cd2e4000000 -// 0x033b2e3c9fd0803ce8000000 -// 0x204fce5e3e25026110000000 -// 0x01431e0fae6d7217caa0000000 -// 0x0c9f2c9cd04674edea40000000 -// 0x7e37be2022c0914b2680000000 -// 0x04ee2d6d415b85acef8100000000 -// 0x314dc6448d9338c15b0a00000000 -// 0x01ed09bead87c0378d8e6400000000 -// 0x13426172c74d822b878fe800000000 -// 0xc097ce7bc90715b34b9f1000000000 -// 0x0785ee10d5da46d900f436a000000000 -// 0x4b3b4ca85a86c47a098a224000000000 -// 0x02f050fe938943acc45f65568000000000 -// 0x1d6329f1c35ca4bfabb9f5610000000000 -// 0x0125dfa371a19e6f7cb54395ca0000000000 -// 0x0b7abc627050305adf14a3d9e40000000000 -// 0x72cb5bd86321e38cb6ce6682e80000000000 -// 0x047bf19673df52e37f2410011d100000000000 -// 0x2cd76fe086b93ce2f768a00b22a00000000000 -// 0x01c06a5ec5433c60ddaa16406f5a400000000000 -// 0x118427b3b4a05bc8a8a4de845986800000000000 -// 0xaf298d050e4395d69670b12b7f41000000000000 -// 0x06d79f82328ea3da61e066ebb2f88a000000000000 -// 0x446c3b15f9926687d2c40534fdb564000000000000 -// 0x02ac3a4edbbfb8014e3ba83411e915e8000000000000 -// 0x1aba4714957d300d0e549208b31adb10000000000000 -// 0x010b46c6cdd6e3e0828f4db456ff0c8ea0000000000000 -// 0x0a70c3c40a64e6c51999090b65f67d9240000000000000 -// 0x6867a5a867f103b2fffa5a71fba0e7b680000000000000 -// 0x04140c78940f6a24fdffc78873d4490d2100000000000000 -// 0x28c87cb5c89a2571ebfdcb54864ada834a00000000000000 -// 0x0197d4df19d605767337e9f14d3eec8920e400000000000000 -// 0x0fee50b7025c36a0802f236d04753d5b48e800000000000000 -// 0x9f4f2726179a224501d762422c946590d91000000000000000 -// 0x063917877cec0556b21269d695bdcbf7a87aa000000000000000 -// 0x3e3aeb4ae1383562f4b82261d969f7ac94ca4000000000000000 -// 0x026e4d30eccc3215dd8f3157d27e23acbdcfe68000000000000000 -// 0x184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000 -// 0xf316271c7fc3908a8bef464e3945ef7a25360a0000000000000000 -// 0x097edd871cfda3a5697758bf0e3cbb5ac5741c640000000000000000 -// 0x5ef4a74721e864761ea977768e5f518bb6891be80000000000000000 -// 0x03b58e88c75313ec9d329eaaa18fb92f75215b17100000000000000000 -// 0x25179157c93ec73e23fa32aa4f9d3bda934d8ee6a00000000000000000 -// 0x0172ebad6ddc73c86d67c5faa71c245689c1079502400000000000000000 -// 0x0e7d34c64a9c85d4460dbbca87196b61618a4bd216800000000000000000 -// 0x90e40fbeea1d3a4abc8955e946fe31cdcf66f634e1000000000000000000 -// 0x05a8e89d75252446eb5d5d5b1cc5edf20a1a059e10ca000000000000000000 -// 0x3899162693736ac531a5a58f1fbb4b746504382ca7e4000000000000000000 -// 0x0235fadd81c2822bb3f07877973d50f28bf22a31be8ee8000000000000000000 -// 0x161bcca7119915b50764b4abe86529797775a5f1719510000000000000000000 -// 0xdd15fe86affad91249ef0eb713f39ebeaa987b6e6fd2a0000000000000000000 -// 0x09fffffffffffffff6 -// 0x63ffffffffffffff9c -// 0x03e7fffffffffffffc18 -// 0x270fffffffffffffd8f0 -// 0x01869ffffffffffffe7960 -// 0x0f423ffffffffffff0bdc0 -// 0x98967fffffffffff676980 -// 0x05f5e0fffffffffffa0a1f00 -// 0x3b9ac9ffffffffffc4653600 -// 0x02540be3fffffffffdabf41c00 -// 0x174876e7ffffffffe8b7891800 -// 0xe8d4a50fffffffff172b5af000 -// 0x09184e729ffffffff6e7b18d6000 -// 0x5af3107a3fffffffa50cef85c000 -// 0x038d7ea4c67ffffffc72815b398000 -// 0x2386f26fc0ffffffdc790d903f0000 -// 0x016345785d89fffffe9cba87a2760000 -// 0x0de0b6b3a763fffff21f494c589c0000 -// 0x8ac7230489e7ffff7538dcfb76180000 -// 0x056bc75e2d630ffffa9438a1d29cf00000 -// 0x3635c9adc5de9fffc9ca36523a21600000 -// 0x021e19e0c9bab23ffde1e61f36454dc00000 -// 0x152d02c7e14af67fead2fd381eb509800000 -// 0xd3c21bcecceda0ff2c3de43133125f000000 -// 0x0845951614014849f7ba6ae9ebfeb7b6000000 -// 0x52b7d2dcc80cd2e3ad482d2337f32d1c000000 -// 0x033b2e3c9fd0803ce4c4d1c3602f7fc318000000 -// 0x204fce5e3e250260efb031a1c1dafd9ef0000000 -// 0x01431e0fae6d7217c95ce1f051928de83560000000 -// 0x0c9f2c9cd04674eddda0d3632fb98b1215c0000000 -// 0x7e37be2022c0914aa84841dfdd3f6eb4d980000000 -// 0x04ee2d6d415b85acea92d292bea47a53107f00000000 -// 0x314dc6448d9338c129bc39bb726cc73ea4f600000000 -// 0x01ed09bead87c0378ba15a4152783fc872719c00000000 -// 0x13426172c74d822b744d868d38b27dd478701800000000 -// 0xc097ce7bc90715b28b07418436f8ea4cb460f000000000 -// 0x0785ee10d5da46d8f96e488f2a25b926ff0bc96000000000 -// 0x4b3b4ca85a86c479be4ed597a5793b85f675ddc000000000 -// 0x02f050fe938943acc16f1457ec76bc533ba09aa98000000000 -// 0x1d6329f1c35ca4bf8e56cb6f3ca35b4054460a9f0000000000 -// 0x0125dfa371a19e6f7b8f63f2585e6190834abc6a360000000000 -// 0x0b7abc627050305ad399e77773afcfa520eb5c261c0000000000 -// 0x72cb5bd86321e38c44030aaa84de1c734931997d180000000000 -// 0x047bf19673df52e37aa81e6aa930ad1c80dbeffee2f00000000000 -// 0x2cd76fe086b93ce2ca91302a9be6c31d08975ff4dd600000000000 -// 0x01c06a5ec5433c60dbe9abe1aa17039f2255e9bf90a5c00000000000 -// 0x118427b3b4a05bc89720b6d0a4e62437575b217ba679800000000000 -// 0xaf298d050e4395d5e747242670fd6a29698f4ed480bf000000000000 -// 0x06d79f82328ea3da5b08c7698069e6259e1f99144d0776000000000000 -// 0x446c3b15f99266878e57ca1f0422fd782d3bfacb024a9c000000000000 -// 0x02ac3a4edbbfb8014b8f6de536295de6b1c457cbee16ea18000000000000 -// 0x1aba4714957d300cf39a4af41d9dab02f1ab6df74ce524f0000000000000 -// 0x010b46c6cdd6e3e0818406ed892828ae1d70b24ba900f37160000000000000 -// 0x0a70c3c40a64e6c50f2845475b9196cd2666f6f49a09826dc0000000000000 -// 0x6867a5a867f103b29792b4c993afe4038005a58e045f184980000000000000 -// 0x04140c78940f6a24f9ebbb0fdfc4dee8230038778c2bb6f2df00000000000000 -// 0x28c87cb5c89a2571c3354e9ebdb0b5115e0234ab79b5257cb600000000000000 // } From 98bdd2e82b9d889e55807b985f92b9199bd84d97 Mon Sep 17 00:00:00 2001 From: Mohammad Rezaei Date: Sat, 16 Aug 2025 21:28:18 -0400 Subject: [PATCH 4/7] mask generation for yul constant optimizer --- libyul/backends/evm/ConstantOptimiser.cpp | 29 +++++++++++++++++++ libyul/backends/evm/EVMDialect.cpp | 1 + libyul/backends/evm/EVMDialect.h | 1 + test/cmdlineTests/ir_subobject_order/output | 8 ++--- .../output.json | 8 ++--- .../array_of_struct_memory_to_storage.sol | 2 +- ...ts_containing_arrays_memory_to_storage.sol | 2 +- .../array/copying/storage_memory_nested.sol | 2 +- .../storage_memory_nested_from_pointer.sol | 2 +- .../array/fixed_arrays_in_constructors.sol | 4 +-- .../array/function_array_cross_calls.sol | 2 +- .../constructor_arguments_external.sol | 2 +- .../events/event_emit_from_other_contract.sol | 2 +- .../creation_function_call_with_args.sol | 2 +- .../creation_function_call_with_salt.sol | 2 +- .../functionCall/gas_and_value_basic.sol | 2 +- .../immutable/immutable_tag_too_large_bug.sol | 4 +-- .../inheritance/value_for_constructor.sol | 2 +- .../transient_storage_selfdestruct.sol | 2 +- .../storageLayoutSpecifier/constructor.sol | 2 +- .../struct_memory_to_storage_function_ptr.sol | 2 +- .../userDefinedValueType/erc20.sol | 4 +-- .../semanticTests/various/erc20.sol | 4 +-- .../various/selfdestruct_post_cancun.sol | 4 +-- ...uct_post_cancun_multiple_beneficiaries.sol | 6 ++-- .../selfdestruct_post_cancun_redeploy.sol | 6 ++-- .../semanticTests/various/senders_balance.sol | 2 +- .../yulOptimizerTests/fullSuite/abi2.yul | 10 +++---- .../fullSuite/abi_example1.yul | 2 +- .../fullSuite/combine_shift_and_and_3.yul | 2 +- .../fullSuite/create2_and_mask.yul | 4 +-- .../fullSuite/create_and_mask.yul | 4 +-- .../fullSuite/extcodelength.yul | 2 +- 33 files changed, 82 insertions(+), 51 deletions(-) diff --git a/libyul/backends/evm/ConstantOptimiser.cpp b/libyul/backends/evm/ConstantOptimiser.cpp index aa744415bf9d..74d3090c0056 100644 --- a/libyul/backends/evm/ConstantOptimiser.cpp +++ b/libyul/backends/evm/ConstantOptimiser.cpp @@ -64,6 +64,8 @@ struct MiniEVMInterpreter return exp256(args.at(0), args.at(1)); case evmasm::Instruction::SHL: return args.at(0) > 255 ? 0 : (args.at(1) << unsigned(args.at(0))); + case evmasm::Instruction::SHR: + return args.at(1) >> unsigned(args.at(0)); case evmasm::Instruction::NOT: return ~args.at(0); default: @@ -135,6 +137,33 @@ Representation const& RepresentationFinder::findRepresentation(u256 const& _valu Representation routine = represent(_value); + // check for masks first + // high ones low zeros + // |----------||--------------| + // 0x000000000000000000000000000000000000ffffffffffff0000000000000000 + unsigned lowZeros = 0; + unsigned highOnes = 0; + while (((_value >> lowZeros) & 1) == 0 && lowZeros < 256) + ++lowZeros; + while (((_value >> (lowZeros + highOnes)) & 1) == 1 && highOnes < 256) + ++highOnes; + if ( + m_dialect.evmVersion().hasBitwiseShifting() && + highOnes > 32 && // push would be more efficient otherwise + ((_value >> (lowZeros + highOnes)) == 0) && // this is a pure mask + ((lowZeros + highOnes < 256) || lowZeros > 16) // otherwise negation is more effective + ) + { + // this is a big enough mask to use zero negation + Representation newRoutine = represent(*auxHandles.not_, represent(0)); + if ((highOnes + lowZeros) != 256) + newRoutine = represent(*auxHandles.shr, represent(256 - highOnes), newRoutine); + if (lowZeros > 0) + newRoutine = represent(*auxHandles.shl, represent(lowZeros), newRoutine); + routine = min(std::move(routine), std::move(newRoutine)); + } + + if (numberEncodingSize(~_value) < numberEncodingSize(_value)) // Negated is shorter to represent routine = min(std::move(routine), represent(*auxHandles.not_, findRepresentation(~_value))); diff --git a/libyul/backends/evm/EVMDialect.cpp b/libyul/backends/evm/EVMDialect.cpp index 62f0d7a695c3..d5484b19d8f9 100644 --- a/libyul/backends/evm/EVMDialect.cpp +++ b/libyul/backends/evm/EVMDialect.cpp @@ -264,6 +264,7 @@ EVMDialect::EVMDialect(langutil::EVMVersion _evmVersion, std::optional m_auxiliaryBuiltinHandles.mul = EVMDialect::findBuiltin("mul"); m_auxiliaryBuiltinHandles.not_ = EVMDialect::findBuiltin("not"); m_auxiliaryBuiltinHandles.shl = EVMDialect::findBuiltin("shl"); + m_auxiliaryBuiltinHandles.shr = EVMDialect::findBuiltin("shr"); m_auxiliaryBuiltinHandles.sub = EVMDialect::findBuiltin("sub"); } diff --git a/libyul/backends/evm/EVMDialect.h b/libyul/backends/evm/EVMDialect.h index fa92b1cf3242..311680ae2175 100644 --- a/libyul/backends/evm/EVMDialect.h +++ b/libyul/backends/evm/EVMDialect.h @@ -63,6 +63,7 @@ class EVMDialect: public Dialect std::optional mul; std::optional not_; std::optional shl; + std::optional shr; std::optional sub; }; /// Constructor, should only be used internally. Use the factory functions below. diff --git a/test/cmdlineTests/ir_subobject_order/output b/test/cmdlineTests/ir_subobject_order/output index d41b65bf9a62..cf9d501f7969 100644 --- a/test/cmdlineTests/ir_subobject_order/output +++ b/test/cmdlineTests/ir_subobject_order/output @@ -30,7 +30,7 @@ object "C_33" { if callvalue() { revert(0, 0) } let _2 := datasize("A_13") let _3 := add(_1, _2) - if or(gt(_3, sub(shl(64, 1), 1)), lt(_3, _1)) + if or(gt(_3, shr(192, not(0))), lt(_3, _1)) { mstore(0, shl(224, 0x4e487b71)) mstore(4, 0x41) @@ -44,11 +44,11 @@ object "C_33" { returndatacopy(pos, 0, returndatasize()) revert(pos, returndatasize()) } - sstore(0, or(and(sload(0), not(sub(shl(160, 1), 1))), and(expr_address, sub(shl(160, 1), 1)))) + sstore(0, or(and(sload(0), shl(160, not(0))), and(expr_address, shr(96, not(0))))) let _4 := mload(64) let _5 := datasize("B_7") let _6 := add(_4, _5) - if or(gt(_6, sub(shl(64, 1), 1)), lt(_6, _4)) + if or(gt(_6, shr(192, not(0))), lt(_6, _4)) { mstore(0, shl(224, 0x4e487b71)) mstore(4, 0x41) @@ -62,7 +62,7 @@ object "C_33" { returndatacopy(pos_1, 0, returndatasize()) revert(pos_1, returndatasize()) } - sstore(0x01, or(and(sload(0x01), not(sub(shl(160, 1), 1))), and(expr_address_1, sub(shl(160, 1), 1)))) + sstore(0x01, or(and(sload(0x01), shl(160, not(0))), and(expr_address_1, shr(96, not(0))))) let _7 := mload(64) let _8 := datasize("C_33_deployed") codecopy(_7, dataoffset("C_33_deployed"), _8) diff --git a/test/cmdlineTests/standard_debug_info_in_yul_location/output.json b/test/cmdlineTests/standard_debug_info_in_yul_location/output.json index 16220fd619b0..a0041611e421 100644 --- a/test/cmdlineTests/standard_debug_info_in_yul_location/output.json +++ b/test/cmdlineTests/standard_debug_info_in_yul_location/output.json @@ -620,7 +620,7 @@ object \"C_54\" { let programSize := datasize(\"C_54\") let argSize := sub(codesize(), programSize) let newFreePtr := add(_1, and(add(argSize, 31), not(31))) - if or(gt(newFreePtr, sub(shl(64, 1), 1)), lt(newFreePtr, _1)) + if or(gt(newFreePtr, shr(192, not(0))), lt(newFreePtr, _1)) { mstore(/** @src -1:-1:-1 */ 0, /** @src 0:79:510 \"contract C...\" */ shl(224, 0x4e487b71)) mstore(4, 0x41) @@ -685,7 +685,7 @@ object \"C_54\" { if callvalue() { revert(0, 0) } if slt(add(calldatasize(), not(3)), 0) { revert(0, 0) } let _3 := sload(0) - if eq(_3, sub(shl(255, 1), 1)) + if eq(_3, shr(1, not(0))) { mstore(0, shl(224, 0x4e487b71)) mstore(4, 0x11) @@ -1457,7 +1457,7 @@ object \"D_72\" { let programSize := datasize(\"D_72\") let argSize := sub(codesize(), programSize) let newFreePtr := add(_1, and(add(argSize, 31), not(31))) - if or(gt(newFreePtr, sub(shl(64, 1), 1)), lt(newFreePtr, _1)) + if or(gt(newFreePtr, shr(192, not(0))), lt(newFreePtr, _1)) { mstore(/** @src -1:-1:-1 */ 0, /** @src 1:91:181 \"contract D is C(3)...\" */ shl(224, 0x4e487b71)) mstore(4, 0x41) @@ -1529,7 +1529,7 @@ object \"D_72\" { if callvalue() { revert(0, 0) } if slt(add(calldatasize(), not(3)), 0) { revert(0, 0) } let _3 := sload(0) - if eq(_3, sub(shl(255, 1), 1)) + if eq(_3, shr(1, not(0))) { mstore(0, shl(224, 0x4e487b71)) mstore(4, 0x11) diff --git a/test/libsolidity/semanticTests/array/copying/array_of_struct_memory_to_storage.sol b/test/libsolidity/semanticTests/array/copying/array_of_struct_memory_to_storage.sol index 35f896f26e22..636da7d218a4 100644 --- a/test/libsolidity/semanticTests/array/copying/array_of_struct_memory_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/array_of_struct_memory_to_storage.sol @@ -19,4 +19,4 @@ contract C { // compileViaYul: true // ---- // f() -> 10, 11, 12 -// gas irOptimized: 118834 +// gas irOptimized: 118770 diff --git a/test/libsolidity/semanticTests/array/copying/array_of_structs_containing_arrays_memory_to_storage.sol b/test/libsolidity/semanticTests/array/copying/array_of_structs_containing_arrays_memory_to_storage.sol index 355c268f2514..ceb5e010c6f5 100644 --- a/test/libsolidity/semanticTests/array/copying/array_of_structs_containing_arrays_memory_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/array_of_structs_containing_arrays_memory_to_storage.sol @@ -26,4 +26,4 @@ contract C { // compileViaYul: true // ---- // f() -> 3, 3, 3, 1 -// gas irOptimized: 181928 +// gas irOptimized: 181881 diff --git a/test/libsolidity/semanticTests/array/copying/storage_memory_nested.sol b/test/libsolidity/semanticTests/array/copying/storage_memory_nested.sol index b9652316d2e6..0379011a3b7e 100644 --- a/test/libsolidity/semanticTests/array/copying/storage_memory_nested.sol +++ b/test/libsolidity/semanticTests/array/copying/storage_memory_nested.sol @@ -17,6 +17,6 @@ contract C { } // ---- // f() -> 1, 2, 3, 4, 5, 6, 7 -// gas irOptimized: 206419 +// gas irOptimized: 206422 // gas legacy: 211758 // gas legacyOptimized: 210977 diff --git a/test/libsolidity/semanticTests/array/copying/storage_memory_nested_from_pointer.sol b/test/libsolidity/semanticTests/array/copying/storage_memory_nested_from_pointer.sol index 0dd1594fd0db..d91ee2be8250 100644 --- a/test/libsolidity/semanticTests/array/copying/storage_memory_nested_from_pointer.sol +++ b/test/libsolidity/semanticTests/array/copying/storage_memory_nested_from_pointer.sol @@ -18,6 +18,6 @@ contract C { } // ---- // f() -> 1, 2, 3, 4, 5, 6, 7 -// gas irOptimized: 206419 +// gas irOptimized: 206422 // gas legacy: 211770 // gas legacyOptimized: 210989 diff --git a/test/libsolidity/semanticTests/array/fixed_arrays_in_constructors.sol b/test/libsolidity/semanticTests/array/fixed_arrays_in_constructors.sol index 544691d0929e..c96e791c6673 100644 --- a/test/libsolidity/semanticTests/array/fixed_arrays_in_constructors.sol +++ b/test/libsolidity/semanticTests/array/fixed_arrays_in_constructors.sol @@ -9,8 +9,8 @@ contract Creator { } // ---- // constructor(): 1, 2, 3, 4 -> -// gas irOptimized: 103767 -// gas irOptimized code: 21800 +// gas irOptimized: 103634 +// gas irOptimized code: 21400 // gas legacy: 115185 // gas legacy code: 59000 // gas legacyOptimized: 104565 diff --git a/test/libsolidity/semanticTests/array/function_array_cross_calls.sol b/test/libsolidity/semanticTests/array/function_array_cross_calls.sol index 6997386a2006..58c1367e7eb1 100644 --- a/test/libsolidity/semanticTests/array/function_array_cross_calls.sol +++ b/test/libsolidity/semanticTests/array/function_array_cross_calls.sol @@ -42,7 +42,7 @@ contract C { } // ---- // test() -> 5, 6, 7 -// gas irOptimized: 86728 +// gas irOptimized: 86720 // gas irOptimized code: 155400 // gas legacy: 97551 // gas legacy code: 342800 diff --git a/test/libsolidity/semanticTests/constructor/constructor_arguments_external.sol b/test/libsolidity/semanticTests/constructor/constructor_arguments_external.sol index 3e3c4bdabcbf..0b2f22476ae7 100644 --- a/test/libsolidity/semanticTests/constructor/constructor_arguments_external.sol +++ b/test/libsolidity/semanticTests/constructor/constructor_arguments_external.sol @@ -19,7 +19,7 @@ contract Main { // bytecodeFormat: legacy,>=EOFv1 // ---- // constructor(): "abc", true -// gas irOptimized: 80022 +// gas irOptimized: 80011 // gas irOptimized code: 23600 // gas legacy: 85098 // gas legacy code: 58200 diff --git a/test/libsolidity/semanticTests/events/event_emit_from_other_contract.sol b/test/libsolidity/semanticTests/events/event_emit_from_other_contract.sol index 77f816f30e08..68473bda4ac6 100644 --- a/test/libsolidity/semanticTests/events/event_emit_from_other_contract.sol +++ b/test/libsolidity/semanticTests/events/event_emit_from_other_contract.sol @@ -19,7 +19,7 @@ contract C { // bytecodeFormat: legacy // ---- // constructor() -> -// gas irOptimized: 113747 +// gas irOptimized: 113613 // gas irOptimized code: 50800 // gas legacy: 119791 // gas legacy code: 125200 diff --git a/test/libsolidity/semanticTests/functionCall/creation_function_call_with_args.sol b/test/libsolidity/semanticTests/functionCall/creation_function_call_with_args.sol index 1932d3448d24..356cf3a2ed3d 100644 --- a/test/libsolidity/semanticTests/functionCall/creation_function_call_with_args.sol +++ b/test/libsolidity/semanticTests/functionCall/creation_function_call_with_args.sol @@ -15,7 +15,7 @@ contract D { } // ---- // constructor(): 2 -> -// gas irOptimized: 138598 +// gas irOptimized: 138464 // gas irOptimized code: 53200 // gas legacy: 145569 // gas legacy code: 95600 diff --git a/test/libsolidity/semanticTests/functionCall/creation_function_call_with_salt.sol b/test/libsolidity/semanticTests/functionCall/creation_function_call_with_salt.sol index c758bab09958..89a18d41a53e 100644 --- a/test/libsolidity/semanticTests/functionCall/creation_function_call_with_salt.sol +++ b/test/libsolidity/semanticTests/functionCall/creation_function_call_with_salt.sol @@ -17,7 +17,7 @@ contract D { // EVMVersion: >=constantinople // ---- // constructor(): 2 -> -// gas irOptimized: 138774 +// gas irOptimized: 138640 // gas irOptimized code: 53200 // gas legacy: 145935 // gas legacy code: 95600 diff --git a/test/libsolidity/semanticTests/functionCall/gas_and_value_basic.sol b/test/libsolidity/semanticTests/functionCall/gas_and_value_basic.sol index d7b7c27b0125..1c79159fe0d3 100644 --- a/test/libsolidity/semanticTests/functionCall/gas_and_value_basic.sol +++ b/test/libsolidity/semanticTests/functionCall/gas_and_value_basic.sol @@ -38,7 +38,7 @@ contract test { // bytecodeFormat: legacy // ---- // constructor(), 20 wei -> -// gas irOptimized: 119899 +// gas irOptimized: 119765 // gas irOptimized code: 130200 // gas legacy: 130583 // gas legacy code: 261200 diff --git a/test/libsolidity/semanticTests/immutable/immutable_tag_too_large_bug.sol b/test/libsolidity/semanticTests/immutable/immutable_tag_too_large_bug.sol index f67871eb9d89..274cc4f02777 100644 --- a/test/libsolidity/semanticTests/immutable/immutable_tag_too_large_bug.sol +++ b/test/libsolidity/semanticTests/immutable/immutable_tag_too_large_bug.sol @@ -41,8 +41,8 @@ contract C { // compileViaYul: true // ---- // constructor() -> -// gas irOptimized: 73067 -// gas irOptimized code: 290600 +// gas irOptimized: 73019 +// gas irOptimized code: 290000 // gas legacy: 83499 // gas legacy code: 408800 // f() -> -1, 1 diff --git a/test/libsolidity/semanticTests/inheritance/value_for_constructor.sol b/test/libsolidity/semanticTests/inheritance/value_for_constructor.sol index 7092cd210f47..64fed3d88874 100644 --- a/test/libsolidity/semanticTests/inheritance/value_for_constructor.sol +++ b/test/libsolidity/semanticTests/inheritance/value_for_constructor.sol @@ -39,7 +39,7 @@ contract Main { } // ---- // constructor(), 22 wei -> -// gas irOptimized: 143297 +// gas irOptimized: 143152 // gas irOptimized code: 114400 // gas legacy: 156599 // gas legacy code: 236400 diff --git a/test/libsolidity/semanticTests/inlineAssembly/transient_storage_selfdestruct.sol b/test/libsolidity/semanticTests/inlineAssembly/transient_storage_selfdestruct.sol index bd15299f4fce..4e7ffde1e043 100644 --- a/test/libsolidity/semanticTests/inlineAssembly/transient_storage_selfdestruct.sol +++ b/test/libsolidity/semanticTests/inlineAssembly/transient_storage_selfdestruct.sol @@ -41,7 +41,7 @@ contract D { // bytecodeFormat: legacy // ---- // constructor() -> -// gas irOptimized: 126919 +// gas irOptimized: 126785 // gas irOptimized code: 214800 // gas legacy: 149480 // gas legacy code: 501200 diff --git a/test/libsolidity/semanticTests/storageLayoutSpecifier/constructor.sol b/test/libsolidity/semanticTests/storageLayoutSpecifier/constructor.sol index c5a90c134912..f3c19c73eb38 100644 --- a/test/libsolidity/semanticTests/storageLayoutSpecifier/constructor.sol +++ b/test/libsolidity/semanticTests/storageLayoutSpecifier/constructor.sol @@ -18,7 +18,7 @@ contract C is B layout at 7 { } // ---- // constructor(): 1, 2, 3 -// gas irOptimized: 104118 +// gas irOptimized: 104099 // gas irOptimized code: 30000 // gas legacy: 114749 // gas legacy code: 71400 diff --git a/test/libsolidity/semanticTests/structs/struct_memory_to_storage_function_ptr.sol b/test/libsolidity/semanticTests/structs/struct_memory_to_storage_function_ptr.sol index 1f8abcf66dbf..7ae660db568f 100644 --- a/test/libsolidity/semanticTests/structs/struct_memory_to_storage_function_ptr.sol +++ b/test/libsolidity/semanticTests/structs/struct_memory_to_storage_function_ptr.sol @@ -28,6 +28,6 @@ contract C { } // ---- // f() -> 42, 23, 34, 42, 42 -// gas irOptimized: 110722 +// gas irOptimized: 110732 // gas legacy: 111990 // gas legacyOptimized: 110536 diff --git a/test/libsolidity/semanticTests/userDefinedValueType/erc20.sol b/test/libsolidity/semanticTests/userDefinedValueType/erc20.sol index 9dcc85cb15fc..5cb2873ab7a4 100644 --- a/test/libsolidity/semanticTests/userDefinedValueType/erc20.sol +++ b/test/libsolidity/semanticTests/userDefinedValueType/erc20.sol @@ -113,8 +113,8 @@ contract ERC20 { // ---- // constructor() // ~ emit Transfer(address,address,uint256): #0x00, #0x1212121212121212121212121212120000000012, 0x14 -// gas irOptimized: 120932 -// gas irOptimized code: 229800 +// gas irOptimized: 120852 +// gas irOptimized code: 228800 // gas legacy: 163350 // gas legacy code: 671400 // gas legacyOptimized: 126678 diff --git a/test/libsolidity/semanticTests/various/erc20.sol b/test/libsolidity/semanticTests/various/erc20.sol index a42d398f0866..035893ded98c 100644 --- a/test/libsolidity/semanticTests/various/erc20.sol +++ b/test/libsolidity/semanticTests/various/erc20.sol @@ -96,8 +96,8 @@ contract ERC20 { // ---- // constructor() // ~ emit Transfer(address,address,uint256): #0x00, #0x1212121212121212121212121212120000000012, 0x14 -// gas irOptimized: 121248 -// gas irOptimized code: 232000 +// gas irOptimized: 121168 +// gas irOptimized code: 231000 // gas legacy: 159957 // gas legacy code: 647600 // gas legacyOptimized: 126106 diff --git a/test/libsolidity/semanticTests/various/selfdestruct_post_cancun.sol b/test/libsolidity/semanticTests/various/selfdestruct_post_cancun.sol index 414c17732e4f..199a7aa3d302 100644 --- a/test/libsolidity/semanticTests/various/selfdestruct_post_cancun.sol +++ b/test/libsolidity/semanticTests/various/selfdestruct_post_cancun.sol @@ -65,8 +65,8 @@ contract D { // bytecodeFormat: legacy // ---- // constructor(), 1 ether -> -// gas irOptimized: 66279 -// gas irOptimized code: 166200 +// gas irOptimized: 66043 +// gas irOptimized code: 163400 // gas legacy: 76227 // gas legacy code: 298200 // gas legacyOptimized: 66074 diff --git a/test/libsolidity/semanticTests/various/selfdestruct_post_cancun_multiple_beneficiaries.sol b/test/libsolidity/semanticTests/various/selfdestruct_post_cancun_multiple_beneficiaries.sol index 3c09594846f7..bf3eeca1c900 100644 --- a/test/libsolidity/semanticTests/various/selfdestruct_post_cancun_multiple_beneficiaries.sol +++ b/test/libsolidity/semanticTests/various/selfdestruct_post_cancun_multiple_beneficiaries.sol @@ -36,8 +36,8 @@ contract D { // bytecodeFormat: legacy // ---- // constructor(), 2 ether -> -// gas irOptimized: 107630 -// gas irOptimized code: 114400 +// gas irOptimized: 107344 +// gas irOptimized code: 111400 // gas legacy: 120439 // gas legacy code: 253800 // gas legacyOptimized: 108382 @@ -47,7 +47,7 @@ contract D { // balance -> 2000000000000000000 // exists() -> false // test_deploy_and_terminate_twice() -> -// gas irOptimized: 121363 +// gas irOptimized: 121361 // gas irOptimized code: 13400 // gas legacy: 122386 // gas legacy code: 43200 diff --git a/test/libsolidity/semanticTests/various/selfdestruct_post_cancun_redeploy.sol b/test/libsolidity/semanticTests/various/selfdestruct_post_cancun_redeploy.sol index ecb0e7123659..8df1dd634219 100644 --- a/test/libsolidity/semanticTests/various/selfdestruct_post_cancun_redeploy.sol +++ b/test/libsolidity/semanticTests/various/selfdestruct_post_cancun_redeploy.sol @@ -83,8 +83,8 @@ contract D { // bytecodeFormat: legacy // ---- // constructor(), 1 ether -> -// gas irOptimized: 131902 -// gas irOptimized code: 282800 +// gas irOptimized: 131496 +// gas irOptimized code: 279400 // gas legacy: 151236 // gas legacy code: 533800 // gas legacyOptimized: 130256 @@ -92,7 +92,7 @@ contract D { // exists() -> false // test_deploy_and_terminate() -> // ~ emit Deployed(address,bytes32) from 0x137aa4dfc0911524504fcd4d98501f179bc13b4a: 0x7e6580007e709ac52945fae182c61131d42634e8, 0x1234000000000000000000000000000000000000000000000000000000000000 -// gas irOptimized: 96480 +// gas irOptimized: 96478 // gas irOptimized code: 20800 // gas legacy: 97788 // gas legacy code: 20800 diff --git a/test/libsolidity/semanticTests/various/senders_balance.sol b/test/libsolidity/semanticTests/various/senders_balance.sol index 73c728feb656..950e03d1b4cb 100644 --- a/test/libsolidity/semanticTests/various/senders_balance.sol +++ b/test/libsolidity/semanticTests/various/senders_balance.sol @@ -16,7 +16,7 @@ contract D { } // ---- // constructor(), 27 wei -> -// gas irOptimized: 113834 +// gas irOptimized: 113700 // gas irOptimized code: 53200 // gas legacy: 117834 // gas legacy code: 100600 diff --git a/test/libyul/yulOptimizerTests/fullSuite/abi2.yul b/test/libyul/yulOptimizerTests/fullSuite/abi2.yul index 2f2e060be089..8c3a23b60b77 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/abi2.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/abi2.yul @@ -1080,7 +1080,7 @@ // let _1 := mload(1) // let _2 := mload(0) // if slt(sub(_1, _2), 64) { revert(0, 0) } -// sstore(0, and(calldataload(_2), sub(shl(160, 1), 1))) +// sstore(0, and(calldataload(_2), shr(96, not(0)))) // let x0, x1, x2, x3, x4 := abi_decode_addresst_uint256t_bytes_calldatat_enum_Operation(mload(7), mload(8)) // sstore(x1, x0) // sstore(x3, x2) @@ -1090,7 +1090,7 @@ // function abi_decode_addresst_uint256t_bytes_calldatat_enum_Operation(headStart, dataEnd) -> value0, value1, value2, value3, value4 // { // if slt(sub(dataEnd, headStart), 128) { revert(0, 0) } -// value0 := and(calldataload(headStart), sub(shl(160, 1), 1)) +// value0 := and(calldataload(headStart), shr(96, not(0))) // value1 := calldataload(add(headStart, 32)) // let offset := calldataload(add(headStart, 64)) // if gt(offset, 0xffffffffffffffff) { revert(0, 0) } @@ -1107,7 +1107,7 @@ // { // tail := add(headStart, 352) // mstore(headStart, value0) -// mstore(add(headStart, 32), and(value1, sub(shl(160, 1), 1))) +// mstore(add(headStart, 32), and(value1, shr(96, not(0)))) // mstore(add(headStart, 64), value2) // mstore(add(headStart, 96), value3) // if iszero(lt(value4, 3)) { invalid() } @@ -1115,8 +1115,8 @@ // mstore(add(headStart, 160), value5) // mstore(add(headStart, 192), value6) // mstore(add(headStart, 224), value7) -// mstore(add(headStart, 256), and(value8, sub(shl(160, 1), 1))) -// mstore(add(headStart, 288), and(value9, sub(shl(160, 1), 1))) +// mstore(add(headStart, 256), and(value8, shr(96, not(0)))) +// mstore(add(headStart, 288), and(value9, shr(96, not(0)))) // mstore(add(headStart, 320), value10) // } // function cleanup_revert_enum_Operation(value) -> cleaned diff --git a/test/libyul/yulOptimizerTests/fullSuite/abi_example1.yul b/test/libyul/yulOptimizerTests/fullSuite/abi_example1.yul index dbb87439f637..e1b524557641 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/abi_example1.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/abi_example1.yul @@ -478,7 +478,7 @@ // let i_1 := 0 // for { } lt(i_1, 0x3) { i_1 := add(i_1, 1) } // { -// mstore(pos_1, and(mload(srcPtr_1), sub(shl(160, 1), 1))) +// mstore(pos_1, and(mload(srcPtr_1), shr(96, not(0)))) // srcPtr_1 := add(srcPtr_1, 0x20) // pos_1 := add(pos_1, 0x20) // } diff --git a/test/libyul/yulOptimizerTests/fullSuite/combine_shift_and_and_3.yul b/test/libyul/yulOptimizerTests/fullSuite/combine_shift_and_and_3.yul index 17de07de7cd7..85d8243565b4 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/combine_shift_and_and_3.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/combine_shift_and_and_3.yul @@ -25,7 +25,7 @@ // sstore(15, x) // sstore(16, and(_1, not(4095))) // sstore(17, and(_2, sub(shl(248, 1), 16))) -// sstore(18, and(_2, sub(shl(244, 1), 1))) +// sstore(18, and(_2, shr(12, not(0)))) // sstore(19, and(_1, sub(shl(252, 1), 256))) // sstore(20, 0) // } diff --git a/test/libyul/yulOptimizerTests/fullSuite/create2_and_mask.yul b/test/libyul/yulOptimizerTests/fullSuite/create2_and_mask.yul index f0c54556a423..7449812fd7bc 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/create2_and_mask.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/create2_and_mask.yul @@ -14,7 +14,7 @@ // // { // { -// let a := and(create2(0, 0, 0x20, 0), sub(shl(160, 1), 1)) -// sstore(a, and(sub(shl(160, 1), 1), create2(0, 0, 0x20, 0))) +// let a := and(create2(0, 0, 0x20, 0), shr(96, not(0))) +// sstore(a, and(shr(96, not(0)), create2(0, 0, 0x20, 0))) // } // } diff --git a/test/libyul/yulOptimizerTests/fullSuite/create_and_mask.yul b/test/libyul/yulOptimizerTests/fullSuite/create_and_mask.yul index 984d9a458d8c..fbcdb2bdd2ec 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/create_and_mask.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/create_and_mask.yul @@ -14,7 +14,7 @@ // // { // { -// let a := and(create(0, 0, 0x20), sub(shl(160, 1), 1)) -// sstore(a, and(sub(shl(160, 1), 1), create(0, 0, 0x20))) +// let a := and(create(0, 0, 0x20), shr(96, not(0))) +// sstore(a, and(shr(96, not(0)), create(0, 0, 0x20))) // } // } diff --git a/test/libyul/yulOptimizerTests/fullSuite/extcodelength.yul b/test/libyul/yulOptimizerTests/fullSuite/extcodelength.yul index 772ec67cfec8..94084f12671a 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/extcodelength.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/extcodelength.yul @@ -25,7 +25,7 @@ // { // { // let value := calldataload(4) -// if iszero(eq(value, and(value, sub(shl(160, 1), 1)))) { revert(0, 0) } +// if iszero(eq(value, and(value, shr(96, not(0))))) { revert(0, 0) } // let length := extcodesize(value) // if gt(length, 0xffffffffffffffff) { revert(0, 0) } // let memPtr := mload(64) From 2b974c32ca5c4add0dc6579cbe41c84b11f66618 Mon Sep 17 00:00:00 2001 From: Mohammad Rezaei Date: Wed, 15 Oct 2025 22:28:02 -0400 Subject: [PATCH 5/7] regenerate test output --- .../standard_yul_cfg_json_export/output.json | 149 +++++++++--------- test/cmdlineTests/yul_cfg_json_export/output | 149 +++++++++--------- 2 files changed, 148 insertions(+), 150 deletions(-) diff --git a/test/cmdlineTests/standard_yul_cfg_json_export/output.json b/test/cmdlineTests/standard_yul_cfg_json_export/output.json index 1142cdf732f5..119c7bf228f0 100644 --- a/test/cmdlineTests/standard_yul_cfg_json_export/output.json +++ b/test/cmdlineTests/standard_yul_cfg_json_export/output.json @@ -1041,7 +1041,7 @@ }, { "exit": { - "cond": "v85", + "cond": "v84", "targets": [ "Block18", "Block17" @@ -1079,39 +1079,38 @@ }, { "in": [ - "0x01", - "0xa0" + "0x00" ], - "op": "shl", + "op": "not", "out": [ - "v76" + "v74" ] }, { "in": [ - "0x01", - "v76" + "v74", + "0x60" ], - "op": "sub", + "op": "shr", "out": [ - "v77" + "v76" ] }, { "in": [ - "v77", + "v76", "v60" ], "op": "and", "out": [ - "v82" + "v81" ] }, { "in": [], "op": "gas", "out": [ - "v83" + "v82" ] }, { @@ -1120,21 +1119,21 @@ "v68", "0x04", "v68", - "v82", - "v83" + "v81", + "v82" ], "op": "staticcall", "out": [ - "v84" + "v83" ] }, { "in": [ - "v84" + "v83" ], "op": "iszero", "out": [ - "v85" + "v84" ] } ], @@ -1144,7 +1143,7 @@ ], "out": [ "v68", - "v84" + "v83" ] }, "type": "BuiltinCall" @@ -1204,7 +1203,7 @@ }, { "exit": { - "cond": "v84", + "cond": "v83", "targets": [ "Block21", "Block20" @@ -1216,7 +1215,7 @@ "liveness": { "in": [ "v68", - "v84" + "v83" ], "out": [ "v68" @@ -1235,21 +1234,21 @@ ], "op": "mload", "out": [ - "v86" + "v85" ] }, { "in": [], "op": "returndatasize", "out": [ - "v87" + "v86" ] }, { "in": [ - "v87", + "v86", "0x00", - "v86" + "v85" ], "op": "returndatacopy", "out": [] @@ -1258,13 +1257,13 @@ "in": [], "op": "returndatasize", "out": [ - "v89" + "v88" ] }, { "in": [ - "v89", - "v86" + "v88", + "v85" ], "op": "revert", "out": [] @@ -1289,11 +1288,11 @@ { "in": [ "0x00", - "v144" + "v143" ], "op": "PhiFunction", "out": [ - "phi146" + "phi145" ] }, { @@ -1302,13 +1301,13 @@ ], "op": "mload", "out": [ - "v145" + "v144" ] }, { "in": [ - "phi146", - "v145" + "phi145", + "v144" ], "op": "mstore", "out": [] @@ -1316,7 +1315,7 @@ { "in": [ "0x20", - "v145" + "v144" ], "op": "return", "out": [] @@ -1324,7 +1323,7 @@ ], "liveness": { "in": [ - "phi146" + "phi145" ], "out": [] }, @@ -1332,7 +1331,7 @@ }, { "exit": { - "cond": "v97", + "cond": "v96", "targets": [ "Block23", "Block22" @@ -1345,17 +1344,17 @@ "in": [], "op": "returndatasize", "out": [ - "v96" + "v95" ] }, { "in": [ - "v96", + "v95", "0x20" ], "op": "gt", "out": [ - "v97" + "v96" ] } ], @@ -1375,7 +1374,7 @@ "Block22" ], "exit": { - "cond": "v116", + "cond": "v115", "targets": [ "Block25", "Block24" @@ -1387,11 +1386,11 @@ { "in": [ "0x20", - "v98" + "v97" ], "op": "PhiFunction", "out": [ - "phi101" + "phi100" ] }, { @@ -1400,79 +1399,79 @@ ], "op": "not", "out": [ - "v100" + "v99" ] }, { "in": [ "0x1f", - "phi101" + "phi100" ], "op": "add", "out": [ - "v104" + "v103" ] }, { "in": [ - "v100", - "v104" + "v99", + "v103" ], "op": "and", "out": [ - "v105" + "v104" ] }, { "in": [ - "v105", + "v104", "v68" ], "op": "add", "out": [ - "v113" + "v112" ] }, { "in": [ "v68", - "v113" + "v112" ], "op": "lt", "out": [ - "v114" + "v113" ] }, { "in": [ "0xffffffffffffffff", - "v113" + "v112" ], "op": "gt", "out": [ - "v115" + "v114" ] }, { "in": [ - "v114", - "v115" + "v113", + "v114" ], "op": "or", "out": [ - "v116" + "v115" ] } ], "liveness": { "in": [ "v68", - "phi101" + "phi100" ], "out": [ "v68", - "phi101", - "v113" + "phi100", + "v112" ] }, "type": "BuiltinCall" @@ -1490,7 +1489,7 @@ "in": [], "op": "returndatasize", "out": [ - "v98" + "v97" ] } ], @@ -1499,7 +1498,7 @@ "v68" ], "out": [ - "v98", + "v97", "v68" ] }, @@ -1507,7 +1506,7 @@ }, { "exit": { - "cond": "v137", + "cond": "v136", "targets": [ "Block28", "Block27" @@ -1518,7 +1517,7 @@ "instructions": [ { "in": [ - "v113", + "v112", "0x40" ], "op": "mstore", @@ -1526,40 +1525,40 @@ }, { "in": [ - "phi101", + "phi100", "v68" ], "op": "add", "out": [ - "v135" + "v134" ] }, { "in": [ "v68", - "v135" + "v134" ], "op": "sub", "out": [ - "v136" + "v135" ] }, { "in": [ "0x20", - "v136" + "v135" ], "op": "slt", "out": [ - "v137" + "v136" ] } ], "liveness": { "in": [ "v68", - "phi101", - "v113" + "phi100", + "v112" ], "out": [ "v68" @@ -1580,12 +1579,12 @@ ], "op": "shl", "out": [ - "v117" + "v116" ] }, { "in": [ - "v117", + "v116", "0x00" ], "op": "mstore", @@ -1629,7 +1628,7 @@ ], "op": "mload", "out": [ - "v144" + "v143" ] } ], @@ -1638,7 +1637,7 @@ "v68" ], "out": [ - "v144" + "v143" ] }, "type": "BuiltinCall" diff --git a/test/cmdlineTests/yul_cfg_json_export/output b/test/cmdlineTests/yul_cfg_json_export/output index 3cc42ee6441d..e7713a913d5b 100644 --- a/test/cmdlineTests/yul_cfg_json_export/output +++ b/test/cmdlineTests/yul_cfg_json_export/output @@ -1041,7 +1041,7 @@ Yul Control Flow Graph: }, { "exit": { - "cond": "v85", + "cond": "v84", "targets": [ "Block18", "Block17" @@ -1079,39 +1079,38 @@ Yul Control Flow Graph: }, { "in": [ - "0x01", - "0xa0" + "0x00" ], - "op": "shl", + "op": "not", "out": [ - "v76" + "v74" ] }, { "in": [ - "0x01", - "v76" + "v74", + "0x60" ], - "op": "sub", + "op": "shr", "out": [ - "v77" + "v76" ] }, { "in": [ - "v77", + "v76", "v60" ], "op": "and", "out": [ - "v82" + "v81" ] }, { "in": [], "op": "gas", "out": [ - "v83" + "v82" ] }, { @@ -1120,21 +1119,21 @@ Yul Control Flow Graph: "v68", "0x04", "v68", - "v82", - "v83" + "v81", + "v82" ], "op": "staticcall", "out": [ - "v84" + "v83" ] }, { "in": [ - "v84" + "v83" ], "op": "iszero", "out": [ - "v85" + "v84" ] } ], @@ -1144,7 +1143,7 @@ Yul Control Flow Graph: ], "out": [ "v68", - "v84" + "v83" ] }, "type": "BuiltinCall" @@ -1204,7 +1203,7 @@ Yul Control Flow Graph: }, { "exit": { - "cond": "v84", + "cond": "v83", "targets": [ "Block21", "Block20" @@ -1216,7 +1215,7 @@ Yul Control Flow Graph: "liveness": { "in": [ "v68", - "v84" + "v83" ], "out": [ "v68" @@ -1235,21 +1234,21 @@ Yul Control Flow Graph: ], "op": "mload", "out": [ - "v86" + "v85" ] }, { "in": [], "op": "returndatasize", "out": [ - "v87" + "v86" ] }, { "in": [ - "v87", + "v86", "0x00", - "v86" + "v85" ], "op": "returndatacopy", "out": [] @@ -1258,13 +1257,13 @@ Yul Control Flow Graph: "in": [], "op": "returndatasize", "out": [ - "v89" + "v88" ] }, { "in": [ - "v89", - "v86" + "v88", + "v85" ], "op": "revert", "out": [] @@ -1289,11 +1288,11 @@ Yul Control Flow Graph: { "in": [ "0x00", - "v144" + "v143" ], "op": "PhiFunction", "out": [ - "phi146" + "phi145" ] }, { @@ -1302,13 +1301,13 @@ Yul Control Flow Graph: ], "op": "mload", "out": [ - "v145" + "v144" ] }, { "in": [ - "phi146", - "v145" + "phi145", + "v144" ], "op": "mstore", "out": [] @@ -1316,7 +1315,7 @@ Yul Control Flow Graph: { "in": [ "0x20", - "v145" + "v144" ], "op": "return", "out": [] @@ -1324,7 +1323,7 @@ Yul Control Flow Graph: ], "liveness": { "in": [ - "phi146" + "phi145" ], "out": [] }, @@ -1332,7 +1331,7 @@ Yul Control Flow Graph: }, { "exit": { - "cond": "v97", + "cond": "v96", "targets": [ "Block23", "Block22" @@ -1345,17 +1344,17 @@ Yul Control Flow Graph: "in": [], "op": "returndatasize", "out": [ - "v96" + "v95" ] }, { "in": [ - "v96", + "v95", "0x20" ], "op": "gt", "out": [ - "v97" + "v96" ] } ], @@ -1375,7 +1374,7 @@ Yul Control Flow Graph: "Block22" ], "exit": { - "cond": "v116", + "cond": "v115", "targets": [ "Block25", "Block24" @@ -1387,11 +1386,11 @@ Yul Control Flow Graph: { "in": [ "0x20", - "v98" + "v97" ], "op": "PhiFunction", "out": [ - "phi101" + "phi100" ] }, { @@ -1400,79 +1399,79 @@ Yul Control Flow Graph: ], "op": "not", "out": [ - "v100" + "v99" ] }, { "in": [ "0x1f", - "phi101" + "phi100" ], "op": "add", "out": [ - "v104" + "v103" ] }, { "in": [ - "v100", - "v104" + "v99", + "v103" ], "op": "and", "out": [ - "v105" + "v104" ] }, { "in": [ - "v105", + "v104", "v68" ], "op": "add", "out": [ - "v113" + "v112" ] }, { "in": [ "v68", - "v113" + "v112" ], "op": "lt", "out": [ - "v114" + "v113" ] }, { "in": [ "0xffffffffffffffff", - "v113" + "v112" ], "op": "gt", "out": [ - "v115" + "v114" ] }, { "in": [ - "v114", - "v115" + "v113", + "v114" ], "op": "or", "out": [ - "v116" + "v115" ] } ], "liveness": { "in": [ "v68", - "phi101" + "phi100" ], "out": [ "v68", - "phi101", - "v113" + "phi100", + "v112" ] }, "type": "BuiltinCall" @@ -1490,7 +1489,7 @@ Yul Control Flow Graph: "in": [], "op": "returndatasize", "out": [ - "v98" + "v97" ] } ], @@ -1499,7 +1498,7 @@ Yul Control Flow Graph: "v68" ], "out": [ - "v98", + "v97", "v68" ] }, @@ -1507,7 +1506,7 @@ Yul Control Flow Graph: }, { "exit": { - "cond": "v137", + "cond": "v136", "targets": [ "Block28", "Block27" @@ -1518,7 +1517,7 @@ Yul Control Flow Graph: "instructions": [ { "in": [ - "v113", + "v112", "0x40" ], "op": "mstore", @@ -1526,40 +1525,40 @@ Yul Control Flow Graph: }, { "in": [ - "phi101", + "phi100", "v68" ], "op": "add", "out": [ - "v135" + "v134" ] }, { "in": [ "v68", - "v135" + "v134" ], "op": "sub", "out": [ - "v136" + "v135" ] }, { "in": [ "0x20", - "v136" + "v135" ], "op": "slt", "out": [ - "v137" + "v136" ] } ], "liveness": { "in": [ "v68", - "phi101", - "v113" + "phi100", + "v112" ], "out": [ "v68" @@ -1580,12 +1579,12 @@ Yul Control Flow Graph: ], "op": "shl", "out": [ - "v117" + "v116" ] }, { "in": [ - "v117", + "v116", "0x00" ], "op": "mstore", @@ -1629,7 +1628,7 @@ Yul Control Flow Graph: ], "op": "mload", "out": [ - "v144" + "v143" ] } ], @@ -1638,7 +1637,7 @@ Yul Control Flow Graph: "v68" ], "out": [ - "v144" + "v143" ] }, "type": "BuiltinCall" From 418c1cc645f7140215d9a0aa4bcca24c3b11f56c Mon Sep 17 00:00:00 2001 From: "Daniel Von Fange (K)" Date: Fri, 15 May 2026 19:56:46 +0000 Subject: [PATCH 6/7] Refactor constant optimization code for clarity --- Changelog.md | 2 +- libevmasm/ConstantOptimiser.cpp | 67 ++++++++++++++++------- libyul/backends/evm/ConstantOptimiser.cpp | 64 +++++++++++++++------- 3 files changed, 93 insertions(+), 40 deletions(-) diff --git a/Changelog.md b/Changelog.md index ca7db5ff1196..52e182ba3955 100644 --- a/Changelog.md +++ b/Changelog.md @@ -3,7 +3,7 @@ Language Features: Compiler Features: -* Constant Optimizer: Compute masks using shifts when optimizing for size; use an ``--optimizer-runs`` value less than 200 for maximum size reduction. +* Constant Optimizer: More effiecent computed constants. Approximately a 2.9% reduction in optimized bytecode size, along with small improvement in average gas costs. Bugfixes: * NatSpec: Disallow `@return` tag in event documentation. diff --git a/libevmasm/ConstantOptimiser.cpp b/libevmasm/ConstantOptimiser.cpp index 18967ed20ae9..4f3c4b85efec 100644 --- a/libevmasm/ConstantOptimiser.cpp +++ b/libevmasm/ConstantOptimiser.cpp @@ -254,31 +254,58 @@ AssemblyItems ComputeMethod::findRepresentation(u256 const& _value) // Very small value, not worth computing return AssemblyItems{_value}; - // check for masks first - // high ones low zeros - // |----------||--------------| + // A constant having a single contiguous run of ones, common in masking, + // can be efficiently created by first filling with 1's, then shifting + // left and/or right as needed to make the sides full of zeros. + // + // onesEnd onesStart + // v v // 0x000000000000000000000000000000000000ffffffffffff0000000000000000 - unsigned lowZeros = 0; - unsigned highOnes = 0; - while (((_value >> lowZeros) & 1) == 0 && lowZeros < 256) - ++lowZeros; - while (((_value >> (lowZeros + highOnes)) & 1) == 1 && highOnes < 256) - ++highOnes; - if ( + // + // If the value is all zeros, both onesEnd and onesStart will be 256. + + // Find the index of the lowest one 1 bit + unsigned onesStart; + for (onesStart = 0; onesStart < 256; ++onesStart) + if (((_value >> onesStart) & 1) != 0) + break; + + // Find the index after the highest one 1 bit in the run of 1's. + unsigned onesEnd; + for (onesEnd = onesStart; onesEnd < 256; ++onesEnd) + if (((_value >> onesEnd) & 1) == 0) + break; + + // Check that there are no ones after onesEnd + bool const isOnlyContiguousOnes = (onesEnd == 256 || (_value >> onesEnd) == 0); + + bool const worthTrying = + _value != 0 && // defensive check m_params.evmVersion.hasBitwiseShifting() && - highOnes > 32 && // push would be more efficient otherwise - ((_value >> (lowZeros + highOnes)) == 0) && // this is a pure mask - ((lowZeros + highOnes < 256) || lowZeros > 16) // otherwise negation is more effective - ) + onesEnd - onesStart > 32 && // push would be more efficient otherwise + (onesEnd < 256 || onesStart > 16); // negation more effective for 0xFF..FFFF00 + + if (isOnlyContiguousOnes && worthTrying) { - // this is a big enough mask to use zero negation + // Build up the code, starting with a negated 0 to produce all ones. + // 0x00 ! == + // 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff AssemblyItems newRoutine = AssemblyItems{u256(0), Instruction::NOT}; - if ((highOnes + lowZeros) != 256) - newRoutine += AssemblyItems{u256(256 - highOnes), Instruction::SHR}; - if (lowZeros > 0) - newRoutine += AssemblyItems{u256(lowZeros), Instruction::SHL}; + + // Shift right as needed to create the correct number of 1 bits. + // 0x0000000000000000000000000000000000000000000000000000ffffffffffff + // If left aligned, we only need a left shift, and skip the right shift. + if (onesEnd != 256) + newRoutine += AssemblyItems{u256(256 - (onesEnd - onesStart)), Instruction::SHR}; + + // If needed, shift left to position the bits in the correct place + // or to setup a left aligned mask + // 0x000000000000000000000000000000000000ffffffffffff0000000000000000 + if (onesStart > 0) + newRoutine += AssemblyItems{u256(onesStart), Instruction::SHL}; return newRoutine; } + // pure negation can sometimes produce bad results // example: 0xff00000000000000000000000000000000000000000000000000000000000000 // 0xff at the most significant byte of u256 @@ -286,7 +313,7 @@ AssemblyItems ComputeMethod::findRepresentation(u256 const& _value) // the extra condition turns that into: shl(0xf8, 0xff) if ( numberEncodingSize(~_value) < numberEncodingSize(_value) && - (lowZeros+highOnes < 256 || highOnes > 16) + (onesEnd < 256 || onesEnd - onesStart > 16) ) // Negated is shorter to represent return findRepresentation(~_value) + AssemblyItems{Instruction::NOT}; diff --git a/libyul/backends/evm/ConstantOptimiser.cpp b/libyul/backends/evm/ConstantOptimiser.cpp index 74d3090c0056..cdd702e711d4 100644 --- a/libyul/backends/evm/ConstantOptimiser.cpp +++ b/libyul/backends/evm/ConstantOptimiser.cpp @@ -137,29 +137,55 @@ Representation const& RepresentationFinder::findRepresentation(u256 const& _valu Representation routine = represent(_value); - // check for masks first - // high ones low zeros - // |----------||--------------| + // A constant having a single contiguous run of ones, common in masking, + // can be efficiently created by first filling with 1's, then shifting + // left and/or right as needed to make the sides full of zeros. + // + // onesEnd onesStart + // v v // 0x000000000000000000000000000000000000ffffffffffff0000000000000000 - unsigned lowZeros = 0; - unsigned highOnes = 0; - while (((_value >> lowZeros) & 1) == 0 && lowZeros < 256) - ++lowZeros; - while (((_value >> (lowZeros + highOnes)) & 1) == 1 && highOnes < 256) - ++highOnes; - if ( + // + // If the value is all zeros, both onesEnd and onesStart will be 256. + + // Find the index of the lowest one 1 bit + unsigned onesStart; + for (onesStart = 0; onesStart < 256; ++onesStart) + if (((_value >> onesStart) & 1) != 0) + break; + + // Find the index after the highest one 1 bit in the run of 1's. + unsigned onesEnd; + for (onesEnd = onesStart; onesEnd < 256; ++onesEnd) + if (((_value >> onesEnd) & 1) == 0) + break; + + // Check that there are no ones after onesEnd + bool const isOnlyContiguousOnes = (onesEnd == 256 || (_value >> onesEnd) == 0); + + bool const worthTrying = + _value != 0 && // defensive check m_dialect.evmVersion().hasBitwiseShifting() && - highOnes > 32 && // push would be more efficient otherwise - ((_value >> (lowZeros + highOnes)) == 0) && // this is a pure mask - ((lowZeros + highOnes < 256) || lowZeros > 16) // otherwise negation is more effective - ) + onesEnd - onesStart > 32 && // push would be more efficient otherwise + (onesEnd < 256 || onesStart > 16); // negation more effective for 0xFF..FFFF00 + + if (isOnlyContiguousOnes && worthTrying) { - // this is a big enough mask to use zero negation + // Build up the code, starting with a negated 0 to produce all ones. + // 0x00 ! == + // 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff Representation newRoutine = represent(*auxHandles.not_, represent(0)); - if ((highOnes + lowZeros) != 256) - newRoutine = represent(*auxHandles.shr, represent(256 - highOnes), newRoutine); - if (lowZeros > 0) - newRoutine = represent(*auxHandles.shl, represent(lowZeros), newRoutine); + + // Shift right as needed to create the correct number of 1 bits. + // 0x0000000000000000000000000000000000000000000000000000ffffffffffff + // If left aligned, we only need a left shift, and skip the right shift. + if (onesEnd != 256) + newRoutine = represent(*auxHandles.shr, represent(256 - (onesEnd - onesStart)), newRoutine); + + // If needed, shift left to position the bits in the correct place + // or to setup a left aligned mask + // 0x000000000000000000000000000000000000ffffffffffff0000000000000000 + if (onesStart > 0) + newRoutine = represent(*auxHandles.shl, represent(onesStart), newRoutine); routine = min(std::move(routine), std::move(newRoutine)); } From 6f2918c27203c489f3a7f9d3231160c7369eda4a Mon Sep 17 00:00:00 2001 From: "Daniel Von Fange (K)" Date: Sun, 17 May 2026 11:52:33 +0000 Subject: [PATCH 7/7] Update gas pricing in tests --- .../abi_decode_from_storage_struct_v2.sol | 4 +- .../abicoder/abi_decode_simple_storage.sol | 4 +- .../abicoder/abi_encode_storage_array_v2.sol | 4 +- ...ode_v2_in_modifier_used_in_v1_contract.sol | 2 +- .../calldata_array_dynamic_of_uint_v2.sol | 4 +- ...calldata_overlapping_dynamic_arrays_v2.sol | 4 +- .../copy_from_calldata_removes_bytes_data.sol | 2 +- ...rray_storage_push_empty_length_address.sol | 4 +- .../arrays_complex_from_and_to_storage.sol | 4 +- .../array/constant_var_as_array_length.sol | 4 +- .../copying/array_copy_cleanup_uint128.sol | 4 +- .../copying/array_copy_cleanup_uint40.sol | 4 +- .../array_copy_clear_storage_packed.sol | 8 +-- .../copying/array_copy_different_packing.sol | 4 +- ...ay_copy_storage_storage_different_base.sol | 4 +- ..._storage_storage_different_base_nested.sol | 4 +- .../array_copy_storage_storage_dyn_dyn.sol | 4 +- ...ray_copy_storage_storage_static_simple.sol | 2 +- .../array_copy_storage_storage_struct.sol | 4 +- .../copying/array_copy_target_leftover.sol | 4 +- .../copying/array_copy_target_leftover2.sol | 4 +- .../copying/array_copy_target_simple.sol | 4 +- .../copying/array_copy_target_simple_2.sol | 4 +- .../copying/array_elements_to_mapping.sol | 4 +- ...on_external_storage_to_storage_dynamic.sol | 4 +- ...o_storage_dynamic_different_mutability.sol | 4 +- .../array_of_struct_calldata_to_storage.sol | 2 +- ..._containing_arrays_calldata_to_storage.sol | 2 +- .../array/copying/array_to_mapping.sol | 2 +- .../copying/arrays_from_and_to_storage.sol | 4 +- .../copying/bytes_storage_to_storage.sol | 24 +++---- .../calldata_array_dynamic_to_storage.sol | 2 +- .../copy_byte_array_in_struct_to_storage.sol | 6 +- .../copy_function_internal_storage_array.sol | 4 +- .../copying/copying_bytes_multiassign.sol | 6 +- ...d_array_of_structs_calldata_to_storage.sol | 6 +- ...ted_array_of_structs_memory_to_storage.sol | 6 +- .../function_type_array_to_storage.sol | 8 +-- .../memory_dyn_2d_bytes_to_storage.sol | 4 +- .../nested_array_calldata_to_storage.sol | 6 +- ...ay_dynamic_dynamic_calldata_to_storage.sol | 2 +- ...d_array_of_structs_calldata_to_storage.sol | 6 +- ...ted_array_of_structs_memory_to_storage.sol | 6 +- ...amic_array_element_calldata_to_storage.sol | 4 +- .../array/delete/bytes_delete_element.sol | 2 +- .../delete/delete_storage_array_packed.sol | 4 +- ...nvalid_encoding_for_storage_byte_array.sol | 2 +- .../long_byte_array_cleanup_after_delete.sol | 2 +- ...rray_cleanup_after_overwrite_with_long.sol | 2 +- .../push/array_push_nested_from_calldata.sol | 4 +- .../array/push/array_push_packed_array.sol | 4 +- .../array/push/array_push_struct.sol | 4 +- .../array/push/nested_bytes_push.sol | 4 +- .../cleanup/byte_array_to_storage_cleanup.sol | 10 +-- .../constructor/arrays_in_constructors.sol | 8 +-- .../bytes_in_constructors_packer.sol | 8 +-- .../bytes_in_constructors_unpacker.sol | 4 +- .../constructor_static_array_argument.sol | 4 +- .../externalContracts/FixedFeeRegistrar.sol | 16 ++--- .../externalContracts/base64.sol | 22 +++---- .../externalContracts/deposit_contract.sol | 36 +++++----- .../externalContracts/prbmath_signed.sol | 32 ++++----- .../externalContracts/ramanujan_pi.sol | 16 ++--- .../semanticTests/externalContracts/snark.sol | 12 ++-- .../externalContracts/strings.sol | 34 +++++----- .../functionCall/send_zero_ether.sol | 8 +-- .../functionTypes/store_function.sol | 2 +- .../address_overload_resolution.sol | 4 +- ...d_function_calldata_calldata_interface.sol | 2 +- ...ted_function_calldata_memory_interface.sol | 4 +- .../operator_making_pure_external_call.sol | 8 +-- .../operator_making_view_external_call.sol | 8 +-- ...rray_partial_assignment_same_base_type.sol | 2 +- .../storage/empty_nonempty_empty.sol | 6 +- .../storage/static_array_copy_cleanup.sol | 8 +-- ...ray_and_partial_assignment_with_layout.sol | 2 +- ...rage_boundary_array_partial_assignment.sol | 2 +- .../storage_boundary_delete_overflow_bug.sol | 28 ++++---- .../storage/storage_boundary_packed_array.sol | 8 +-- ...rage_boundary_struct_array_mixed_types.sol | 66 +++++++++---------- ...torage_boundary_struct_array_multislot.sol | 4 +- .../storage_boundary_struct_array_packed.sol | 12 ++-- .../structs/copy_from_mapping.sol | 2 +- .../copy_substructures_from_mapping.sol | 2 +- .../structs/copy_substructures_to_mapping.sol | 12 ++-- .../semanticTests/structs/copy_to_mapping.sol | 16 ++--- ...truct_containing_bytes_copy_and_delete.sol | 8 +-- .../struct_delete_storage_nested_small.sol | 2 +- .../struct_delete_storage_with_array.sol | 6 +- ...truct_delete_storage_with_arrays_small.sol | 2 +- .../mapping/copy_from_mapping_to_mapping.sol | 2 +- .../userDefinedValueType/calldata.sol | 8 +-- .../calldata_to_storage.sol | 12 ++-- .../userDefinedValueType/erc20.sol | 20 +++--- .../memory_to_storage.sol | 12 ++-- .../semanticTests/various/address_code.sol | 4 +- .../semanticTests/various/create_calldata.sol | 4 +- .../various/destructuring_assignment.sol | 4 +- .../semanticTests/various/erc20.sol | 20 +++--- .../skip_dynamic_types_for_structs.sol | 4 +- 100 files changed, 373 insertions(+), 373 deletions(-) diff --git a/test/libsolidity/semanticTests/abicoder/abi_decode_from_storage_struct_v2.sol b/test/libsolidity/semanticTests/abicoder/abi_decode_from_storage_struct_v2.sol index e5aa910ce1be..07a870bacbc9 100644 --- a/test/libsolidity/semanticTests/abicoder/abi_decode_from_storage_struct_v2.sol +++ b/test/libsolidity/semanticTests/abicoder/abi_decode_from_storage_struct_v2.sol @@ -21,6 +21,6 @@ contract C { } // ---- // f() -> 0x20, 0x8, 0x40, 0x3, 0x9, 0xa, 0xb -// gas irOptimized: 203109 +// gas irOptimized: 203197 // gas legacy: 206263 -// gas legacyOptimized: 203177 +// gas legacyOptimized: 203225 diff --git a/test/libsolidity/semanticTests/abicoder/abi_decode_simple_storage.sol b/test/libsolidity/semanticTests/abicoder/abi_decode_simple_storage.sol index 6c4fd52b36ed..50ac459b1629 100644 --- a/test/libsolidity/semanticTests/abicoder/abi_decode_simple_storage.sol +++ b/test/libsolidity/semanticTests/abicoder/abi_decode_simple_storage.sol @@ -8,6 +8,6 @@ contract C { } // ---- // f(bytes): 0x20, 0x80, 0x21, 0x40, 0x7, "abcdefg" -> 0x21, 0x40, 0x7, "abcdefg" -// gas irOptimized: 135441 +// gas irOptimized: 135505 // gas legacy: 137095 -// gas legacyOptimized: 135828 +// gas legacyOptimized: 135884 diff --git a/test/libsolidity/semanticTests/abicoder/abi_encode_storage_array_v2.sol b/test/libsolidity/semanticTests/abicoder/abi_encode_storage_array_v2.sol index 31f759d3bfd4..3670740fbc89 100644 --- a/test/libsolidity/semanticTests/abicoder/abi_encode_storage_array_v2.sol +++ b/test/libsolidity/semanticTests/abicoder/abi_encode_storage_array_v2.sol @@ -18,10 +18,10 @@ contract C { // EVMVersion: >homestead // ---- // h(uint256[2][]): 0x20, 3, 123, 124, 223, 224, 323, 324 -> 32, 256, 0x20, 3, 123, 124, 223, 224, 323, 324 -// gas irOptimized: 180022 +// gas irOptimized: 180046 // gas legacy: 186541 // gas legacyOptimized: 180429 // i(uint256[2][2]): 123, 124, 223, 224 -> 32, 128, 123, 124, 223, 224 -// gas irOptimized: 112031 +// gas irOptimized: 112039 // gas legacy: 116683 // gas legacyOptimized: 112303 diff --git a/test/libsolidity/semanticTests/abicoder/abi_encode_v2_in_modifier_used_in_v1_contract.sol b/test/libsolidity/semanticTests/abicoder/abi_encode_v2_in_modifier_used_in_v1_contract.sol index 78da59648a9d..a02a388562a6 100644 --- a/test/libsolidity/semanticTests/abicoder/abi_encode_v2_in_modifier_used_in_v1_contract.sol +++ b/test/libsolidity/semanticTests/abicoder/abi_encode_v2_in_modifier_used_in_v1_contract.sol @@ -38,7 +38,7 @@ contract C is B { } // ---- // test() -> 5, 10 -// gas irOptimized: 65040 +// gas irOptimized: 65076 // gas irOptimized code: 26200 // gas legacy: 66250 // gas legacy code: 36400 diff --git a/test/libsolidity/semanticTests/abicoder/calldataDecoding/array/calldata_array_dynamic_of_uint_v2.sol b/test/libsolidity/semanticTests/abicoder/calldataDecoding/array/calldata_array_dynamic_of_uint_v2.sol index 739c4c84076b..d29e9cb86173 100644 --- a/test/libsolidity/semanticTests/abicoder/calldataDecoding/array/calldata_array_dynamic_of_uint_v2.sol +++ b/test/libsolidity/semanticTests/abicoder/calldataDecoding/array/calldata_array_dynamic_of_uint_v2.sol @@ -20,6 +20,6 @@ contract C { // f(uint256[][1]): 32, 32, 0 -> true // f(uint256[][1]): 32, 32, 1, 42 -> true // f(uint256[][1]): 32, 32, 8, 421, 422, 423, 424, 425, 426, 427, 428 -> true -// gas irOptimized: 120978 +// gas irOptimized: 115310 // gas legacy: 98324 -// gas legacyOptimized: 94348 +// gas legacyOptimized: 90236 diff --git a/test/libsolidity/semanticTests/abicoder/calldataDecoding/array/calldata_overlapping_dynamic_arrays_v2.sol b/test/libsolidity/semanticTests/abicoder/calldataDecoding/array/calldata_overlapping_dynamic_arrays_v2.sol index 302aeb5de4d5..cc9f62b2580c 100644 --- a/test/libsolidity/semanticTests/abicoder/calldataDecoding/array/calldata_overlapping_dynamic_arrays_v2.sol +++ b/test/libsolidity/semanticTests/abicoder/calldataDecoding/array/calldata_overlapping_dynamic_arrays_v2.sol @@ -33,8 +33,8 @@ contract C { // f_which(uint256[],uint256[2],uint256): 0x40, 1, 2, 1, 5, 6 -> 0x20, 0x40, 5, 2 // f_which(uint256[],uint256[2],uint256): 0x40, 1, 2, 1 -> FAILURE // f_storage(uint256[],uint256[2]): 0x20, 1, 2 -> 0x20, 0x60, 0x20, 1, 2 -// gas irOptimized: 111356 +// gas irOptimized: 111388 // gas legacy: 113826 -// gas legacyOptimized: 111724 +// gas legacyOptimized: 111748 // f_storage(uint256[],uint256[2]): 0x40, 1, 2, 5, 6 -> 0x20, 0x80, 0x20, 2, 5, 6 // f_storage(uint256[],uint256[2]): 0x40, 1, 2, 5 -> FAILURE diff --git a/test/libsolidity/semanticTests/abicoder/calldataDecoding/copy_from_calldata_removes_bytes_data.sol b/test/libsolidity/semanticTests/abicoder/calldataDecoding/copy_from_calldata_removes_bytes_data.sol index 1f087dc8cf92..25c8d44cbfcf 100644 --- a/test/libsolidity/semanticTests/abicoder/calldataDecoding/copy_from_calldata_removes_bytes_data.sol +++ b/test/libsolidity/semanticTests/abicoder/calldataDecoding/copy_from_calldata_removes_bytes_data.sol @@ -14,5 +14,5 @@ contract c { // gas legacyOptimized: 155296 // checkIfDataIsEmpty() -> false // sendMessage() -> true, 0x40, 0 -// gas irOptimized: 41925 +// gas irOptimized: 41932 // checkIfDataIsEmpty() -> true diff --git a/test/libsolidity/semanticTests/array/array_storage_push_empty_length_address.sol b/test/libsolidity/semanticTests/array/array_storage_push_empty_length_address.sol index bf06393a63ff..234d6509e1d7 100644 --- a/test/libsolidity/semanticTests/array/array_storage_push_empty_length_address.sol +++ b/test/libsolidity/semanticTests/array/array_storage_push_empty_length_address.sol @@ -17,9 +17,9 @@ contract C { // set_get_length(uint256): 10 -> 10 // set_get_length(uint256): 20 -> 20 // set_get_length(uint256): 0 -> 0 -// gas irOptimized: 76123 +// gas irOptimized: 76043 // gas legacy: 75618 -// gas legacyOptimized: 75076 +// gas legacyOptimized: 74936 // set_get_length(uint256): 0xFF -> 0xFF // gas irOptimized: 168565 // gas legacy: 696850 diff --git a/test/libsolidity/semanticTests/array/arrays_complex_from_and_to_storage.sol b/test/libsolidity/semanticTests/array/arrays_complex_from_and_to_storage.sol index ac3cd8495f73..468d44295bc1 100644 --- a/test/libsolidity/semanticTests/array/arrays_complex_from_and_to_storage.sol +++ b/test/libsolidity/semanticTests/array/arrays_complex_from_and_to_storage.sol @@ -12,9 +12,9 @@ contract Test { } // ---- // set(uint24[3][]): 0x20, 0x06, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12 -> 0x06 -// gas irOptimized: 185221 +// gas irOptimized: 185293 // gas legacy: 199970 -// gas legacyOptimized: 186342 +// gas legacyOptimized: 186414 // data(uint256,uint256): 0x02, 0x02 -> 0x09 // data(uint256,uint256): 0x05, 0x01 -> 0x11 // data(uint256,uint256): 0x06, 0x00 -> FAILURE diff --git a/test/libsolidity/semanticTests/array/constant_var_as_array_length.sol b/test/libsolidity/semanticTests/array/constant_var_as_array_length.sol index 833c9dec3e42..452d6dda9505 100644 --- a/test/libsolidity/semanticTests/array/constant_var_as_array_length.sol +++ b/test/libsolidity/semanticTests/array/constant_var_as_array_length.sol @@ -8,11 +8,11 @@ contract C { } // ---- // constructor(): 1, 2, 3 -> -// gas irOptimized: 124991 +// gas irOptimized: 124887 // gas irOptimized code: 14800 // gas legacy: 142553 // gas legacy code: 46200 -// gas legacyOptimized: 126306 +// gas legacyOptimized: 126254 // gas legacyOptimized code: 23400 // a(uint256): 0 -> 1 // a(uint256): 1 -> 2 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_cleanup_uint128.sol b/test/libsolidity/semanticTests/array/copying/array_copy_cleanup_uint128.sol index ba05d8fb670d..f1d78444f519 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_cleanup_uint128.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_cleanup_uint128.sol @@ -21,6 +21,6 @@ contract C { } // ---- // f() -> true -// gas irOptimized: 73981 +// gas irOptimized: 73944 // gas legacy: 75550 -// gas legacyOptimized: 73812 +// gas legacyOptimized: 73786 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_cleanup_uint40.sol b/test/libsolidity/semanticTests/array/copying/array_copy_cleanup_uint40.sol index e4e7bf62f3a0..675edc64a51b 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_cleanup_uint40.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_cleanup_uint40.sol @@ -46,6 +46,6 @@ contract C { } // ---- // f() -> true -// gas irOptimized: 122596 +// gas irOptimized: 122865 // gas legacy: 125651 -// gas legacyOptimized: 121668 +// gas legacyOptimized: 121944 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_clear_storage_packed.sol b/test/libsolidity/semanticTests/array/copying/array_copy_clear_storage_packed.sol index 12d9bf1fd3c0..226df7994bf2 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_clear_storage_packed.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_clear_storage_packed.sol @@ -40,11 +40,11 @@ contract C { } // ---- // f() -> 0 -// gas irOptimized: 74044 +// gas irOptimized: 74020 // gas legacy: 75528 -// gas legacyOptimized: 73861 +// gas legacyOptimized: 73829 // g() -> 0 // h() -> 0 -// gas irOptimized: 74114 +// gas irOptimized: 74086 // gas legacy: 75553 -// gas legacyOptimized: 73904 +// gas legacyOptimized: 73872 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_different_packing.sol b/test/libsolidity/semanticTests/array/copying/array_copy_different_packing.sol index 1bbb541911a0..b59341cc742f 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_different_packing.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_different_packing.sol @@ -18,6 +18,6 @@ contract c { } // ---- // test() -> 0x01000000000000000000000000000000000000000000000000, 0x02000000000000000000000000000000000000000000000000, 0x03000000000000000000000000000000000000000000000000, 0x04000000000000000000000000000000000000000000000000, 0x05000000000000000000000000000000000000000000000000 -// gas irOptimized: 208415 +// gas irOptimized: 208645 // gas legacy: 220059 -// gas legacyOptimized: 211458 +// gas legacyOptimized: 211620 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_different_base.sol b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_different_base.sol index af31d4b8e495..75a3f5bbd5ae 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_different_base.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_different_base.sol @@ -17,6 +17,6 @@ contract c { } // ---- // test() -> 5, 4 -// gas irOptimized: 205667 +// gas irOptimized: 205763 // gas legacy: 207971 -// gas legacyOptimized: 204828 +// gas legacyOptimized: 204892 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_different_base_nested.sol b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_different_base_nested.sol index 6b1dd7ff02c0..f134a7527e24 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_different_base_nested.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_different_base_nested.sol @@ -21,6 +21,6 @@ contract c { } // ---- // test() -> 3, 4 -// gas irOptimized: 169553 +// gas irOptimized: 169426 // gas legacy: 182361 -// gas legacyOptimized: 169554 +// gas legacyOptimized: 169495 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_dyn_dyn.sol b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_dyn_dyn.sol index 98e2f5adb45e..4c050d75b8d5 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_dyn_dyn.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_dyn_dyn.sol @@ -15,9 +15,9 @@ contract c { // ---- // setData1(uint256,uint256,uint256): 10, 5, 4 -> // copyStorageStorage() -> -// gas irOptimized: 111321 +// gas irOptimized: 111329 // gas legacy: 112434 -// gas legacyOptimized: 111494 +// gas legacyOptimized: 111502 // getData2(uint256): 5 -> 10, 4 // setData1(uint256,uint256,uint256): 0, 0, 0 -> // copyStorageStorage() -> diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_static_simple.sol b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_static_simple.sol index 29e62dd3ce8f..a969a02a2f62 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_static_simple.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_static_simple.sol @@ -12,4 +12,4 @@ contract C { // ---- // test() -> left(0x01), left(0x02) // gas legacy: 69235 -// gas legacyOptimized: 66974 +// gas legacyOptimized: 66965 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_struct.sol b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_struct.sol index f1cd76a3adc5..f96abf439ef3 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_struct.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_storage_storage_struct.sol @@ -17,7 +17,7 @@ contract c { } // ---- // test() -> 4, 5 -// gas irOptimized: 190676 +// gas irOptimized: 190670 // gas legacy: 210706 -// gas legacyOptimized: 190472 +// gas legacyOptimized: 190465 // storageEmpty -> 1 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_target_leftover.sol b/test/libsolidity/semanticTests/array/copying/array_copy_target_leftover.sol index 2deb372fa381..a6f57db31193 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_target_leftover.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_target_leftover.sol @@ -17,6 +17,6 @@ contract c { } // ---- // test() -> 0xffffffff, 0x0000000000000000000000000a00090008000700060005000400030002000100, 0x0000000000000000000000000000000000000000000000000000000000000000 -// gas irOptimized: 100506 +// gas irOptimized: 100502 // gas legacy: 146700 -// gas legacyOptimized: 122680 +// gas legacyOptimized: 122388 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_target_leftover2.sol b/test/libsolidity/semanticTests/array/copying/array_copy_target_leftover2.sol index 706130082fff..8067d4ae6897 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_target_leftover2.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_target_leftover2.sol @@ -19,6 +19,6 @@ contract c { } // ---- // test() -> 0x04000000000000000000000000000000000000000000000000, 0x0, 0x0 -// gas irOptimized: 91320 +// gas irOptimized: 91401 // gas legacy: 97777 -// gas legacyOptimized: 91993 +// gas legacyOptimized: 92074 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_target_simple.sol b/test/libsolidity/semanticTests/array/copying/array_copy_target_simple.sol index 054d61c6772b..16cd5707d9d1 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_target_simple.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_target_simple.sol @@ -18,6 +18,6 @@ contract c { } // ---- // test() -> 0x01000000000000000000000000000000000000000000000000, 0x02000000000000000000000000000000000000000000000000, 0x03000000000000000000000000000000000000000000000000, 0x04000000000000000000000000000000000000000000000000, 0x0 -// gas irOptimized: 273548 +// gas irOptimized: 273482 // gas legacy: 280148 -// gas legacyOptimized: 274502 +// gas legacyOptimized: 274512 diff --git a/test/libsolidity/semanticTests/array/copying/array_copy_target_simple_2.sol b/test/libsolidity/semanticTests/array/copying/array_copy_target_simple_2.sol index 7ceadf481c66..7e67d2a183a0 100644 --- a/test/libsolidity/semanticTests/array/copying/array_copy_target_simple_2.sol +++ b/test/libsolidity/semanticTests/array/copying/array_copy_target_simple_2.sol @@ -18,6 +18,6 @@ contract c { } // ---- // test() -> 0x01000000000000000000000000000000000000000000000000, 0x02000000000000000000000000000000000000000000000000, 0x03000000000000000000000000000000000000000000000000, 0x04000000000000000000000000000000000000000000000000, 0x00 -// gas irOptimized: 233012 +// gas irOptimized: 233068 // gas legacy: 239400 -// gas legacyOptimized: 233948 +// gas legacyOptimized: 233871 diff --git a/test/libsolidity/semanticTests/array/copying/array_elements_to_mapping.sol b/test/libsolidity/semanticTests/array/copying/array_elements_to_mapping.sol index a1849bd65fce..1fad6f85e41e 100644 --- a/test/libsolidity/semanticTests/array/copying/array_elements_to_mapping.sol +++ b/test/libsolidity/semanticTests/array/copying/array_elements_to_mapping.sol @@ -52,9 +52,9 @@ contract C { } // ---- // from_storage() -> 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14 -// gas irOptimized: 149856 +// gas irOptimized: 149928 // gas legacy: 156721 -// gas legacyOptimized: 149000 +// gas legacyOptimized: 149032 // from_storage_ptr() -> 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14 // from_memory() -> 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14 // from_calldata(uint8[][]): 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14 -> 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14 diff --git a/test/libsolidity/semanticTests/array/copying/array_of_function_external_storage_to_storage_dynamic.sol b/test/libsolidity/semanticTests/array/copying/array_of_function_external_storage_to_storage_dynamic.sol index e3b9cdaadcb9..cb75edb20944 100644 --- a/test/libsolidity/semanticTests/array/copying/array_of_function_external_storage_to_storage_dynamic.sol +++ b/test/libsolidity/semanticTests/array/copying/array_of_function_external_storage_to_storage_dynamic.sol @@ -45,7 +45,7 @@ contract C { } // ---- // copyExternalStorageArrayOfFunctionType() -> true -// gas irOptimized: 104629 +// gas irOptimized: 104717 // gas legacy: 111170 -// gas legacyOptimized: 104620 +// gas legacyOptimized: 104664 // copyInternalArrayOfFunctionType() -> true diff --git a/test/libsolidity/semanticTests/array/copying/array_of_function_external_storage_to_storage_dynamic_different_mutability.sol b/test/libsolidity/semanticTests/array/copying/array_of_function_external_storage_to_storage_dynamic_different_mutability.sol index 92b61b9291cd..458acf1e68ca 100644 --- a/test/libsolidity/semanticTests/array/copying/array_of_function_external_storage_to_storage_dynamic_different_mutability.sol +++ b/test/libsolidity/semanticTests/array/copying/array_of_function_external_storage_to_storage_dynamic_different_mutability.sol @@ -48,8 +48,8 @@ contract C { } // ---- // copyExternalStorageArraysOfFunctionType() -> true -// gas irOptimized: 104238 +// gas irOptimized: 104326 // gas legacy: 110911 -// gas legacyOptimized: 104377 +// gas legacyOptimized: 104421 // copyInternalArrayOfFunctionType() -> true // gas legacy: 38695 diff --git a/test/libsolidity/semanticTests/array/copying/array_of_struct_calldata_to_storage.sol b/test/libsolidity/semanticTests/array/copying/array_of_struct_calldata_to_storage.sol index e4b3d14fd76b..32169bd40593 100644 --- a/test/libsolidity/semanticTests/array/copying/array_of_struct_calldata_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/array_of_struct_calldata_to_storage.sol @@ -17,4 +17,4 @@ contract C { // compileViaYul: true // ---- // f((uint128,uint64,uint128)[]): 0x20, 3, 0, 0, 12, 0, 11, 0, 10, 0, 0 -> 10, 11, 12 -// gas irOptimized: 120751 +// gas irOptimized: 120703 diff --git a/test/libsolidity/semanticTests/array/copying/array_of_structs_containing_arrays_calldata_to_storage.sol b/test/libsolidity/semanticTests/array/copying/array_of_structs_containing_arrays_calldata_to_storage.sol index acc968389229..5c21a09ba8d1 100644 --- a/test/libsolidity/semanticTests/array/copying/array_of_structs_containing_arrays_calldata_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/array_of_structs_containing_arrays_calldata_to_storage.sol @@ -23,4 +23,4 @@ contract C { // compileViaYul: true // ---- // f((uint256[])[]): 0x20, 3, 0x60, 0x60, 0x60, 0x20, 3, 1, 2, 3 -> 3, 1 -// gas irOptimized: 327461 +// gas irOptimized: 327621 diff --git a/test/libsolidity/semanticTests/array/copying/array_to_mapping.sol b/test/libsolidity/semanticTests/array/copying/array_to_mapping.sol index 667685c9c83f..088e860e7caa 100644 --- a/test/libsolidity/semanticTests/array/copying/array_to_mapping.sol +++ b/test/libsolidity/semanticTests/array/copying/array_to_mapping.sol @@ -37,7 +37,7 @@ contract C { } // ---- // from_storage() -> 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14 -// gas irOptimized: 147749 +// gas irOptimized: 147797 // gas legacy: 154218 // gas legacyOptimized: 147020 // from_storage_ptr() -> 0x20, 2, 0x40, 0xa0, 2, 10, 11, 3, 12, 13, 14 diff --git a/test/libsolidity/semanticTests/array/copying/arrays_from_and_to_storage.sol b/test/libsolidity/semanticTests/array/copying/arrays_from_and_to_storage.sol index fea2c895d81c..af799ef5a31e 100644 --- a/test/libsolidity/semanticTests/array/copying/arrays_from_and_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/arrays_from_and_to_storage.sol @@ -10,9 +10,9 @@ contract Test { } // ---- // set(uint24[]): 0x20, 18, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 -> 18 -// gas irOptimized: 95505 +// gas irOptimized: 95537 // gas legacy: 104176 -// gas legacyOptimized: 96785 +// gas legacyOptimized: 96817 // data(uint256): 7 -> 8 // data(uint256): 15 -> 16 // data(uint256): 18 -> FAILURE diff --git a/test/libsolidity/semanticTests/array/copying/bytes_storage_to_storage.sol b/test/libsolidity/semanticTests/array/copying/bytes_storage_to_storage.sol index 37769cb4966c..dd9fd4b78dfc 100644 --- a/test/libsolidity/semanticTests/array/copying/bytes_storage_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/bytes_storage_to_storage.sol @@ -17,26 +17,26 @@ contract c { // ---- // f(uint256): 0 -> 0x20, 0x00 // f(uint256): 31 -> 0x20, 0x1f, 0x0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e00 -// gas irOptimized: 103268 +// gas irOptimized: 103037 // gas legacy: 112904 -// gas legacyOptimized: 112645 +// gas legacyOptimized: 111739 // f(uint256): 32 -> 0x20, 0x20, 1780731860627700044960722568376592200742329637303199754547598369979440671 -// gas irOptimized: 117825 +// gas irOptimized: 117585 // gas legacy: 128964 -// gas legacyOptimized: 128859 +// gas legacyOptimized: 127923 // f(uint256): 33 -> 0x20, 33, 1780731860627700044960722568376592200742329637303199754547598369979440671, 0x2000000000000000000000000000000000000000000000000000000000000000 -// gas irOptimized: 123888 +// gas irOptimized: 123639 // gas legacy: 135510 -// gas legacyOptimized: 135218 +// gas legacyOptimized: 134252 // f(uint256): 63 -> 0x20, 0x3f, 1780731860627700044960722568376592200742329637303199754547598369979440671, 14532552714582660066924456880521368950258152170031413196862950297402215316992 -// gas irOptimized: 126948 +// gas irOptimized: 126429 // gas legacy: 148110 -// gas legacyOptimized: 148448 +// gas legacyOptimized: 146582 // f(uint256): 12 -> 0x20, 0x0c, 0x0102030405060708090a0b0000000000000000000000000000000000000000 -// gas irOptimized: 54204 +// gas irOptimized: 54156 // gas legacy: 59832 -// gas legacyOptimized: 57268 +// gas legacyOptimized: 56999 // f(uint256): 129 -> 0x20, 0x81, 1780731860627700044960722568376592200742329637303199754547598369979440671, 0x202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f, 29063324697304692433803953038474361308315562010425523193971352996434451193439, 0x606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f, -57896044618658097711785492504343953926634992332820282019728792003956564819968 -// gas irOptimized: 416918 +// gas irOptimized: 415805 // gas legacy: 458997 -// gas legacyOptimized: 460669 +// gas legacyOptimized: 456823 diff --git a/test/libsolidity/semanticTests/array/copying/calldata_array_dynamic_to_storage.sol b/test/libsolidity/semanticTests/array/copying/calldata_array_dynamic_to_storage.sol index 400834772869..b0a7bbc80b88 100644 --- a/test/libsolidity/semanticTests/array/copying/calldata_array_dynamic_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/calldata_array_dynamic_to_storage.sol @@ -11,4 +11,4 @@ contract C { // f(uint256[]): 0x20, 0x03, 0x1, 0x2, 0x3 -> 0x1 // gas irOptimized: 110973 // gas legacy: 112436 -// gas legacyOptimized: 111313 +// gas legacyOptimized: 111337 diff --git a/test/libsolidity/semanticTests/array/copying/copy_byte_array_in_struct_to_storage.sol b/test/libsolidity/semanticTests/array/copying/copy_byte_array_in_struct_to_storage.sol index 9a68f88d8971..02c825583d82 100644 --- a/test/libsolidity/semanticTests/array/copying/copy_byte_array_in_struct_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/copy_byte_array_in_struct_to_storage.sol @@ -35,13 +35,13 @@ contract C { } // ---- // f() -> 0x40, 0x80, 6, 0x6162636465660000000000000000000000000000000000000000000000000000, 0x49, 0x3132333435363738393031323334353637383930313233343536373839303120, 0x3132333435363738393031323334353637383930313233343536373839303120, 0x3132333435363738390000000000000000000000000000000000000000000000 -// gas irOptimized: 179405 +// gas irOptimized: 179461 // gas legacy: 180675 // gas legacyOptimized: 179690 // g() -> 0x40, 0xc0, 0x49, 0x3132333435363738393031323334353637383930313233343536373839303120, 0x3132333435363738393031323334353637383930313233343536373839303120, 0x3132333435363738390000000000000000000000000000000000000000000000, 0x11, 0x3132333435363738393233343536373839000000000000000000000000000000 -// gas irOptimized: 106381 +// gas irOptimized: 106437 // gas legacy: 109472 // gas legacyOptimized: 106648 // h() -> 0x40, 0x60, 0x00, 0x00 -// gas irOptimized: 46948 +// gas irOptimized: 46980 // storageEmpty -> 1 diff --git a/test/libsolidity/semanticTests/array/copying/copy_function_internal_storage_array.sol b/test/libsolidity/semanticTests/array/copying/copy_function_internal_storage_array.sol index 5fc981340942..84b147f80b7a 100644 --- a/test/libsolidity/semanticTests/array/copying/copy_function_internal_storage_array.sol +++ b/test/libsolidity/semanticTests/array/copying/copy_function_internal_storage_array.sol @@ -15,6 +15,6 @@ contract C { } // ---- // test() -> 7 -// gas irOptimized: 122575 +// gas irOptimized: 122701 // gas legacy: 208558 -// gas legacyOptimized: 202409 +// gas legacyOptimized: 202529 diff --git a/test/libsolidity/semanticTests/array/copying/copying_bytes_multiassign.sol b/test/libsolidity/semanticTests/array/copying/copying_bytes_multiassign.sol index d29feccf421c..4ef43d9f2240 100644 --- a/test/libsolidity/semanticTests/array/copying/copying_bytes_multiassign.sol +++ b/test/libsolidity/semanticTests/array/copying/copying_bytes_multiassign.sol @@ -18,15 +18,15 @@ contract sender { } // ---- // (): 7 -> -// gas irOptimized: 110735 +// gas irOptimized: 110751 // gas legacy: 111388 // gas legacyOptimized: 111066 // val() -> 0 // forward(bool): true -> true -// gas irOptimized: 49573 +// gas irOptimized: 49569 // val() -> 0x80 // forward(bool): false -> true -// gas irOptimized: 31410 +// gas irOptimized: 31407 // val() -> 0x80 // forward(bool): true -> true // val() -> 0x80 diff --git a/test/libsolidity/semanticTests/array/copying/elements_of_nested_array_of_structs_calldata_to_storage.sol b/test/libsolidity/semanticTests/array/copying/elements_of_nested_array_of_structs_calldata_to_storage.sol index 5c64ba63f8f8..1bdc9870c169 100644 --- a/test/libsolidity/semanticTests/array/copying/elements_of_nested_array_of_structs_calldata_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/elements_of_nested_array_of_structs_calldata_to_storage.sol @@ -31,8 +31,8 @@ contract C { // compileViaYul: true // ---- // test1((uint8[],uint8[2])[][][]): 0x20, 1, 0x20, 2, 0x40, 0x0140, 1, 0x20, 0x60, 3, 7, 2, 1, 2, 2, 0x40, 0x0100, 0x60, 17, 19, 2, 11, 13, 0x60, 31, 37, 2, 23, 29 -> 0x20, 2, 0x40, 0x0140, 1, 0x20, 0x60, 3, 7, 2, 1, 2, 2, 0x40, 0x0100, 0x60, 17, 19, 2, 11, 13, 0x60, 31, 37, 2, 23, 29 -// gas irOptimized: 327936 +// gas irOptimized: 328144 // test2((uint8[],uint8[2])[][1][]): 0x20, 2, 0x40, 0x0160, 0x20, 1, 0x20, 0x60, 17, 19, 2, 11, 13, 0x20, 1, 0x20, 0x60, 31, 37, 2, 23, 29 -> 0x20, 0x20, 1, 0x20, 0x60, 17, 19, 2, 11, 13 -// gas irOptimized: 141168 +// gas irOptimized: 141264 // test3((uint8[],uint8[2])[1][][2]): 0x20, 0x40, 0x60, 0, 2, 0x40, 288, 0x20, 0x60, 3, 7, 2, 1, 2, 0x20, 0x60, 17, 19, 2, 11, 13 -> 0x20, 2, 0x40, 288, 0x20, 0x60, 3, 7, 2, 1, 2, 0x20, 0x60, 17, 19, 2, 11, 13 -// gas irOptimized: 188448 +// gas irOptimized: 188576 diff --git a/test/libsolidity/semanticTests/array/copying/elements_of_nested_array_of_structs_memory_to_storage.sol b/test/libsolidity/semanticTests/array/copying/elements_of_nested_array_of_structs_memory_to_storage.sol index 12c40849fe6f..83cfa7488c97 100644 --- a/test/libsolidity/semanticTests/array/copying/elements_of_nested_array_of_structs_memory_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/elements_of_nested_array_of_structs_memory_to_storage.sol @@ -31,8 +31,8 @@ contract C { // compileViaYul: true // ---- // test1((uint8[],uint8[2])[][][]): 0x20, 1, 0x20, 2, 0x40, 0x0140, 1, 0x20, 0x60, 3, 7, 2, 1, 2, 2, 0x40, 0x0100, 0x60, 17, 19, 2, 11, 13, 0x60, 31, 37, 2, 23, 29 -> 0x20, 2, 0x40, 0x0140, 1, 0x20, 0x60, 3, 7, 2, 1, 2, 2, 0x40, 0x0100, 0x60, 17, 19, 2, 11, 13, 0x60, 31, 37, 2, 23, 29 -// gas irOptimized: 332582 +// gas irOptimized: 332390 // test2((uint8[],uint8[2])[][1][]): 0x20, 2, 0x40, 0x0160, 0x20, 1, 0x20, 0x60, 17, 19, 2, 11, 13, 0x20, 1, 0x20, 0x60, 31, 37, 2, 23, 29 -> 0x20, 0x20, 1, 0x20, 0x60, 17, 19, 2, 11, 13 -// gas irOptimized: 145415 +// gas irOptimized: 145283 // test3((uint8[],uint8[2])[1][][2]): 0x20, 0x40, 0x60, 0, 2, 0x40, 288, 0x20, 0x60, 3, 7, 2, 1, 2, 0x20, 0x60, 17, 19, 2, 11, 13 -> 0x20, 2, 0x40, 288, 0x20, 0x60, 3, 7, 2, 1, 2, 0x20, 0x60, 17, 19, 2, 11, 13 -// gas irOptimized: 192254 +// gas irOptimized: 192110 diff --git a/test/libsolidity/semanticTests/array/copying/function_type_array_to_storage.sol b/test/libsolidity/semanticTests/array/copying/function_type_array_to_storage.sol index a5cf48011226..2e557612040d 100644 --- a/test/libsolidity/semanticTests/array/copying/function_type_array_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/function_type_array_to_storage.sol @@ -46,11 +46,11 @@ contract C { } // ---- // test() -> 0x20, 0x14, "[a called][b called]" -// gas irOptimized: 116512 +// gas irOptimized: 116616 // gas legacy: 120226 -// gas legacyOptimized: 116941 +// gas legacyOptimized: 117001 // test2() -> 0x20, 0x14, "[b called][a called]" // test3() -> 0x20, 0x14, "[b called][a called]" -// gas irOptimized: 103138 +// gas irOptimized: 103186 // gas legacy: 105192 -// gas legacyOptimized: 103752 +// gas legacyOptimized: 103768 diff --git a/test/libsolidity/semanticTests/array/copying/memory_dyn_2d_bytes_to_storage.sol b/test/libsolidity/semanticTests/array/copying/memory_dyn_2d_bytes_to_storage.sol index 93eb84427d66..1b0aa6ace769 100644 --- a/test/libsolidity/semanticTests/array/copying/memory_dyn_2d_bytes_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/memory_dyn_2d_bytes_to_storage.sol @@ -18,6 +18,6 @@ contract C { } // ---- // f() -> 3 -// gas irOptimized: 128301 +// gas irOptimized: 128211 // gas legacy: 129528 -// gas legacyOptimized: 128171 +// gas legacyOptimized: 128041 diff --git a/test/libsolidity/semanticTests/array/copying/nested_array_calldata_to_storage.sol b/test/libsolidity/semanticTests/array/copying/nested_array_calldata_to_storage.sol index ffa0c68adcbe..ed7ef0b5f706 100644 --- a/test/libsolidity/semanticTests/array/copying/nested_array_calldata_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/nested_array_calldata_to_storage.sol @@ -38,10 +38,10 @@ contract c { // compileViaYul: true // ---- // test1(uint256[][]): 0x20, 2, 0x40, 0x40, 2, 23, 42 -> 2, 65 -// gas irOptimized: 180918 +// gas irOptimized: 180982 // test2(uint256[][2]): 0x20, 0x40, 0x40, 2, 23, 42 -> 2, 65 -// gas irOptimized: 157604 +// gas irOptimized: 157660 // test3(uint256[2][]): 0x20, 2, 23, 42, 23, 42 -> 2, 65 -// gas irOptimized: 134685 +// gas irOptimized: 134701 // test4(uint256[2][2]): 23, 42, 23, 42 -> 65 // gas irOptimized: 111177 diff --git a/test/libsolidity/semanticTests/array/copying/nested_array_dynamic_dynamic_calldata_to_storage.sol b/test/libsolidity/semanticTests/array/copying/nested_array_dynamic_dynamic_calldata_to_storage.sol index f3cb51187103..62996e89d5f0 100644 --- a/test/libsolidity/semanticTests/array/copying/nested_array_dynamic_dynamic_calldata_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/nested_array_dynamic_dynamic_calldata_to_storage.sol @@ -8,6 +8,6 @@ contract C { // compileViaYul: true // ---- // i(uint256[][]): 0x20, 2, 0x40, 0xC0, 3, 0x0A01, 0x0A02, 0x0A03, 4, 0x0B01, 0x0B02, 0x0B03, 0x0B04 -// gas irOptimized: 245511 +// gas irOptimized: 245543 // tmp_i(uint256,uint256): 0, 0 -> 0x0A01 // tmp_i(uint256,uint256): 1, 0 -> 0x0B01 diff --git a/test/libsolidity/semanticTests/array/copying/nested_array_of_structs_calldata_to_storage.sol b/test/libsolidity/semanticTests/array/copying/nested_array_of_structs_calldata_to_storage.sol index b27fe9e06453..68e767f9bacf 100644 --- a/test/libsolidity/semanticTests/array/copying/nested_array_of_structs_calldata_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/nested_array_of_structs_calldata_to_storage.sol @@ -29,8 +29,8 @@ contract C { // compileViaYul: true // ---- // test1((uint8[],uint8[2])[][]): 0x20, 2, 0x40, 0x0140, 1, 0x20, 0x60, 3, 7, 2, 1, 2, 2, 0x40, 0x0100, 0x60, 17, 19, 2, 11, 13, 0x60, 31, 37, 2, 23, 29 -> 0x20, 2, 0x40, 0x0140, 1, 0x20, 0x60, 3, 7, 2, 1, 2, 2, 0x40, 0x0100, 0x60, 17, 19, 2, 11, 13, 0x60, 31, 37, 2, 23, 29 -// gas irOptimized: 304750 +// gas irOptimized: 304950 // test2((uint8[],uint8[2])[][1]): 0x20, 0x20, 1, 0x20, 0x60, 17, 19, 2, 11, 13 -> 0x20, 0x20, 1, 0x20, 0x60, 17, 19, 2, 11, 13 -// gas irOptimized: 116659 +// gas irOptimized: 116747 // test3((uint8[],uint8[2])[1][]): 0x20, 2, 0x40, 0x0120, 0x20, 0x60, 3, 7, 2, 1, 2, 0x20, 0x60, 17, 19, 2, 11, 13 -> 0x20, 2, 0x40, 0x0120, 0x20, 0x60, 3, 7, 2, 1, 2, 0x20, 0x60, 17, 19, 2, 11, 13 -// gas irOptimized: 187942 +// gas irOptimized: 188070 diff --git a/test/libsolidity/semanticTests/array/copying/nested_array_of_structs_memory_to_storage.sol b/test/libsolidity/semanticTests/array/copying/nested_array_of_structs_memory_to_storage.sol index 146de2f2af6a..13817f318658 100644 --- a/test/libsolidity/semanticTests/array/copying/nested_array_of_structs_memory_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/nested_array_of_structs_memory_to_storage.sol @@ -29,8 +29,8 @@ contract C { // compileViaYul: true // ---- // test1((uint8[],uint8[2])[][]): 0x20, 2, 0x40, 0x0140, 1, 0x20, 0x60, 3, 7, 2, 1, 2, 2, 0x40, 0x0100, 0x60, 17, 19, 2, 11, 13, 0x60, 31, 37, 2, 23, 29 -> 0x20, 2, 0x40, 0x0140, 1, 0x20, 0x60, 3, 7, 2, 1, 2, 2, 0x40, 0x0100, 0x60, 17, 19, 2, 11, 13, 0x60, 31, 37, 2, 23, 29 -// gas irOptimized: 309034 +// gas irOptimized: 308854 // test2((uint8[],uint8[2])[][1]): 0x20, 0x20, 1, 0x20, 0x60, 17, 19, 2, 11, 13 -> 0x20, 0x20, 1, 0x20, 0x60, 17, 19, 2, 11, 13 -// gas irOptimized: 118320 +// gas irOptimized: 118244 // test3((uint8[],uint8[2])[1][]): 0x20, 2, 0x40, 0x0120, 0x20, 0x60, 3, 7, 2, 1, 2, 0x20, 0x60, 17, 19, 2, 11, 13 -> 0x20, 2, 0x40, 0x0120, 0x20, 0x60, 3, 7, 2, 1, 2, 0x20, 0x60, 17, 19, 2, 11, 13 -// gas irOptimized: 190993 +// gas irOptimized: 190869 diff --git a/test/libsolidity/semanticTests/array/copying/nested_dynamic_array_element_calldata_to_storage.sol b/test/libsolidity/semanticTests/array/copying/nested_dynamic_array_element_calldata_to_storage.sol index 7583f5ab4f0d..e7893c67c128 100644 --- a/test/libsolidity/semanticTests/array/copying/nested_dynamic_array_element_calldata_to_storage.sol +++ b/test/libsolidity/semanticTests/array/copying/nested_dynamic_array_element_calldata_to_storage.sol @@ -30,7 +30,7 @@ contract C { // compileViaYul: true // ---- // test(uint8[][][]): 0x20, 2, 0x40, 0x60, 0, 2, 0x40, 0x80, 1, 7, 2, 8, 9 -// gas irOptimized: 137891 +// gas irOptimized: 137947 // test2(uint8[][]): 0x20, 2, 0x40, 0x80, 1, 7, 2, 8, 9 -// gas irOptimized: 164249 +// gas irOptimized: 164305 // gas legacyOptimized: 120228 diff --git a/test/libsolidity/semanticTests/array/delete/bytes_delete_element.sol b/test/libsolidity/semanticTests/array/delete/bytes_delete_element.sol index 03c47f69b414..967030548519 100644 --- a/test/libsolidity/semanticTests/array/delete/bytes_delete_element.sol +++ b/test/libsolidity/semanticTests/array/delete/bytes_delete_element.sol @@ -18,4 +18,4 @@ contract c { // test1() -> true // gas irOptimized: 218420 // gas legacy: 242263 -// gas legacyOptimized: 241187 +// gas legacyOptimized: 241169 diff --git a/test/libsolidity/semanticTests/array/delete/delete_storage_array_packed.sol b/test/libsolidity/semanticTests/array/delete/delete_storage_array_packed.sol index cf416c16d192..52d945ae315b 100644 --- a/test/libsolidity/semanticTests/array/delete/delete_storage_array_packed.sol +++ b/test/libsolidity/semanticTests/array/delete/delete_storage_array_packed.sol @@ -14,6 +14,6 @@ contract C { } // ---- // f() -> 0, 0, 0 -// gas irOptimized: 88028 +// gas irOptimized: 88032 // gas legacy: 88796 -// gas legacyOptimized: 87704 +// gas legacyOptimized: 87694 diff --git a/test/libsolidity/semanticTests/array/invalid_encoding_for_storage_byte_array.sol b/test/libsolidity/semanticTests/array/invalid_encoding_for_storage_byte_array.sol index a53d00eaaf31..9d6826bde6c1 100644 --- a/test/libsolidity/semanticTests/array/invalid_encoding_for_storage_byte_array.sol +++ b/test/libsolidity/semanticTests/array/invalid_encoding_for_storage_byte_array.sol @@ -40,7 +40,7 @@ contract C { // copyFromStorageShort() // x() -> 0x20, 3, 0x6162630000000000000000000000000000000000000000000000000000000000 // copyFromStorageLong() -// gas irOptimized: 121092 +// gas irOptimized: 121100 // gas legacy: 121904 // gas legacyOptimized: 121393 // x() -> 0x20, 0x25, 0x3132333435363738393031323334353637383930313233343536373839303132, 0x3334353637000000000000000000000000000000000000000000000000000000 diff --git a/test/libsolidity/semanticTests/array/long_byte_array_cleanup_after_delete.sol b/test/libsolidity/semanticTests/array/long_byte_array_cleanup_after_delete.sol index b638664aaca1..4195c04c5778 100644 --- a/test/libsolidity/semanticTests/array/long_byte_array_cleanup_after_delete.sol +++ b/test/libsolidity/semanticTests/array/long_byte_array_cleanup_after_delete.sol @@ -69,7 +69,7 @@ contract C { // checkSlots() -> 0, 0, 0, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff, 0 // canaryValue() -> 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff // fillArray() -// gas irOptimized: 197289 +// gas irOptimized: 196425 // gas legacy: 220574 // gas legacyOptimized: 206839 // canaryValue() -> 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff diff --git a/test/libsolidity/semanticTests/array/long_byte_array_cleanup_after_overwrite_with_long.sol b/test/libsolidity/semanticTests/array/long_byte_array_cleanup_after_overwrite_with_long.sol index c796881c4c25..b64850f2b3e2 100644 --- a/test/libsolidity/semanticTests/array/long_byte_array_cleanup_after_overwrite_with_long.sol +++ b/test/libsolidity/semanticTests/array/long_byte_array_cleanup_after_overwrite_with_long.sol @@ -88,7 +88,7 @@ contract C { // arrayLength() ->0 // canaryValue() -> 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff // fillArray() -// gas irOptimized: 197352 +// gas irOptimized: 196488 // gas legacy: 220574 // gas legacyOptimized: 206839 // arrayLength() ->96 diff --git a/test/libsolidity/semanticTests/array/push/array_push_nested_from_calldata.sol b/test/libsolidity/semanticTests/array/push/array_push_nested_from_calldata.sol index 83c5c1724307..481815eca11b 100644 --- a/test/libsolidity/semanticTests/array/push/array_push_nested_from_calldata.sol +++ b/test/libsolidity/semanticTests/array/push/array_push_nested_from_calldata.sol @@ -12,6 +12,6 @@ contract C { } // ---- // f(uint120[]): 0x20, 3, 1, 2, 3 -> 1 -// gas irOptimized: 112852 +// gas irOptimized: 112833 // gas legacy: 114404 -// gas legacyOptimized: 113087 +// gas legacyOptimized: 113079 diff --git a/test/libsolidity/semanticTests/array/push/array_push_packed_array.sol b/test/libsolidity/semanticTests/array/push/array_push_packed_array.sol index e6c010230859..4bc957d86bb2 100644 --- a/test/libsolidity/semanticTests/array/push/array_push_packed_array.sol +++ b/test/libsolidity/semanticTests/array/push/array_push_packed_array.sol @@ -13,6 +13,6 @@ contract c { } // ---- // test() -> 1, 2, 3, 4 -// gas irOptimized: 92545 +// gas irOptimized: 92505 // gas legacy: 92756 -// gas legacyOptimized: 92045 +// gas legacyOptimized: 92017 diff --git a/test/libsolidity/semanticTests/array/push/array_push_struct.sol b/test/libsolidity/semanticTests/array/push/array_push_struct.sol index 4e1e8b4b3db0..495d884cf486 100644 --- a/test/libsolidity/semanticTests/array/push/array_push_struct.sol +++ b/test/libsolidity/semanticTests/array/push/array_push_struct.sol @@ -20,6 +20,6 @@ contract c { } // ---- // test() -> 2, 3, 4, 5 -// gas irOptimized: 135329 +// gas irOptimized: 135361 // gas legacy: 139481 -// gas legacyOptimized: 135795 +// gas legacyOptimized: 135800 diff --git a/test/libsolidity/semanticTests/array/push/nested_bytes_push.sol b/test/libsolidity/semanticTests/array/push/nested_bytes_push.sol index 04b2a4a736c9..f532def9dc83 100644 --- a/test/libsolidity/semanticTests/array/push/nested_bytes_push.sol +++ b/test/libsolidity/semanticTests/array/push/nested_bytes_push.sol @@ -13,6 +13,6 @@ contract C { } // ---- // f() -> -// gas irOptimized: 179534 +// gas irOptimized: 179507 // gas legacy: 181013 -// gas legacyOptimized: 180406 +// gas legacyOptimized: 180394 diff --git a/test/libsolidity/semanticTests/cleanup/byte_array_to_storage_cleanup.sol b/test/libsolidity/semanticTests/cleanup/byte_array_to_storage_cleanup.sol index 4c75ad452b8d..f593bf29ec3e 100644 --- a/test/libsolidity/semanticTests/cleanup/byte_array_to_storage_cleanup.sol +++ b/test/libsolidity/semanticTests/cleanup/byte_array_to_storage_cleanup.sol @@ -28,14 +28,14 @@ contract C { // compileViaYul: also // ---- // constructor() -> -// gas irOptimized: 82586 -// gas irOptimized code: 363600 +// gas irOptimized: 82202 +// gas irOptimized code: 358800 // gas legacy: 101811 // gas legacy code: 608200 -// gas legacyOptimized: 85196 -// gas legacyOptimized code: 394800 +// gas legacyOptimized: 84940 +// gas legacyOptimized code: 391600 // h() -> 0x20, 0x40, 0x00, 0 // ~ emit ev(uint256[],uint256): 0x40, 0x21, 0x02, 0x00, 0x00 // g() -> 0x20, 0x40, 0, 0x00 // f(bytes): 0x20, 33, 0, -1 -> 0x20, 0x22, 0, 0xff00000000000000000000000000000000000000000000000000000000000000 -// gas irOptimized: 54117 +// gas irOptimized: 54149 diff --git a/test/libsolidity/semanticTests/constructor/arrays_in_constructors.sol b/test/libsolidity/semanticTests/constructor/arrays_in_constructors.sol index 76a4dd961fe4..14e818198723 100644 --- a/test/libsolidity/semanticTests/constructor/arrays_in_constructors.sol +++ b/test/libsolidity/semanticTests/constructor/arrays_in_constructors.sol @@ -26,9 +26,9 @@ contract Creator { // bytecodeFormat: legacy,>=EOFv1 // ---- // f(uint256,address[]): 7, 0x40, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 -> 7, 8 -// gas irOptimized: 327784 -// gas irOptimized code: 94000 +// gas irOptimized: 327610 +// gas irOptimized code: 89800 // gas legacy: 338477 // gas legacy code: 244800 -// gas legacyOptimized: 329166 -// gas legacyOptimized code: 117000 +// gas legacyOptimized: 328979 +// gas legacyOptimized code: 112200 diff --git a/test/libsolidity/semanticTests/constructor/bytes_in_constructors_packer.sol b/test/libsolidity/semanticTests/constructor/bytes_in_constructors_packer.sol index 91be8e3789f3..d422707fad89 100644 --- a/test/libsolidity/semanticTests/constructor/bytes_in_constructors_packer.sol +++ b/test/libsolidity/semanticTests/constructor/bytes_in_constructors_packer.sol @@ -26,9 +26,9 @@ contract Creator { // bytecodeFormat: legacy,>=EOFv1 // ---- // f(uint256,bytes): 7, 0x40, 78, "abcdefghijklmnopqrstuvwxyzabcdef", "ghijklmnopqrstuvwxyzabcdefghijkl", "mnopqrstuvwxyz" -> 7, "h" -// gas irOptimized: 169297 -// gas irOptimized code: 99600 +// gas irOptimized: 169304 +// gas irOptimized code: 97200 // gas legacy: 172946 // gas legacy code: 239800 -// gas legacyOptimized: 169823 -// gas legacyOptimized code: 118600 +// gas legacyOptimized: 169793 +// gas legacyOptimized code: 115400 diff --git a/test/libsolidity/semanticTests/constructor/bytes_in_constructors_unpacker.sol b/test/libsolidity/semanticTests/constructor/bytes_in_constructors_unpacker.sol index 8a072f3ebed6..b8e9e7f80699 100644 --- a/test/libsolidity/semanticTests/constructor/bytes_in_constructors_unpacker.sol +++ b/test/libsolidity/semanticTests/constructor/bytes_in_constructors_unpacker.sol @@ -10,11 +10,11 @@ contract Test { // bytecodeFormat: legacy,>=EOFv1 // ---- // constructor(): 7, 0x40, 78, "abcdefghijklmnopqrstuvwxyzabcdef", "ghijklmnopqrstuvwxyzabcdefghijkl", "mnopqrstuvwxyz" -> -// gas irOptimized: 181629 +// gas irOptimized: 181405 // gas irOptimized code: 78400 // gas legacy: 195484 // gas legacy code: 109400 -// gas legacyOptimized: 181853 +// gas legacyOptimized: 181645 // gas legacyOptimized code: 71400 // m_x() -> 7 // m_s() -> 0x20, 78, "abcdefghijklmnopqrstuvwxyzabcdef", "ghijklmnopqrstuvwxyzabcdefghijkl", "mnopqrstuvwxyz" diff --git a/test/libsolidity/semanticTests/constructor/constructor_static_array_argument.sol b/test/libsolidity/semanticTests/constructor/constructor_static_array_argument.sol index cc196a95c802..267ef640f5cb 100644 --- a/test/libsolidity/semanticTests/constructor/constructor_static_array_argument.sol +++ b/test/libsolidity/semanticTests/constructor/constructor_static_array_argument.sol @@ -11,11 +11,11 @@ contract C { // bytecodeFormat: legacy,>=EOFv1 // ---- // constructor(): 1, 2, 3, 4 -> -// gas irOptimized: 148129 +// gas irOptimized: 148025 // gas irOptimized code: 23000 // gas legacy: 166201 // gas legacy code: 60400 -// gas legacyOptimized: 149177 +// gas legacyOptimized: 149125 // gas legacyOptimized code: 26200 // a() -> 1 // b(uint256): 0 -> 2 diff --git a/test/libsolidity/semanticTests/externalContracts/FixedFeeRegistrar.sol b/test/libsolidity/semanticTests/externalContracts/FixedFeeRegistrar.sol index 9ac85f9c8d8e..8913c81793f3 100644 --- a/test/libsolidity/semanticTests/externalContracts/FixedFeeRegistrar.sol +++ b/test/libsolidity/semanticTests/externalContracts/FixedFeeRegistrar.sol @@ -77,19 +77,19 @@ contract FixedFeeRegistrar is Registrar { // experimental: true // ---- // constructor() -// gas irOptimized: 78076 -// gas irOptimized code: 307400 +// gas irOptimized: 76387 +// gas irOptimized code: 286600 // gas legacy: 115395 // gas legacy code: 792400 -// gas legacyOptimized: 84598 -// gas legacyOptimized code: 388000 -// gas ssaCFGOptimized: 78844 -// gas ssaCFGOptimized code: 321800 +// gas legacyOptimized: 83123 +// gas legacyOptimized code: 369800 +// gas ssaCFGOptimized: 77140 +// gas ssaCFGOptimized code: 300800 // reserve(string), 69 ether: 0x20, 3, "abc" -> // ~ emit Changed(string): #0x4e03657aea45a94fc7d47ba826c8d667c0d1e6e33a64a036ec44f58fa12d6c45 -// gas irOptimized: 45741 +// gas irOptimized: 45756 // gas legacy: 46698 -// gas legacyOptimized: 45948 +// gas legacyOptimized: 45961 // owner(string): 0x20, 3, "abc" -> 0x1212121212121212121212121212120000000012 // reserve(string), 70 ether: 0x20, 3, "def" -> // ~ emit Changed(string): #0x34607c9bbfeb9c23509680f04363f298fdb0b5f9abe327304ecd1daca08cda9c diff --git a/test/libsolidity/semanticTests/externalContracts/base64.sol b/test/libsolidity/semanticTests/externalContracts/base64.sol index 0efcda12d8f0..51ff7459468a 100644 --- a/test/libsolidity/semanticTests/externalContracts/base64.sol +++ b/test/libsolidity/semanticTests/externalContracts/base64.sol @@ -35,14 +35,14 @@ contract test { // experimental: true // ---- // constructor() -// gas irOptimized: 79076 -// gas irOptimized code: 322000 +// gas irOptimized: 78730 +// gas irOptimized code: 318200 // gas legacy: 102214 // gas legacy code: 629800 -// gas legacyOptimized: 87926 -// gas legacyOptimized code: 429800 -// gas ssaCFGOptimized: 79879 -// gas ssaCFGOptimized code: 331800 +// gas legacyOptimized: 86977 +// gas legacyOptimized code: 418400 +// gas ssaCFGOptimized: 79376 +// gas ssaCFGOptimized code: 325600 // encode_inline_asm(bytes): 0x20, 0 -> 0x20, 0 // encode_inline_asm(bytes): 0x20, 1, "f" -> 0x20, 4, "Zg==" // encode_inline_asm(bytes): 0x20, 2, "fo" -> 0x20, 4, "Zm8=" @@ -58,12 +58,12 @@ contract test { // encode_no_asm(bytes): 0x20, 5, "fooba" -> 0x20, 8, "Zm9vYmE=" // encode_no_asm(bytes): 0x20, 6, "foobar" -> 0x20, 8, "Zm9vYmFy" // encode_inline_asm_large() -// gas irOptimized: 1406025 +// gas irOptimized: 1442025 // gas legacy: 1554038 -// gas legacyOptimized: 1132031 -// gas ssaCFGOptimized: 1388025 +// gas legacyOptimized: 1140031 +// gas ssaCFGOptimized: 1424025 // encode_no_asm_large() -// gas irOptimized: 3512081 +// gas irOptimized: 3485081 // gas legacy: 4600082 -// gas legacyOptimized: 2813075 +// gas legacyOptimized: 2769075 // gas ssaCFGOptimized: 3077081 diff --git a/test/libsolidity/semanticTests/externalContracts/deposit_contract.sol b/test/libsolidity/semanticTests/externalContracts/deposit_contract.sol index 6755c79ee2fb..6c8756f5d608 100644 --- a/test/libsolidity/semanticTests/externalContracts/deposit_contract.sol +++ b/test/libsolidity/semanticTests/externalContracts/deposit_contract.sol @@ -179,44 +179,44 @@ contract DepositContract is IDepositContract, ERC165 { // experimental: true // ---- // constructor() -// gas irOptimized: 809570 -// gas irOptimized code: 558000 +// gas irOptimized: 808338 +// gas irOptimized code: 548600 // gas legacy: 920228 // gas legacy code: 1438800 -// gas legacyOptimized: 848699 -// gas legacyOptimized code: 878200 -// gas ssaCFGOptimized: 809403 -// gas ssaCFGOptimized code: 568200 +// gas legacyOptimized: 847427 +// gas legacyOptimized code: 863000 +// gas ssaCFGOptimized: 808472 +// gas ssaCFGOptimized code: 558800 // supportsInterface(bytes4): 0x0 -> 0 // supportsInterface(bytes4): 0xffffffff00000000000000000000000000000000000000000000000000000000 -> false # defined to be false by ERC-165 # // supportsInterface(bytes4): 0x01ffc9a700000000000000000000000000000000000000000000000000000000 -> true # ERC-165 id # // supportsInterface(bytes4): 0x8564090700000000000000000000000000000000000000000000000000000000 -> true # the deposit interface id # // get_deposit_root() -> 0xd70a234731285c6804c2a4f56711ddb8c82c99740f207854891028af34e27e5e -// gas irOptimized: 109178 +// gas irOptimized: 109460 // gas legacy: 142741 -// gas legacyOptimized: 117558 -// gas ssaCFGOptimized: 109652 +// gas legacyOptimized: 117531 +// gas ssaCFGOptimized: 109925 // get_deposit_count() -> 0x20, 8, 0 # TODO: check balance and logs after each deposit # // deposit(bytes,bytes,bytes,bytes32), 32 ether: 0 -> FAILURE # Empty input # // get_deposit_root() -> 0xd70a234731285c6804c2a4f56711ddb8c82c99740f207854891028af34e27e5e -// gas irOptimized: 109178 +// gas irOptimized: 109460 // gas legacy: 142741 -// gas legacyOptimized: 117558 -// gas ssaCFGOptimized: 109652 +// gas legacyOptimized: 117531 +// gas ssaCFGOptimized: 109925 // get_deposit_count() -> 0x20, 8, 0 // deposit(bytes,bytes,bytes,bytes32), 1 ether: 0x80, 0xe0, 0x120, 0xaa4a8d0b7d9077248630f1a4701ae9764e42271d7f22b7838778411857fd349e, 0x30, 0x933ad9491b62059dd065b560d256d8957a8c402cc6e8d8ee7290ae11e8f73292, 0x67a8811c397529dac52ae1342ba58c9500000000000000000000000000000000, 0x20, 0x00f50428677c60f997aadeab24aabf7fceaef491c96a52b463ae91f95611cf71, 0x60, 0xa29d01cc8c6296a8150e515b5995390ef841dc18948aa3e79be6d7c1851b4cbb, 0x5d6ff49fa70b9c782399506a22a85193151b9b691245cebafd2063012443c132, 0x4b6c36debaedefb7b2d71b0503ffdc00150aaffd42e63358238ec888901738b8 -> # txhash: 0x7085c586686d666e8bb6e9477a0f0b09565b2060a11f1c4209d3a52295033832 # // ~ emit DepositEvent(bytes,bytes,bytes,bytes,bytes): 0xa0, 0x0100, 0x0140, 0x0180, 0x0200, 0x30, 0x933ad9491b62059dd065b560d256d8957a8c402cc6e8d8ee7290ae11e8f73292, 0x67a8811c397529dac52ae1342ba58c9500000000000000000000000000000000, 0x20, 0xf50428677c60f997aadeab24aabf7fceaef491c96a52b463ae91f95611cf71, 0x08, 0xca9a3b00000000000000000000000000000000000000000000000000000000, 0x60, 0xa29d01cc8c6296a8150e515b5995390ef841dc18948aa3e79be6d7c1851b4cbb, 0x5d6ff49fa70b9c782399506a22a85193151b9b691245cebafd2063012443c132, 0x4b6c36debaedefb7b2d71b0503ffdc00150aaffd42e63358238ec888901738b8, 0x08, 0x00 // get_deposit_root() -> 0x2089653123d9c721215120b6db6738ba273bbc5228ac093b1f983badcdc8a438 -// gas irOptimized: 109174 +// gas irOptimized: 109456 // gas legacy: 142750 -// gas legacyOptimized: 117570 -// gas ssaCFGOptimized: 109645 +// gas legacyOptimized: 117543 +// gas ssaCFGOptimized: 109918 // get_deposit_count() -> 0x20, 8, 0x0100000000000000000000000000000000000000000000000000000000000000 // deposit(bytes,bytes,bytes,bytes32), 32 ether: 0x80, 0xe0, 0x120, 0xdbd986dc85ceb382708cf90a3500f500f0a393c5ece76963ac3ed72eccd2c301, 0x30, 0xb2ce0f79f90e7b3a113ca5783c65756f96c4b4673c2b5c1eb4efc22280259441, 0x06d601211e8866dc5b50dc48a244dd7c00000000000000000000000000000000, 0x20, 0x00344b6c73f71b11c56aba0d01b7d8ad83559f209d0a4101a515f6ad54c89771, 0x60, 0x945caaf82d18e78c033927d51f452ebcd76524497b91d7a11219cb3db6a1d369, 0x7595fc095ce489e46b2ef129591f2f6d079be4faaf345a02c5eb133c072e7c56, 0x0c6c3617eee66b4b878165c502357d49485326bc6b31bc96873f308c8f19c09d -> # txhash: 0x404d8e109822ce448e68f45216c12cb051b784d068fbe98317ab8e50c58304ac # // ~ emit DepositEvent(bytes,bytes,bytes,bytes,bytes): 0xa0, 0x0100, 0x0140, 0x0180, 0x0200, 0x30, 0xb2ce0f79f90e7b3a113ca5783c65756f96c4b4673c2b5c1eb4efc22280259441, 0x06d601211e8866dc5b50dc48a244dd7c00000000000000000000000000000000, 0x20, 0x344b6c73f71b11c56aba0d01b7d8ad83559f209d0a4101a515f6ad54c89771, 0x08, 0x40597307000000000000000000000000000000000000000000000000000000, 0x60, 0x945caaf82d18e78c033927d51f452ebcd76524497b91d7a11219cb3db6a1d369, 0x7595fc095ce489e46b2ef129591f2f6d079be4faaf345a02c5eb133c072e7c56, 0x0c6c3617eee66b4b878165c502357d49485326bc6b31bc96873f308c8f19c09d, 0x08, 0x0100000000000000000000000000000000000000000000000000000000000000 // get_deposit_root() -> 0x40255975859377d912c53aa853245ebd939bdd2b33a28e084babdcc1ed8238ee -// gas irOptimized: 109174 +// gas irOptimized: 109456 // gas legacy: 142750 -// gas legacyOptimized: 117570 -// gas ssaCFGOptimized: 109645 +// gas legacyOptimized: 117543 +// gas ssaCFGOptimized: 109918 // get_deposit_count() -> 0x20, 8, 0x0200000000000000000000000000000000000000000000000000000000000000 diff --git a/test/libsolidity/semanticTests/externalContracts/prbmath_signed.sol b/test/libsolidity/semanticTests/externalContracts/prbmath_signed.sol index ad32fdc15adb..3ad01365f9ba 100644 --- a/test/libsolidity/semanticTests/externalContracts/prbmath_signed.sol +++ b/test/libsolidity/semanticTests/externalContracts/prbmath_signed.sol @@ -51,18 +51,18 @@ contract test { // experimental: true // ---- // constructor() -// gas irOptimized: 177903 -// gas irOptimized code: 1674400 +// gas irOptimized: 177548 +// gas irOptimized code: 1670200 // gas legacy: 209723 // gas legacy code: 2205000 -// gas legacyOptimized: 178012 -// gas legacyOptimized code: 1669600 -// gas ssaCFGOptimized: 175048 -// gas ssaCFGOptimized code: 1639600 +// gas legacyOptimized: 177796 +// gas legacyOptimized code: 1666600 +// gas ssaCFGOptimized: 174717 +// gas ssaCFGOptimized code: 1635400 // div(int256,int256): 3141592653589793238, 88714123 -> 35412542528203691288251815328 -// gas irOptimized: 22045 +// gas irOptimized: 22041 // gas legacy: 22736 -// gas legacyOptimized: 22264 +// gas legacyOptimized: 22260 // exp(int256): 3141592653589793238 -> 23140692632779268978 // gas irOptimized: 24452 // gas legacy: 25124 @@ -76,26 +76,26 @@ contract test { // gas legacy: 23202 // gas legacyOptimized: 22685 // log10(int256): 3141592653589793238 -> 4971498726941338506 -// gas irOptimized: 30300 +// gas irOptimized: 30292 // gas legacy: 32841 -// gas legacyOptimized: 30249 +// gas legacyOptimized: 30241 // log2(int256): 3141592653589793238 -> 1651496129472318782 // gas irOptimized: 28566 // gas legacy: 30979 // gas legacyOptimized: 28357 // mul(int256,int256): 3141592653589793238, 88714123 -> 278703637 -// gas irOptimized: 22147 +// gas irOptimized: 22143 // gas legacy: 22775 -// gas legacyOptimized: 22288 +// gas legacyOptimized: 22284 // pow(int256,uint256): 3141592653589793238, 5 -> 306019684785281453040 -// gas irOptimized: 22488 +// gas irOptimized: 22484 // gas legacy: 23453 -// gas legacyOptimized: 22921 +// gas legacyOptimized: 22917 // sqrt(int256): 3141592653589793238 -> 1772453850905516027 // gas irOptimized: 22458 // gas legacy: 22784 // gas legacyOptimized: 22420 // benchmark(int256): 3141592653589793238 -> 998882724338592125, 1000000000000000000, 1000000000000000000 -// gas irOptimized: 34893 +// gas irOptimized: 34881 // gas legacy: 35244 -// gas legacyOptimized: 33996 +// gas legacyOptimized: 33984 diff --git a/test/libsolidity/semanticTests/externalContracts/ramanujan_pi.sol b/test/libsolidity/semanticTests/externalContracts/ramanujan_pi.sol index 44208308acab..da0d07300bae 100644 --- a/test/libsolidity/semanticTests/externalContracts/ramanujan_pi.sol +++ b/test/libsolidity/semanticTests/externalContracts/ramanujan_pi.sol @@ -36,15 +36,15 @@ contract test { // experimental: true // ---- // constructor() -// gas irOptimized: 77816 -// gas irOptimized code: 307600 +// gas irOptimized: 77366 +// gas irOptimized code: 302200 // gas legacy: 92110 // gas legacy code: 523600 -// gas legacyOptimized: 82667 -// gas legacyOptimized code: 369200 -// gas ssaCFGOptimized: 77956 -// gas ssaCFGOptimized code: 313400 +// gas legacyOptimized: 82523 +// gas legacyOptimized code: 367400 +// gas ssaCFGOptimized: 77512 +// gas ssaCFGOptimized code: 308000 // prb_pi() -> 3141592656369545286 -// gas irOptimized: 55036 +// gas irOptimized: 54860 // gas legacy: 100657 -// gas legacyOptimized: 74311 +// gas legacyOptimized: 74147 diff --git a/test/libsolidity/semanticTests/externalContracts/snark.sol b/test/libsolidity/semanticTests/externalContracts/snark.sol index f7e450487310..4348eda857e6 100644 --- a/test/libsolidity/semanticTests/externalContracts/snark.sol +++ b/test/libsolidity/semanticTests/externalContracts/snark.sol @@ -294,13 +294,13 @@ contract Test { // f() -> true // g() -> true // pair() -> true -// gas irOptimized: 275229 +// gas irOptimized: 275733 // gas legacy: 293579 -// gas legacyOptimized: 276313 -// gas ssaCFGOptimized: 275795 +// gas legacyOptimized: 276345 +// gas ssaCFGOptimized: 276299 // verifyTx() -> true // ~ emit Verified(string): 0x20, 0x16, "Successfully verified." -// gas irOptimized: 818076 +// gas irOptimized: 820852 // gas legacy: 904397 -// gas legacyOptimized: 816770 -// gas ssaCFGOptimized: 820130 +// gas legacyOptimized: 817006 +// gas ssaCFGOptimized: 822906 diff --git a/test/libsolidity/semanticTests/externalContracts/strings.sol b/test/libsolidity/semanticTests/externalContracts/strings.sol index 534b41710dbb..8b356a00eddd 100644 --- a/test/libsolidity/semanticTests/externalContracts/strings.sol +++ b/test/libsolidity/semanticTests/externalContracts/strings.sol @@ -52,32 +52,32 @@ contract test { // experimental: true // ---- // constructor() -// gas irOptimized: 95303 -// gas irOptimized code: 520000 +// gas irOptimized: 94602 +// gas irOptimized code: 511400 // gas legacy: 126346 // gas legacy code: 932600 -// gas legacyOptimized: 102639 -// gas legacyOptimized code: 612400 -// gas ssaCFGOptimized: 96128 -// gas ssaCFGOptimized code: 531800 +// gas legacyOptimized: 101904 +// gas legacyOptimized code: 603600 +// gas ssaCFGOptimized: 95451 +// gas ssaCFGOptimized code: 523200 // toSlice(string): 0x20, 11, "hello world" -> 11, 0xa0 -// gas irOptimized: 22646 +// gas irOptimized: 22694 // gas legacy: 23168 -// gas legacyOptimized: 22488 +// gas legacyOptimized: 22512 // roundtrip(string): 0x20, 11, "hello world" -> 0x20, 11, "hello world" -// gas irOptimized: 23225 +// gas irOptimized: 23289 // gas legacy: 23674 -// gas legacyOptimized: 22991 +// gas legacyOptimized: 23023 // utf8len(string): 0x20, 16, "\xf0\x9f\x98\x83\xf0\x9f\x98\x83\xf0\x9f\x98\x83\xf0\x9f\x98\x83" -> 4 # Input: "😃😃😃😃" # -// gas irOptimized: 23956 +// gas irOptimized: 23996 // gas legacy: 25621 -// gas legacyOptimized: 24096 +// gas legacyOptimized: 24120 // multiconcat(string,uint256): 0x40, 3, 11, "hello world" -> 0x20, 0x58, 0x68656c6c6f20776f726c6468656c6c6f20776f726c6468656c6c6f20776f726c, 0x6468656c6c6f20776f726c6468656c6c6f20776f726c6468656c6c6f20776f72, 49027192869463622675296414541903001712009715982962058146354235762728281047040 # concatenating 3 times # -// gas irOptimized: 27630 +// gas irOptimized: 27814 // gas legacy: 30778 -// gas legacyOptimized: 27519 +// gas legacyOptimized: 27575 // benchmark(string,bytes32): 0x40, 0x0842021, 8, "solidity" -> 0x2020 -// gas irOptimized: 1976778 +// gas irOptimized: 1977370 // gas legacy: 4234020 -// gas legacyOptimized: 2318668 -// gas ssaCFGOptimized: 1882325 +// gas legacyOptimized: 2318804 +// gas ssaCFGOptimized: 1882917 diff --git a/test/libsolidity/semanticTests/functionCall/send_zero_ether.sol b/test/libsolidity/semanticTests/functionCall/send_zero_ether.sol index 8eeaf7b51cad..50b654924e77 100644 --- a/test/libsolidity/semanticTests/functionCall/send_zero_ether.sol +++ b/test/libsolidity/semanticTests/functionCall/send_zero_ether.sol @@ -15,10 +15,10 @@ contract Main { } // ---- // constructor(), 20 wei -> -// gas irOptimized: 56314 -// gas irOptimized code: 37400 +// gas irOptimized: 56282 +// gas irOptimized code: 37000 // gas legacy: 57555 // gas legacy code: 53000 -// gas legacyOptimized: 56463 -// gas legacyOptimized code: 39600 +// gas legacyOptimized: 56415 +// gas legacyOptimized code: 39000 // s() -> true diff --git a/test/libsolidity/semanticTests/functionTypes/store_function.sol b/test/libsolidity/semanticTests/functionTypes/store_function.sol index 4e63272f3968..709cc29d2829 100644 --- a/test/libsolidity/semanticTests/functionTypes/store_function.sol +++ b/test/libsolidity/semanticTests/functionTypes/store_function.sol @@ -25,7 +25,7 @@ contract C { } // ---- // t() -> 9 -// gas irOptimized: 77300 +// gas irOptimized: 77357 // gas irOptimized code: 19000 // gas legacy: 79492 // gas legacy code: 69600 diff --git a/test/libsolidity/semanticTests/inheritance/address_overload_resolution.sol b/test/libsolidity/semanticTests/inheritance/address_overload_resolution.sol index f339b52445a4..7eef9a368d40 100644 --- a/test/libsolidity/semanticTests/inheritance/address_overload_resolution.sol +++ b/test/libsolidity/semanticTests/inheritance/address_overload_resolution.sol @@ -22,12 +22,12 @@ contract D { // EVMVersion: >=constantinople // ---- // f() -> 1 -// gas irOptimized: 54014 +// gas irOptimized: 54026 // gas irOptimized code: 20200 // gas legacy: 54553 // gas legacy code: 57800 // g() -> 5 -// gas irOptimized: 54042 +// gas irOptimized: 54054 // gas irOptimized code: 20200 // gas legacy: 55090 // gas legacy code: 57800 diff --git a/test/libsolidity/semanticTests/inheritance/inherited_function_calldata_calldata_interface.sol b/test/libsolidity/semanticTests/inheritance/inherited_function_calldata_calldata_interface.sol index e9013d6f52be..67909700e849 100644 --- a/test/libsolidity/semanticTests/inheritance/inherited_function_calldata_calldata_interface.sol +++ b/test/libsolidity/semanticTests/inheritance/inherited_function_calldata_calldata_interface.sol @@ -22,7 +22,7 @@ contract B { } // ---- // g() -> 42 -// gas irOptimized: 54536 +// gas irOptimized: 54548 // gas irOptimized code: 24800 // gas legacy: 55868 // gas legacy code: 66600 diff --git a/test/libsolidity/semanticTests/inheritance/inherited_function_calldata_memory_interface.sol b/test/libsolidity/semanticTests/inheritance/inherited_function_calldata_memory_interface.sol index 99fc73ae386b..ab48ad44232d 100644 --- a/test/libsolidity/semanticTests/inheritance/inherited_function_calldata_memory_interface.sol +++ b/test/libsolidity/semanticTests/inheritance/inherited_function_calldata_memory_interface.sol @@ -22,8 +22,8 @@ contract B { } // ---- // g() -> 42 -// gas irOptimized: 54828 -// gas irOptimized code: 42000 +// gas irOptimized: 54859 +// gas irOptimized code: 39600 // gas legacy: 56839 // gas legacy code: 123600 // gas legacyOptimized: 55013 diff --git a/test/libsolidity/semanticTests/operators/userDefined/operator_making_pure_external_call.sol b/test/libsolidity/semanticTests/operators/userDefined/operator_making_pure_external_call.sol index c75659bfa381..3b5e8881d116 100644 --- a/test/libsolidity/semanticTests/operators/userDefined/operator_making_pure_external_call.sol +++ b/test/libsolidity/semanticTests/operators/userDefined/operator_making_pure_external_call.sol @@ -54,15 +54,15 @@ contract C { // EVMVersion: >=constantinople // ---- // testMul(int32,int32): 42, 10 -> 420 -// gas irOptimized: 54784 -// gas irOptimized code: 40600 +// gas irOptimized: 54796 +// gas irOptimized code: 40400 // gas legacy: 57117 // gas legacy code: 127000 // gas legacyOptimized: 55242 // gas legacyOptimized code: 68200 // testInc(int32): 42 -> 43 -// gas irOptimized: 54621 -// gas irOptimized code: 40600 +// gas irOptimized: 54638 +// gas irOptimized code: 40400 // gas legacy: 56378 // gas legacy code: 127000 // gas legacyOptimized: 54944 diff --git a/test/libsolidity/semanticTests/operators/userDefined/operator_making_view_external_call.sol b/test/libsolidity/semanticTests/operators/userDefined/operator_making_view_external_call.sol index 009c7d969a8e..585908173328 100644 --- a/test/libsolidity/semanticTests/operators/userDefined/operator_making_view_external_call.sol +++ b/test/libsolidity/semanticTests/operators/userDefined/operator_making_view_external_call.sol @@ -60,15 +60,15 @@ contract C { // EVMVersion: >=constantinople // ---- // testMul(int32,int32): 42, 10 -> 420 -// gas irOptimized: 54784 -// gas irOptimized code: 40600 +// gas irOptimized: 54796 +// gas irOptimized code: 40400 // gas legacy: 57117 // gas legacy code: 127000 // gas legacyOptimized: 55242 // gas legacyOptimized code: 68200 // testInc(int32): 42 -> 43 -// gas irOptimized: 54621 -// gas irOptimized code: 40600 +// gas irOptimized: 54638 +// gas irOptimized code: 40400 // gas legacy: 56378 // gas legacy code: 127000 // gas legacyOptimized: 54944 diff --git a/test/libsolidity/semanticTests/storage/delete_overlapping_transient_before_storage_array_partial_assignment_same_base_type.sol b/test/libsolidity/semanticTests/storage/delete_overlapping_transient_before_storage_array_partial_assignment_same_base_type.sol index a9d3e0ae7384..a299a623e235 100644 --- a/test/libsolidity/semanticTests/storage/delete_overlapping_transient_before_storage_array_partial_assignment_same_base_type.sol +++ b/test/libsolidity/semanticTests/storage/delete_overlapping_transient_before_storage_array_partial_assignment_same_base_type.sol @@ -21,7 +21,7 @@ contract C { // EVMVersion: >=cancun // ---- // setAndClear() -> -// gas irOptimized: 124683 +// gas irOptimized: 124696 // gas legacy: 127807 // gas legacyOptimized: 124828 // getLarge() -> 10, 20, 0, 0 diff --git a/test/libsolidity/semanticTests/storage/empty_nonempty_empty.sol b/test/libsolidity/semanticTests/storage/empty_nonempty_empty.sol index 8d72f7c04358..72232a0fc6e9 100644 --- a/test/libsolidity/semanticTests/storage/empty_nonempty_empty.sol +++ b/test/libsolidity/semanticTests/storage/empty_nonempty_empty.sol @@ -22,12 +22,12 @@ contract Test { // set(bytes): 0x20, 0 // storageEmpty -> 1 // set(bytes): 0x20, 66, "12345678901234567890123456789012", "12345678901234567890123456789012", "12" -// gas irOptimized: 111820 +// gas irOptimized: 111852 // gas legacy: 112734 -// gas legacyOptimized: 112089 +// gas legacyOptimized: 112121 // storageEmpty -> 0 // set(bytes): 0x20, 3, "abc" -// gas irOptimized: 33989 +// gas irOptimized: 34015 // storageEmpty -> 0 // set(bytes): 0x20, 0 // storageEmpty -> 1 diff --git a/test/libsolidity/semanticTests/storage/static_array_copy_cleanup.sol b/test/libsolidity/semanticTests/storage/static_array_copy_cleanup.sol index ca471161d5e2..3ce7a8d26bbc 100644 --- a/test/libsolidity/semanticTests/storage/static_array_copy_cleanup.sol +++ b/test/libsolidity/semanticTests/storage/static_array_copy_cleanup.sol @@ -68,15 +68,15 @@ contract C { // getSourceAsUint() -> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // getDestAsUint() -> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // fillSource() -// gas irOptimized: 135018 +// gas irOptimized: 135003 // gas legacy: 146851 -// gas legacyOptimized: 137549 +// gas legacyOptimized: 137374 // canary() -> 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff // getSourceAsUint() -> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 // fillDest() -// gas irOptimized: 248706 +// gas irOptimized: 248676 // gas legacy: 272468 -// gas legacyOptimized: 253871 +// gas legacyOptimized: 253521 // canary() -> 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff // getSourceAsUint() -> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 // getDestAsUint() -> 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139 diff --git a/test/libsolidity/semanticTests/storage/storage_boundary_array_and_partial_assignment_with_layout.sol b/test/libsolidity/semanticTests/storage/storage_boundary_array_and_partial_assignment_with_layout.sol index 1e2637c851f9..e3aa5bd6463a 100644 --- a/test/libsolidity/semanticTests/storage/storage_boundary_array_and_partial_assignment_with_layout.sol +++ b/test/libsolidity/semanticTests/storage/storage_boundary_array_and_partial_assignment_with_layout.sol @@ -49,6 +49,6 @@ contract C layout at 2**256 - 5 { // x() -> 14, 15, 16, 17, 18, 19, 20, 0, 0, 0 // clearArray() // x() -> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -// gas irOptimized: 44183 +// gas irOptimized: 44199 // gas legacy: 46007 // gas legacyOptimized: 43907 diff --git a/test/libsolidity/semanticTests/storage/storage_boundary_array_partial_assignment.sol b/test/libsolidity/semanticTests/storage/storage_boundary_array_partial_assignment.sol index c4e3ee7794c0..ac7e577b70c9 100644 --- a/test/libsolidity/semanticTests/storage/storage_boundary_array_partial_assignment.sol +++ b/test/libsolidity/semanticTests/storage/storage_boundary_array_partial_assignment.sol @@ -36,6 +36,6 @@ contract C { // x() -> 11, 12, 13, 14, 15, 16, 17, 0, 0, 0 // partialAssignArrayBeforeStorageBoundary() // x() -> 21, 22, 23, 0, 0, 0, 0, 0, 0, 0 -// gas irOptimized: 44183 +// gas irOptimized: 44199 // gas legacy: 46012 // gas legacyOptimized: 43907 diff --git a/test/libsolidity/semanticTests/storage/storage_boundary_delete_overflow_bug.sol b/test/libsolidity/semanticTests/storage/storage_boundary_delete_overflow_bug.sol index 09aae988e511..01773f4d8974 100644 --- a/test/libsolidity/semanticTests/storage/storage_boundary_delete_overflow_bug.sol +++ b/test/libsolidity/semanticTests/storage/storage_boundary_delete_overflow_bug.sol @@ -51,30 +51,30 @@ contract C { // ---- // x() -> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -// gas irOptimized: 604108 +// gas irOptimized: 604104 // gas legacy: 644983 -// gas legacyOptimized: 598016 +// gas legacyOptimized: 598012 // fillArray() -// gas irOptimized: 5782148 +// gas irOptimized: 5781128 // gas legacy: 6044562 -// gas legacyOptimized: 5853893 +// gas legacyOptimized: 5852873 // x() -> 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255 -// gas irOptimized: 604108 +// gas irOptimized: 604104 // gas legacy: 644983 -// gas legacyOptimized: 598016 +// gas legacyOptimized: 598012 // partialAssignArray() -// gas irOptimized: 1067376 +// gas irOptimized: 1067372 // gas legacy: 1177356 -// gas legacyOptimized: 1068067 +// gas legacyOptimized: 1068064 // x() -> 11, 22, 33, 44, 55, 66, 77, 88, 99, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -// gas irOptimized: 604108 +// gas irOptimized: 604104 // gas legacy: 644983 -// gas legacyOptimized: 598016 +// gas legacyOptimized: 598012 // clearArray() -// gas irOptimized: 580378 +// gas irOptimized: 580374 // gas legacy: 582973 -// gas legacyOptimized: 581299 +// gas legacyOptimized: 581295 // x() -> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -// gas irOptimized: 604108 +// gas irOptimized: 604104 // gas legacy: 644983 -// gas legacyOptimized: 598016 +// gas legacyOptimized: 598012 diff --git a/test/libsolidity/semanticTests/storage/storage_boundary_packed_array.sol b/test/libsolidity/semanticTests/storage/storage_boundary_packed_array.sol index aa30a2bcac49..f378d0168f88 100644 --- a/test/libsolidity/semanticTests/storage/storage_boundary_packed_array.sol +++ b/test/libsolidity/semanticTests/storage/storage_boundary_packed_array.sol @@ -23,13 +23,13 @@ contract C { // ---- // x() -> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // fillArray() -// gas irOptimized: 254227 +// gas irOptimized: 254859 // gas legacy: 258712 -// gas legacyOptimized: 257258 +// gas legacyOptimized: 258514 // x() -> 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39 // clearArray() // gas irOptimized: 57426 // x() -> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -// gas irOptimized: 48087 +// gas irOptimized: 48663 // gas legacy: 64080 -// gas legacyOptimized: 56602 +// gas legacyOptimized: 57562 diff --git a/test/libsolidity/semanticTests/storage/storage_boundary_struct_array_mixed_types.sol b/test/libsolidity/semanticTests/storage/storage_boundary_struct_array_mixed_types.sol index 444f86286453..0973d8176708 100644 --- a/test/libsolidity/semanticTests/storage/storage_boundary_struct_array_mixed_types.sol +++ b/test/libsolidity/semanticTests/storage/storage_boundary_struct_array_mixed_types.sol @@ -98,75 +98,75 @@ contract C { // ---- // canaryValue() -> 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff // boundaryArray() -> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -// gas irOptimized: 113169 +// gas irOptimized: 113425 // gas legacy: 120742 -// gas legacyOptimized: 112518 +// gas legacyOptimized: 112698 // destArray() -> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -// gas irOptimized: 113078 +// gas irOptimized: 113334 // gas legacy: 120738 -// gas legacyOptimized: 112505 +// gas legacyOptimized: 112685 // fillBoundaryArray() -// gas irOptimized: 912522 +// gas irOptimized: 912672 // gas legacy: 930728 -// gas legacyOptimized: 916628 +// gas legacyOptimized: 916638 // canaryValue() -> 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff // boundaryArray() -> 1, 2, 3, 4, true, 6, 7, 8, 9, true, 11, 12, 13, 14, true, 16, 17, 18, 19, true, 21, 22, 23, 24, true, 26, 27, 28, 29, true, 31, 32, 33, 34, true, 36, 37, 38, 39, true, 41, 42, 43, 44, true, 46, 47, 48, 49, true -// gas irOptimized: 113169 +// gas irOptimized: 113425 // gas legacy: 120742 -// gas legacyOptimized: 112518 +// gas legacyOptimized: 112698 // destArray() -> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -// gas irOptimized: 113078 +// gas irOptimized: 113334 // gas legacy: 120738 -// gas legacyOptimized: 112505 +// gas legacyOptimized: 112685 // copyFromBoundary() -// gas irOptimized: 994579 +// gas irOptimized: 994599 // gas legacy: 1023407 -// gas legacyOptimized: 994746 +// gas legacyOptimized: 994806 // canaryValue() -> 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff // boundaryArray() -> 1, 2, 3, 4, true, 6, 7, 8, 9, true, 11, 12, 13, 14, true, 16, 17, 18, 19, true, 21, 22, 23, 24, true, 26, 27, 28, 29, true, 31, 32, 33, 34, true, 36, 37, 38, 39, true, 41, 42, 43, 44, true, 46, 47, 48, 49, true -// gas irOptimized: 113169 +// gas irOptimized: 113425 // gas legacy: 120742 -// gas legacyOptimized: 112518 +// gas legacyOptimized: 112698 // destArray() -> 1, 2, 3, 4, true, 6, 7, 8, 9, true, 11, 12, 13, 14, true, 16, 17, 18, 19, true, 21, 22, 23, 24, true, 26, 27, 28, 29, true, 31, 32, 33, 34, true, 36, 37, 38, 39, true, 41, 42, 43, 44, true, 46, 47, 48, 49, true -// gas irOptimized: 113078 +// gas irOptimized: 113334 // gas legacy: 120738 -// gas legacyOptimized: 112505 +// gas legacyOptimized: 112685 // fillDestArray() -// gas irOptimized: 200426 +// gas irOptimized: 200576 // gas legacy: 218746 -// gas legacyOptimized: 204648 +// gas legacyOptimized: 204658 // canaryValue() -> 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff // boundaryArray() -> 1, 2, 3, 4, true, 6, 7, 8, 9, true, 11, 12, 13, 14, true, 16, 17, 18, 19, true, 21, 22, 23, 24, true, 26, 27, 28, 29, true, 31, 32, 33, 34, true, 36, 37, 38, 39, true, 41, 42, 43, 44, true, 46, 47, 48, 49, true -// gas irOptimized: 113169 +// gas irOptimized: 113425 // gas legacy: 120742 -// gas legacyOptimized: 112518 +// gas legacyOptimized: 112698 // destArray() -> 51, 52, 53, 54, true, 56, 57, 58, 59, true, 61, 62, 63, 64, true, 66, 67, 68, 69, true, 71, 72, 73, 74, true, 76, 77, 78, 79, true, 81, 82, 83, 84, true, 86, 87, 88, 89, true, 91, 92, 93, 94, true, 96, 97, 98, 99, true -// gas irOptimized: 113078 +// gas irOptimized: 113334 // gas legacy: 120738 -// gas legacyOptimized: 112505 +// gas legacyOptimized: 112685 // copyToBoundary() -// gas irOptimized: 282623 +// gas irOptimized: 282643 // gas legacy: 311362 -// gas legacyOptimized: 282712 +// gas legacyOptimized: 282772 // canaryValue() -> 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff // boundaryArray() -> 51, 52, 53, 54, true, 56, 57, 58, 59, true, 61, 62, 63, 64, true, 66, 67, 68, 69, true, 71, 72, 73, 74, true, 76, 77, 78, 79, true, 81, 82, 83, 84, true, 86, 87, 88, 89, true, 91, 92, 93, 94, true, 96, 97, 98, 99, true -// gas irOptimized: 113169 +// gas irOptimized: 113425 // gas legacy: 120742 -// gas legacyOptimized: 112518 +// gas legacyOptimized: 112698 // destArray() -> 51, 52, 53, 54, true, 56, 57, 58, 59, true, 61, 62, 63, 64, true, 66, 67, 68, 69, true, 71, 72, 73, 74, true, 76, 77, 78, 79, true, 81, 82, 83, 84, true, 86, 87, 88, 89, true, 91, 92, 93, 94, true, 96, 97, 98, 99, true -// gas irOptimized: 113078 +// gas irOptimized: 113334 // gas legacy: 120738 -// gas legacyOptimized: 112505 +// gas legacyOptimized: 112685 // deleteBoundaryArray() // gas irOptimized: 177968 // gas legacy: 180995 -// gas legacyOptimized: 178182 +// gas legacyOptimized: 178126 // canaryValue() -> 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff // boundaryArray() -> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -// gas irOptimized: 113169 +// gas irOptimized: 113425 // gas legacy: 120742 -// gas legacyOptimized: 112518 +// gas legacyOptimized: 112698 // destArray() -> 51, 52, 53, 54, true, 56, 57, 58, 59, true, 61, 62, 63, 64, true, 66, 67, 68, 69, true, 71, 72, 73, 74, true, 76, 77, 78, 79, true, 81, 82, 83, 84, true, 86, 87, 88, 89, true, 91, 92, 93, 94, true, 96, 97, 98, 99, true -// gas irOptimized: 113078 +// gas irOptimized: 113334 // gas legacy: 120738 -// gas legacyOptimized: 112505 +// gas legacyOptimized: 112685 diff --git a/test/libsolidity/semanticTests/storage/storage_boundary_struct_array_multislot.sol b/test/libsolidity/semanticTests/storage/storage_boundary_struct_array_multislot.sol index 05ad53cf0bfa..47f18555a913 100644 --- a/test/libsolidity/semanticTests/storage/storage_boundary_struct_array_multislot.sol +++ b/test/libsolidity/semanticTests/storage/storage_boundary_struct_array_multislot.sol @@ -92,7 +92,7 @@ contract C { // boundaryArray() -> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // destArray() -> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // fillBoundaryArray() -// gas irOptimized: 688719 +// gas irOptimized: 688799 // gas legacy: 700075 // gas legacyOptimized: 691605 // canaryValue() -> 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff @@ -106,7 +106,7 @@ contract C { // boundaryArray() -> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 // destArray() -> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 // fillDestArray() -// gas irOptimized: 175623 +// gas irOptimized: 175703 // gas legacy: 187093 // gas legacyOptimized: 178625 // canaryValue() -> 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff diff --git a/test/libsolidity/semanticTests/storage/storage_boundary_struct_array_packed.sol b/test/libsolidity/semanticTests/storage/storage_boundary_struct_array_packed.sol index 5b4085acf8f9..94b977f03a19 100644 --- a/test/libsolidity/semanticTests/storage/storage_boundary_struct_array_packed.sol +++ b/test/libsolidity/semanticTests/storage/storage_boundary_struct_array_packed.sol @@ -96,16 +96,16 @@ contract C { // boundaryArray() -> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // destArray() -> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // fillBoundaryArray() -// gas irOptimized: 248990 +// gas irOptimized: 248960 // gas legacy: 272856 -// gas legacyOptimized: 253856 +// gas legacyOptimized: 253506 // canaryValue() -> 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff // boundaryArray() -> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 // destArray() -> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // copyFromBoundary() -// gas irOptimized: 274279 +// gas irOptimized: 274469 // gas legacy: 298927 -// gas legacyOptimized: 272256 +// gas legacyOptimized: 272206 // canaryValue() -> 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff // boundaryArray() -> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 // destArray() -> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 @@ -116,9 +116,9 @@ contract C { // destArray() -> 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80 // gas legacy: 59729 // copyToBoundary() -// gas irOptimized: 103323 +// gas irOptimized: 103513 // gas legacy: 127882 -// gas legacyOptimized: 101222 +// gas legacyOptimized: 101172 // canaryValue() -> 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff // boundaryArray() -> 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80 // destArray() -> 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80 diff --git a/test/libsolidity/semanticTests/structs/copy_from_mapping.sol b/test/libsolidity/semanticTests/structs/copy_from_mapping.sol index fccdf0030ffb..0709d171ed40 100644 --- a/test/libsolidity/semanticTests/structs/copy_from_mapping.sol +++ b/test/libsolidity/semanticTests/structs/copy_from_mapping.sol @@ -36,7 +36,7 @@ contract C { } // ---- // to_state() -> 0x20, 0x60, 0xa0, 7, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 -// gas irOptimized: 121282 +// gas irOptimized: 121330 // gas legacy: 125480 // gas legacyOptimized: 121695 // to_storage() -> 0x20, 0x60, 0xa0, 7, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 diff --git a/test/libsolidity/semanticTests/structs/copy_substructures_from_mapping.sol b/test/libsolidity/semanticTests/structs/copy_substructures_from_mapping.sol index 9f0b7cbe64c9..57976248bf83 100644 --- a/test/libsolidity/semanticTests/structs/copy_substructures_from_mapping.sol +++ b/test/libsolidity/semanticTests/structs/copy_substructures_from_mapping.sol @@ -44,7 +44,7 @@ contract C { } // ---- // to_state() -> 0x20, 0x60, 0xa0, 7, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 -// gas irOptimized: 121454 +// gas irOptimized: 121502 // gas legacy: 125617 // gas legacyOptimized: 121699 // to_storage() -> 0x20, 0x60, 0xa0, 7, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 diff --git a/test/libsolidity/semanticTests/structs/copy_substructures_to_mapping.sol b/test/libsolidity/semanticTests/structs/copy_substructures_to_mapping.sol index 3e86495713be..a37ad5ccb3d2 100644 --- a/test/libsolidity/semanticTests/structs/copy_substructures_to_mapping.sol +++ b/test/libsolidity/semanticTests/structs/copy_substructures_to_mapping.sol @@ -52,14 +52,14 @@ contract C { } // ---- // from_memory() -> 0x20, 0x60, 0xa0, 0x15, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 -// gas irOptimized: 122720 +// gas irOptimized: 122792 // gas legacy: 125558 -// gas legacyOptimized: 123322 +// gas legacyOptimized: 123338 // from_state() -> 0x20, 0x60, 0xa0, 21, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 -// gas irOptimized: 121424 +// gas irOptimized: 121472 // gas legacy: 125693 -// gas legacyOptimized: 121804 +// gas legacyOptimized: 121820 // from_calldata((bytes,uint16[],uint16)): 0x20, 0x60, 0xa0, 21, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 -> 0x20, 0x60, 0xa0, 0x15, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 -// gas irOptimized: 114852 +// gas irOptimized: 114908 // gas legacy: 117950 -// gas legacyOptimized: 115526 +// gas legacyOptimized: 115566 diff --git a/test/libsolidity/semanticTests/structs/copy_to_mapping.sol b/test/libsolidity/semanticTests/structs/copy_to_mapping.sol index b31d0e580444..640ab8d0304c 100644 --- a/test/libsolidity/semanticTests/structs/copy_to_mapping.sol +++ b/test/libsolidity/semanticTests/structs/copy_to_mapping.sol @@ -45,18 +45,18 @@ contract C { } // ---- // from_state() -> 0x20, 0x60, 0xa0, 21, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 -// gas irOptimized: 121515 +// gas irOptimized: 121563 // gas legacy: 125554 -// gas legacyOptimized: 121747 +// gas legacyOptimized: 121763 // from_storage() -> 0x20, 0x60, 0xa0, 21, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 -// gas irOptimized: 121559 +// gas irOptimized: 121607 // gas legacy: 125612 -// gas legacyOptimized: 121799 +// gas legacyOptimized: 121815 // from_memory() -> 0x20, 0x60, 0xa0, 21, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 -// gas irOptimized: 122740 +// gas irOptimized: 122812 // gas legacy: 125423 -// gas legacyOptimized: 123323 +// gas legacyOptimized: 123339 // from_calldata((bytes,uint16[],uint16)): 0x20, 0x60, 0xa0, 21, 3, 0x666F6F0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 -> 0x20, 0x60, 0xa0, 21, 3, 0x666f6f0000000000000000000000000000000000000000000000000000000000, 2, 13, 14 -// gas irOptimized: 114824 +// gas irOptimized: 114880 // gas legacy: 118207 -// gas legacyOptimized: 115327 +// gas legacyOptimized: 115359 diff --git a/test/libsolidity/semanticTests/structs/struct_containing_bytes_copy_and_delete.sol b/test/libsolidity/semanticTests/structs/struct_containing_bytes_copy_and_delete.sol index 3912a4655505..27d7df76c19b 100644 --- a/test/libsolidity/semanticTests/structs/struct_containing_bytes_copy_and_delete.sol +++ b/test/libsolidity/semanticTests/structs/struct_containing_bytes_copy_and_delete.sol @@ -23,17 +23,17 @@ contract c { // ---- // storageEmpty -> 1 // set(uint256,bytes,uint256): 12, 0x60, 13, 33, "12345678901234567890123456789012", "3" -> true -// gas irOptimized: 133557 +// gas irOptimized: 133573 // gas legacy: 134624 -// gas legacyOptimized: 133857 +// gas legacyOptimized: 133881 // test(uint256): 32 -> "3" // storageEmpty -> 0 // copy() -> true // storageEmpty -> 1 // set(uint256,bytes,uint256): 12, 0x60, 13, 33, "12345678901234567890123456789012", "3" -> true -// gas irOptimized: 133557 +// gas irOptimized: 133573 // gas legacy: 134624 -// gas legacyOptimized: 133857 +// gas legacyOptimized: 133881 // storageEmpty -> 0 // del() -> true // storageEmpty -> 1 diff --git a/test/libsolidity/semanticTests/structs/struct_delete_storage_nested_small.sol b/test/libsolidity/semanticTests/structs/struct_delete_storage_nested_small.sol index 12cbf0799e04..a913822a2e79 100644 --- a/test/libsolidity/semanticTests/structs/struct_delete_storage_nested_small.sol +++ b/test/libsolidity/semanticTests/structs/struct_delete_storage_nested_small.sol @@ -33,4 +33,4 @@ contract C { // compileViaYul: true // ---- // f() -> 0, 0, 0 -// gas irOptimized: 93835 +// gas irOptimized: 93827 diff --git a/test/libsolidity/semanticTests/structs/struct_delete_storage_with_array.sol b/test/libsolidity/semanticTests/structs/struct_delete_storage_with_array.sol index 7ae78437e408..c050904b3128 100644 --- a/test/libsolidity/semanticTests/structs/struct_delete_storage_with_array.sol +++ b/test/libsolidity/semanticTests/structs/struct_delete_storage_with_array.sol @@ -44,8 +44,8 @@ contract C { // f() -> // gas irOptimized: 113388 // gas legacy: 113583 -// gas legacyOptimized: 113119 +// gas legacyOptimized: 113093 // g() -> -// gas irOptimized: 118768 +// gas irOptimized: 118756 // gas legacy: 118761 -// gas legacyOptimized: 118203 +// gas legacyOptimized: 118188 diff --git a/test/libsolidity/semanticTests/structs/struct_delete_storage_with_arrays_small.sol b/test/libsolidity/semanticTests/structs/struct_delete_storage_with_arrays_small.sol index 1a047049f205..d3b5dd61473e 100644 --- a/test/libsolidity/semanticTests/structs/struct_delete_storage_with_arrays_small.sol +++ b/test/libsolidity/semanticTests/structs/struct_delete_storage_with_arrays_small.sol @@ -27,4 +27,4 @@ contract C { // compileViaYul: true // ---- // f() -> 0 -// gas irOptimized: 89468 +// gas irOptimized: 89472 diff --git a/test/libsolidity/semanticTests/types/mapping/copy_from_mapping_to_mapping.sol b/test/libsolidity/semanticTests/types/mapping/copy_from_mapping_to_mapping.sol index 47fa27fe3c28..39cde6bfbce7 100644 --- a/test/libsolidity/semanticTests/types/mapping/copy_from_mapping_to_mapping.sol +++ b/test/libsolidity/semanticTests/types/mapping/copy_from_mapping_to_mapping.sol @@ -29,6 +29,6 @@ contract C { } // ---- // f() -> 0x20, 7, 8, 9, 0xa0, 13, 2, 0x40, 0xa0, 2, 3, 4, 2, 3, 4 -// gas irOptimized: 197102 +// gas irOptimized: 197182 // gas legacy: 205706 // gas legacyOptimized: 196739 diff --git a/test/libsolidity/semanticTests/userDefinedValueType/calldata.sol b/test/libsolidity/semanticTests/userDefinedValueType/calldata.sol index 63f1ff1dd18e..8b71b005cf92 100644 --- a/test/libsolidity/semanticTests/userDefinedValueType/calldata.sol +++ b/test/libsolidity/semanticTests/userDefinedValueType/calldata.sol @@ -49,13 +49,13 @@ contract C { } // ---- // test_f() -> true -// gas irOptimized: 122114 +// gas irOptimized: 122074 // gas legacy: 126159 -// gas legacyOptimized: 122742 +// gas legacyOptimized: 122674 // test_g() -> true -// gas irOptimized: 106248 +// gas irOptimized: 106176 // gas legacy: 111821 -// gas legacyOptimized: 106591 +// gas legacyOptimized: 106467 // addresses(uint256): 0 -> 0x18 // addresses(uint256): 1 -> 0x19 // addresses(uint256): 3 -> 0x1b diff --git a/test/libsolidity/semanticTests/userDefinedValueType/calldata_to_storage.sol b/test/libsolidity/semanticTests/userDefinedValueType/calldata_to_storage.sol index 0815a2da7ace..597d75e93e8c 100644 --- a/test/libsolidity/semanticTests/userDefinedValueType/calldata_to_storage.sol +++ b/test/libsolidity/semanticTests/userDefinedValueType/calldata_to_storage.sol @@ -23,19 +23,19 @@ contract C { // ---- // s() -> 0, 0, 0x00, 0 // f((uint8,uint16,bytes2,uint8)): 1, 0xff, "ab", 15 -> -// gas irOptimized: 44237 +// gas irOptimized: 44228 // gas legacy: 47154 -// gas legacyOptimized: 44982 +// gas legacyOptimized: 44973 // s() -> 1, 0xff, 0x6162000000000000000000000000000000000000000000000000000000000000, 15 // g(uint16[]): 0x20, 3, 1, 2, 3 -> 0x20, 3, 1, 2, 3 -// gas irOptimized: 68578 +// gas irOptimized: 68610 // gas legacy: 71400 -// gas legacyOptimized: 69139 +// gas legacyOptimized: 69163 // small(uint256): 0 -> 1 // small(uint256): 1 -> 2 // h(bytes2[]): 0x20, 3, "ab", "cd", "ef" -> 0x20, 3, "ab", "cd", "ef" -// gas irOptimized: 68635 +// gas irOptimized: 68586 // gas legacy: 71231 -// gas legacyOptimized: 69289 +// gas legacyOptimized: 69247 // l(uint256): 0 -> 0x6162000000000000000000000000000000000000000000000000000000000000 // l(uint256): 1 -> 0x6364000000000000000000000000000000000000000000000000000000000000 diff --git a/test/libsolidity/semanticTests/userDefinedValueType/erc20.sol b/test/libsolidity/semanticTests/userDefinedValueType/erc20.sol index 5cb2873ab7a4..fd874fa7a5f8 100644 --- a/test/libsolidity/semanticTests/userDefinedValueType/erc20.sol +++ b/test/libsolidity/semanticTests/userDefinedValueType/erc20.sol @@ -125,24 +125,24 @@ contract ERC20 { // gas legacyOptimized: 23367 // transfer(address,uint256): 2, 5 -> true // ~ emit Transfer(address,address,uint256): #0x1212121212121212121212121212120000000012, #0x02, 0x05 -// gas irOptimized: 50997 +// gas irOptimized: 50985 // gas legacy: 52323 -// gas legacyOptimized: 51380 +// gas legacyOptimized: 51360 // decreaseAllowance(address,uint256): 2, 0 -> true // ~ emit Approval(address,address,uint256): #0x1212121212121212121212121212120000000012, #0x02, 0x00 -// gas irOptimized: 26054 +// gas irOptimized: 26038 // gas legacy: 27165 -// gas legacyOptimized: 26320 +// gas legacyOptimized: 26300 // decreaseAllowance(address,uint256): 2, 1 -> FAILURE, hex"4e487b71", 0x11 -// gas irOptimized: 23954 +// gas irOptimized: 23946 // gas legacy: 24500 -// gas legacyOptimized: 24076 +// gas legacyOptimized: 24068 // transfer(address,uint256): 2, 14 -> true // ~ emit Transfer(address,address,uint256): #0x1212121212121212121212121212120000000012, #0x02, 0x0e -// gas irOptimized: 33897 +// gas irOptimized: 33885 // gas legacy: 35223 -// gas legacyOptimized: 34280 +// gas legacyOptimized: 34260 // transfer(address,uint256): 2, 2 -> FAILURE, hex"4e487b71", 0x11 -// gas irOptimized: 23990 +// gas irOptimized: 23978 // gas legacy: 24483 -// gas legacyOptimized: 24072 +// gas legacyOptimized: 24060 diff --git a/test/libsolidity/semanticTests/userDefinedValueType/memory_to_storage.sol b/test/libsolidity/semanticTests/userDefinedValueType/memory_to_storage.sol index 6e07e74e9f71..0da7fa45d591 100644 --- a/test/libsolidity/semanticTests/userDefinedValueType/memory_to_storage.sol +++ b/test/libsolidity/semanticTests/userDefinedValueType/memory_to_storage.sol @@ -23,19 +23,19 @@ contract C { // ---- // s() -> 0, 0, 0x00, 0 // f((uint8,uint16,bytes2,uint8)): 1, 0xff, "ab", 15 -> -// gas irOptimized: 44360 +// gas irOptimized: 44359 // gas legacy: 46189 -// gas legacyOptimized: 44673 +// gas legacyOptimized: 44677 // s() -> 1, 0xff, 0x6162000000000000000000000000000000000000000000000000000000000000, 15 // g(uint16[]): 0x20, 3, 1, 2, 3 -> 0x20, 3, 1, 2, 3 -// gas irOptimized: 68898 +// gas irOptimized: 68938 // gas legacy: 72336 -// gas legacyOptimized: 69607 +// gas legacyOptimized: 69639 // small(uint256): 0 -> 1 // small(uint256): 1 -> 2 // h(bytes2[]): 0x20, 3, "ab", "cd", "ef" -> 0x20, 3, "ab", "cd", "ef" -// gas irOptimized: 68937 +// gas irOptimized: 68896 // gas legacy: 72167 -// gas legacyOptimized: 69802 +// gas legacyOptimized: 69741 // l(uint256): 0 -> 0x6162000000000000000000000000000000000000000000000000000000000000 // l(uint256): 1 -> 0x6364000000000000000000000000000000000000000000000000000000000000 diff --git a/test/libsolidity/semanticTests/various/address_code.sol b/test/libsolidity/semanticTests/various/address_code.sol index eda17b3c2775..f2c13052dcc2 100644 --- a/test/libsolidity/semanticTests/various/address_code.sol +++ b/test/libsolidity/semanticTests/various/address_code.sol @@ -16,11 +16,11 @@ contract C { // bytecodeFormat: legacy // ---- // constructor() -> -// gas irOptimized: 70924 +// gas irOptimized: 70768 // gas irOptimized code: 94600 // gas legacy: 82688 // gas legacy code: 153800 -// gas legacyOptimized: 69675 +// gas legacyOptimized: 69571 // gas legacyOptimized code: 79200 // initCode() -> 0x20, 0 // f() -> true diff --git a/test/libsolidity/semanticTests/various/create_calldata.sol b/test/libsolidity/semanticTests/various/create_calldata.sol index c4d17d4299ca..ce018f5c2f43 100644 --- a/test/libsolidity/semanticTests/various/create_calldata.sol +++ b/test/libsolidity/semanticTests/various/create_calldata.sol @@ -10,10 +10,10 @@ contract C { // bytecodeFormat: legacy // ---- // constructor(): 42 -> -// gas irOptimized: 68387 +// gas irOptimized: 68271 // gas irOptimized code: 69000 // gas legacy: 78348 // gas legacy code: 90200 -// gas legacyOptimized: 68548 +// gas legacyOptimized: 68496 // gas legacyOptimized code: 64600 // s() -> 0x20, 0 diff --git a/test/libsolidity/semanticTests/various/destructuring_assignment.sol b/test/libsolidity/semanticTests/various/destructuring_assignment.sol index 44fcd0f6aaa2..f3c4686b0343 100644 --- a/test/libsolidity/semanticTests/various/destructuring_assignment.sol +++ b/test/libsolidity/semanticTests/various/destructuring_assignment.sol @@ -33,6 +33,6 @@ contract C { } // ---- // f(bytes): 0x20, 0x5, "abcde" -> 0 -// gas irOptimized: 242037 +// gas irOptimized: 242100 // gas legacy: 246685 -// gas legacyOptimized: 242396 +// gas legacyOptimized: 242431 diff --git a/test/libsolidity/semanticTests/various/erc20.sol b/test/libsolidity/semanticTests/various/erc20.sol index 035893ded98c..0bf2f5da0b6e 100644 --- a/test/libsolidity/semanticTests/various/erc20.sol +++ b/test/libsolidity/semanticTests/various/erc20.sol @@ -108,24 +108,24 @@ contract ERC20 { // gas legacyOptimized: 23367 // transfer(address,uint256): 2, 5 -> true // ~ emit Transfer(address,address,uint256): #0x1212121212121212121212121212120000000012, #0x02, 0x05 -// gas irOptimized: 51054 +// gas irOptimized: 51042 // gas legacy: 52073 -// gas legacyOptimized: 51298 +// gas legacyOptimized: 51278 // decreaseAllowance(address,uint256): 2, 0 -> true // ~ emit Approval(address,address,uint256): #0x1212121212121212121212121212120000000012, #0x02, 0x00 -// gas irOptimized: 26087 +// gas irOptimized: 26071 // gas legacy: 26977 -// gas legacyOptimized: 26279 +// gas legacyOptimized: 26259 // decreaseAllowance(address,uint256): 2, 1 -> FAILURE, hex"4e487b71", 0x11 -// gas irOptimized: 23981 +// gas irOptimized: 23973 // gas legacy: 24462 -// gas legacyOptimized: 24056 +// gas legacyOptimized: 24048 // transfer(address,uint256): 2, 14 -> true // ~ emit Transfer(address,address,uint256): #0x1212121212121212121212121212120000000012, #0x02, 0x0e -// gas irOptimized: 33954 +// gas irOptimized: 33942 // gas legacy: 34973 -// gas legacyOptimized: 34198 +// gas legacyOptimized: 34178 // transfer(address,uint256): 2, 2 -> FAILURE, hex"4e487b71", 0x11 -// gas irOptimized: 24020 +// gas irOptimized: 24008 // gas legacy: 24445 -// gas legacyOptimized: 24052 +// gas legacyOptimized: 24040 diff --git a/test/libsolidity/semanticTests/various/skip_dynamic_types_for_structs.sol b/test/libsolidity/semanticTests/various/skip_dynamic_types_for_structs.sol index 1af8a04195a4..96e35ea60ff6 100644 --- a/test/libsolidity/semanticTests/various/skip_dynamic_types_for_structs.sol +++ b/test/libsolidity/semanticTests/various/skip_dynamic_types_for_structs.sol @@ -19,6 +19,6 @@ contract C { } // ---- // g() -> 2, 6 -// gas irOptimized: 178195 +// gas irOptimized: 178243 // gas legacy: 181357 -// gas legacyOptimized: 179055 +// gas legacyOptimized: 179083