| 136 | } |
| 137 | |
| 138 | virtual void run_pass(const pass& p) override |
| 139 | { |
| 140 | if(is_pass_disabled(p.name())) |
| 141 | return; |
| 142 | trace("Pass: ", p.name()); |
| 143 | assert(mod); |
| 144 | assert(mod->validate() == mod->end()); |
| 145 | try_and_dump_on_error(p, [&] { |
| 146 | if(enabled(MIGRAPHX_TIME_PASSES{})) |
| 147 | { |
| 148 | using milliseconds = std::chrono::duration<double, std::milli>; |
| 149 | auto ms = time<milliseconds>([&] { p.apply(*this); }); |
| 150 | std::cout << p.name() << ": " << ms << "ms\n"; |
| 151 | } |
| 152 | else |
| 153 | { |
| 154 | p.apply(*this); |
| 155 | } |
| 156 | }); |
| 157 | trace(*mod); |
| 158 | validate_pass(*mod, p, *t); |
| 159 | } |
| 160 | |
| 161 | static void sanitize(std::string& s) |
| 162 | { |
no test coverage detected