I'm collecting information about compiler optimizations for which it
is very hard (not intuitive) to find good heuristics which decide if
and where the optimization should be applied.

The first four optimizations that come into my mind are function
inlining, loop unrolling, instruction scheduling and register
allocation. They have all in common that a) they can heavily interact
with other optimizations and b) they might be dependent on the
underlying architecture. Thus, a general and simple heuristic working
fine with other optimizations and on any target processor can be
hardly found.

Do you know any other compiler optimizations for which the same
problem with constructing good heuristics arises?