Commit f5c3cebe authored by Paul's avatar Paul
Browse files

Add more verbose tracing

parent 7bfc9422
...@@ -286,16 +286,18 @@ void find_matches(module& mod, instruction_ref ins, Ms&&... ms) ...@@ -286,16 +286,18 @@ void find_matches(module& mod, instruction_ref ins, Ms&&... ms)
#if !defined(__GNUC__) || defined(__clang__) || __GNUC__ > 5 #if !defined(__GNUC__) || defined(__clang__) || __GNUC__ > 5
const const
#endif #endif
bool trace = enabled(MIGRAPHX_TRACE_MATCHES{}); int trace = value_of(MIGRAPHX_TRACE_MATCHES{});
bool match = false; bool match = false;
each_args( each_args(
[&](auto&& m) { [&](auto&& m) {
if(match) if(match)
return; return;
if(trace > 1)
std::cout << "Match: " << get_type_name(m) << std::endl;
auto r = match_instruction(mod, ins, m.matcher()); auto r = match_instruction(mod, ins, m.matcher());
if(r.result == mod.end()) if(r.result == mod.end())
return; return;
if(trace) if(trace > 0)
{ {
std::cout << "Matched by " << get_type_name(m) << std::endl; std::cout << "Matched by " << get_type_name(m) << std::endl;
mod.debug_print(ins); mod.debug_print(ins);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment