A Unified Framework for Optimality Analysis of Model Predictive Control