Add dump for function-level optimized IR at the end of lowering