Commit fba4f3e5 authored by Nguyen, Thien Minh's avatar Nguyen, Thien Minh
Browse files

Re-enable heuristic looping of optimization passes



Signed-off-by: default avatarThien Nguyen <nguyentm@ornl.gov>
parent e853ddd2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -79,12 +79,12 @@ TEST(qasm3PassManagerTester, checkRemoveUnusedQirCalls) {
  const std::string src = R"#(OPENQASM 3;
include "qelib1.inc";
qubit q[2];
cx q[0], q[1];
h q[0];
z q[0];
h q[0];
x q[0];
cx q[0], q[1];
cx q[0], q[1];
)#";
  auto llvm =
      qcor::mlir_compile("qasm3", src, "test_kernel", qcor::OutputType::LLVMIR, false);
+10 −8
Original line number Diff line number Diff line
@@ -12,6 +12,8 @@ namespace qcor {
void configureOptimizationPasses(mlir::PassManager &passManager) {
  // TODO: configure the pass pipeline to handle repeated applications of passes.
  // Add passes
  constexpr int N_REPS = 5;
  for (int i = 0; i < N_REPS; ++i) {
    // Simple Identity pair removals
    passManager.addPass(std::make_unique<SingleQubitIdentityPairRemovalPass>());
    passManager.addPass(std::make_unique<CNOTIdentityPairRemovalPass>());
@@ -20,7 +22,7 @@ void configureOptimizationPasses(mlir::PassManager &passManager) {
    passManager.addPass(std::make_unique<RotationMergingPass>());
    // General gate sequence re-synthesize
    passManager.addPass(std::make_unique<SingleQubitGateMergingPass>());

  }

  // Remove dead code
  passManager.addPass(std::make_unique<RemoveUnusedQIRCallsPass>());