Optimization pass reference/guide?

Is there some kind of guide to the various optimization passes? I see
their names in the class list, and the various "createXXX" functions,
but I'm not sure if there are ordering requirements or perhaps unsafe
optimizations.

Hi,

Is there some kind of guide to the various optimization passes? I see
their names in the class list, and the various "createXXX" functions,
but I'm not sure if there are ordering requirements or perhaps unsafe
optimizations.

there are no ordering requirements, in the sense that all passes are
supposed to work correctly regardless of the order they are run in.
Note that "work correctly" doesn't mean "work well", I mean that they
should never do any incorrect transformations no matter what order they
are run in. However several passes only do something useful if some
other pass has been run first, for example most passes need to be run
after mem2reg or sroa in order to be effective.

See also http://llvm.org/docs/Passes.html

Ciao, Duncan.

How can I get from a name of a pass in this document to the
corresponding function/class which performs that pass? Not all the
names seem to easily line up.

Grep (or "git grep" if you're lazy :P). That's the easiest way to find anything.

-Krzysztof