Author here! It's been so unbelievably gratifying seeing how many people this book resonates with.
* Compilers, Principles, and Tools (the Dragon Book)
* Engineering a Compiler
You can skim a lot of the Dragon Book, but it will introduce you to a lot of the basics around type checking and generating code. Then Engineering a Compiler (which roughly assumes you have some familiarity with compilers already) does a very good job of walking through all of the key algorithms behind control flow analysis, register allocation, instruction selection, optimization, etc.
https://mitpress.mit.edu/9780262047760/essentials-of-compila...