One of the most important factors affecting fuel efficiency and emissions of automotive engines is combustion quality that is usually controlled by managing spark advance (SA) in spark ignition (SI) engines. With increasing sensing capabilities and enhancements in on-board computation capability, online learning and optimization techniques have been the subject of significant research interest. This article surveys the literature of learning and optimization algorithms with applications to combustion quality optimization and control of SI engines. In particular, this paper reviews extremum seeking control algorithms for iterative solution of online optimization problems, stochastic threshold control algorithms for iterative solution of probability control of stochastic knock event, as well as feedforward learning algorithms for iterative solution of operating-point-dependent feedforward adaptation problems. Finally, two experimental case studies including knock probabilistic constrained optimal combustion control and on-board map learning-based combustion control are carried out on an SI gasoline engine.