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
My question is: is there a reason not to use
--via-ir all the time? When would I not want to use it?