reorder passes, reduce the number of AST walks