ConstMath passes can be inserted after just simplifier passes instead of all passes. This should reduce compile times with large codebases. The default behavior is to insert a ConstMath pass after simplifier passes only within the first ten passes performed by the compiler.
We'll probably want to use these in the future, so keep them around for now.
Now we can easily define different sets of PrimOp rules as they're added to (and removed from) ghc.
Useful for debugging, adding other passes
Avoid panic with ghc-7.6.1
This conditionally handles pretty printing differently, as ghc-7.6 requires that showSDoc takes DynFlags. Hence we lift the pretty function into CoreM, where we can access the DynFlags. As we don't want to pass that into all the collapse functions, we match the function name by constructing it explicitly from its moduleName and occName, which also ensures that matching is not affected by compiler flags.