Improve optimization:
* Add function-level optimization at the end of lowering to reduce memory usage and enhance final code quality.
Add dump for function-level optimized IR at the end of lowering
Merge pull request #566 from sklam/improve_optimization

Improve LLVM optimization