Commit 40225196 authored by Mccaskey, Alex's avatar Mccaskey, Alex
Browse files

more cleanup

parent 7c4ed0da
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2,3 +2,4 @@
#define QCOR_LIB_SUFFIX "${CMAKE_SHARED_LIBRARY_SUFFIX}"
#define QCOR_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}"
#define XACC_ROOT "${XACC_ROOT}"
#define LLVM_ROOT "${LLVM_INSTALL_PREFIX}"
+1 −1
Original line number Diff line number Diff line
@@ -129,7 +129,7 @@ void Qasm3SyntaxHandler::GetReplacement(Preprocessor &PP, Declarator &D,
  std::vector<std::string> unique_f_names{kernel_name};
  mlir::PassManager pm(&context);
  applyPassManagerCLOptions(pm);
  pm.addPass(std::make_unique<qcor::QuantumToLLVMLoweringPass>(unique_f_names));
  pm.addPass(std::make_unique<qcor::QuantumToLLVMLoweringPass>(true, unique_f_names));
  auto module_op = (*module).getOperation();
  if (mlir::failed(pm.run(module_op))) {
    std::cout << "Pass Manager Failed\n";
+18 −16
Original line number Diff line number Diff line
@@ -62,8 +62,8 @@ const std::string mlir_compile(const std::string &src_language_type,

  // Create the PassManager for lowering to LLVM MLIR and run it
  mlir::PassManager pm(&context);
  pm.addPass(
      std::make_unique<qcor::QuantumToLLVMLoweringPass>(unique_function_names));
  pm.addPass(std::make_unique<qcor::QuantumToLLVMLoweringPass>(
      true, unique_function_names));
  auto module_op = (*module).getOperation();
  if (mlir::failed(pm.run(module_op))) {
    std::cout << "Pass Manager Failed\n";
@@ -151,8 +151,8 @@ int execute(const std::string &src_language_type, const std::string &src,

  // Create the PassManager for lowering to LLVM MLIR and run it
  mlir::PassManager pm(&context);
  pm.addPass(
      std::make_unique<qcor::QuantumToLLVMLoweringPass>(unique_function_names));
  pm.addPass(std::make_unique<qcor::QuantumToLLVMLoweringPass>(
      true, unique_function_names));
  auto module_op = (*module).getOperation();
  if (mlir::failed(pm.run(module_op))) {
    std::cout << "Pass Manager Failed\n";
@@ -183,9 +183,12 @@ int execute(const std::string &src_language_type, const std::string &src,
      std::vector<std::string>{
          std::string(QCOR_INSTALL_DIR) + std::string("/lib/libqir-qrt") +
              std::string(QCOR_LIB_SUFFIX),
          "/usr/local/aideqc/llvm/lib/libLLVMAnalysis.so",
          "/usr/local/aideqc/llvm/lib/libLLVMInstrumentation.so",
          "/usr/local/aideqc/llvm/lib/libLLVMX86CodeGen.so"});
          std::string(LLVM_ROOT) + std::string("/lib/libLLVMAnalysis") +
              std::string(QCOR_LIB_SUFFIX),
          std::string(LLVM_ROOT) + std::string("/lib/libLLVMInstrumentation") +
              std::string(QCOR_LIB_SUFFIX),
          std::string(LLVM_ROOT) + std::string("/lib/libLLVMX86CodeGen") +
              std::string(QCOR_LIB_SUFFIX)});

  std::vector<std::string> argv;
  std::vector<char *> cstrs;
@@ -246,8 +249,8 @@ int execute(const std::string &src_language_type, const std::string &src,

  // Create the PassManager for lowering to LLVM MLIR and run it
  mlir::PassManager pm(&context);
  pm.addPass(
      std::make_unique<qcor::QuantumToLLVMLoweringPass>(unique_function_names));
  pm.addPass(std::make_unique<qcor::QuantumToLLVMLoweringPass>(
      true, unique_function_names));
  auto module_op = (*module).getOperation();
  if (mlir::failed(pm.run(module_op))) {
    std::cout << "Pass Manager Failed\n";
@@ -279,10 +282,9 @@ int execute(const std::string &src_language_type, const std::string &src,
  // Compile the LLVM module, this is basically
  // just building up the LLVM JIT engine and
  // loading all seen function pointers
  jit.jit_compile(
      std::move(llvmModule),
      std::vector<std::string>{
          std::string(QCOR_INSTALL_DIR) + std::string("/lib/libqir-qrt") +
  jit.jit_compile(std::move(llvmModule),
                  std::vector<std::string>{std::string(QCOR_INSTALL_DIR) +
                                           std::string("/lib/libqir-qrt") +
                                           std::string(QCOR_LIB_SUFFIX)});

  std::vector<std::string> argv;
+0 −1
Original line number Diff line number Diff line
@@ -95,7 +95,6 @@ int main(int argc, char **argv) {
  llvm::cl::ParseCommandLineOptions(argc, argv,
                                    "qcor quantum assembly compiler\n");
  bool qoptimizations = mlir_quantum_opt;
  std::cout << "TURN ON OPTIMS: " << qoptimizations << "\n";
  mlir::MLIRContext context;
  context.loadDialect<mlir::quantum::QuantumDialect, mlir::AffineDialect,
                      mlir::scf::SCFDialect, mlir::StandardOpsDialect>();