Teola: Towards End-to-End Optimization of LLM-based Applications