Compilers: Principles, Techniques, and Tools, Alfred V. Aho, Monica S. Lam, Ravi Sethi, and Jeffrey D. Ullman, 2006 (Pearson Education) - A classic and comprehensive textbook covering foundational compiler optimizations, including detailed sections on control flow analysis, loop optimizations, and code motion techniques.
MLIR: A Compiler Infrastructure for the End of Moore's Law, Chris Lattner, Mehdi Amini, River Riddle, Albert Cohen, Alan Mycroft, Oleksandr Zinenko, Andy Davis, and Jacques Pienaar, 2021ACM Transactions on Architecture and Code Optimization (TACO), Vol. 18 (Association for Computing Machinery (ACM))DOI: 10.1145/3473551 - Introduces the MLIR framework, explaining its design for representing and optimizing structured control flow through regions and dialects like scf and cf.
Better performance with tf.function, TensorFlow Authors, 2024 (TensorFlow Documentation) - Official guide explaining the use of tf.function for TensorFlow models, including how it handles and optimizes dynamic control flow operations like tf.cond and tf.while_loop during tracing.