In Solidity v0.8.13, the intermediate representation (IR) codegen feature has been brought out of the experimental stage. We can now run the compiler with --via-ir flag to enable Yul IR, which makes the compiler generate Yul code before generating the final EVM bytecode.

This has lots of benefits, like enabling powerful optimizations. For example, IR makes x != 0 have the same gas cost as x > 0 (with x being an uint256).

My question is: is there a reason not to use --via-ir all the time? When would I not want to use it?

1 Answer 1


It takes much longer to compile with Yul.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.