Difference between yul : true and viaIR : true #4099
-
I have always used But it is not clearly explained in the solidity configuration documentation.
So, how should be enabled the yul optimizer:
or with the input JSON format
I tried the second one( version |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Yeah, I think My understanding of that comment is that you can use @cameel sorry for the tag, but could you clarify what this means? |
Beta Was this translation helpful? Give feedback.
-
Sure, not problem.
So, basically, if you want fully optimized Yul output, you need both. If you only use |
Beta Was this translation helpful? Give feedback.
Sure, not problem.
viaIR
enables the new code generation pipeline. So this makes the compiler first generate Yul and only then EVM bytecode (rather than going straight from Solidity to EVM assembly).optimizer.details.yul
enables Yul optimizer, which affects Yul generated by the new pipeline but also Yul generated in any other circumstances. For example you can requestirOptimized
output even when using the legacy code generation pipeline - that output will be passed through the Yul optimizer when it is enabled. Also, some language features, even in the legacy pipeline, are generated from Yul code - e.g. anything that uses abicoder v2.So, basically, if you want fully optimized Yul output…