Every Compiler has two parts:
1. Front end (lexical analysis, parsing)
1.5 Optimizer (Optimizing abstract syntax tree)
2. Back end (machine code generation)
Front end (e.g. Clang) takes the source code and generates abstract syntax tree (LLVM IR).
Optimizer takes the LLVM IR and generates more optimized code using dead code elimination, constant propagation and other techniques ( Optimizing compiler ).
The back end takes optimzed IR and generates machine code specific to CPU ( X86, PowerPC, ARM ).