Imperative languages have a strong concept of constant folding and some pretty advanced control-flow-graph based optimizations. Functional languages have similar optimization options.
Unused Value Optimization
Consider the following code
tail (a . b)
In this code two expressions are put into a cons cell. However only the tail element escapes the expression. This is a great candidate for simple optimization. In a stack based representation you might compile this code in two ways.
Unoptimized Representation
push a
push b
cons
tail
Optimized Representation
a
b
Conclusion
This optimized version removes the creation of the cons cell and the call to the tail function. It also completely removes stack interaction. This demonstrates how simple functional paradigms can be optimized using simple heuristics without the need for control-flow graphs.