Skip to content

Commit ce79ed2

Browse files
committed
add debug prints
1 parent d8d7b19 commit ce79ed2

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

mlir/lib/Passes/Patterns/GateDecompositionPattern.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,20 @@ struct GateDecompositionPattern final
112112
}
113113
}
114114
}
115+
116+
llvm::errs() << "Found series (" << series.complexity << "): ";
117+
for (auto&& gate : series.gates) {
118+
llvm::errs() << gate.op->getName().stripDialect().str() << ", ";
119+
}
120+
115121
if (!bestSequence) {
116122
return mlir::failure();
117123
}
124+
llvm::errs() << "\nDecomposition (" << bestSequence->complexity() << "): ";
125+
for (auto&& gate : bestSequence->gates) {
126+
llvm::errs() << qc::toString(gate.type) << ", ";
127+
}
128+
llvm::errs() << "\n";
118129
// only accept new sequence if it shortens existing series by more than two
119130
// gates; this prevents an oscillation with phase gates
120131
if (bestSequence->complexity() + 2 >= series.complexity) {

0 commit comments

Comments
 (0)