diff --git a/compiler/plugins/target/AMD-AIE/aie/AMDAIECoreToStandard.cpp b/compiler/plugins/target/AMD-AIE/aie/AMDAIECoreToStandard.cpp index efbad0027..0ba5e5d83 100644 --- a/compiler/plugins/target/AMD-AIE/aie/AMDAIECoreToStandard.cpp +++ b/compiler/plugins/target/AMD-AIE/aie/AMDAIECoreToStandard.cpp @@ -17,7 +17,6 @@ #include "mlir/IR/IRMapping.h" #include "mlir/IR/PatternMatch.h" #include "mlir/Pass/Pass.h" -#include "mlir/Tools/mlir-translate/MlirTranslateMain.h" #include "mlir/Transforms/DialectConversion.h" #define DEBUG_TYPE "amdaie-standard-lowering" diff --git a/compiler/plugins/target/AMD-AIE/iree-amd-aie/Target/XCLBinGen.cpp b/compiler/plugins/target/AMD-AIE/iree-amd-aie/Target/XCLBinGen.cpp index 455416f2d..1cfd6bd3d 100644 --- a/compiler/plugins/target/AMD-AIE/iree-amd-aie/Target/XCLBinGen.cpp +++ b/compiler/plugins/target/AMD-AIE/iree-amd-aie/Target/XCLBinGen.cpp @@ -648,29 +648,14 @@ static LogicalResult generateCoreElfFiles( } static LogicalResult generateCDO(MLIRContext *context, AIE::DeviceOp deviceOp, - bool printIRBeforeAll, bool printIRAfterAll, - bool printIRModuleScope, bool timing, const Path &tempDir) { auto copy = cast(deviceOp.getParentOp()->clone()); deviceOp = *copy.getOps().begin(); - std::string errorMessage; - PassManager passManager(context, AIE::DeviceOp::getOperationName()); - applyConfigToPassManager(passManager, printIRBeforeAll, printIRAfterAll, - printIRModuleScope, timing); - passManager.addPass( - mlir::iree_compiler::AMDAIE::createAMDAIEPathfinderPass()); - - if (failed(passManager.run(deviceOp))) { - llvm::errs() << "failed to run passes to prepare for XCLBin generation"; - return failure(); - } - if (failed(mlir::iree_compiler::AMDAIE::AIETranslateToCDODirect( deviceOp, tempDir.string()))) { llvm::errs() << "failed to emit CDO"; return failure(); } - copy->erase(); return success(); } @@ -1164,13 +1149,6 @@ LogicalResult aie2xclbin( const std::string &xclBinInstanceName, const std::string &amdAIEInstallDir, const std::optional &InputXCLBin, const std::optional &ukernel) { - PassManager pm(ctx, AIE::DeviceOp::getOperationName()); - applyConfigToPassManager(pm, printIRBeforeAll, printIRAfterAll, - printIRModuleScope, timing); - if (failed(pm.run(deviceOp))) { - llvm::errs() << ": NPU Instruction pipeline failed"; - return failure(); - } FailureOr> maybeNpuInstructions = getNpuInstructions(deviceOp); @@ -1213,8 +1191,7 @@ LogicalResult aie2xclbin( return failure(); } - if (failed(generateCDO(ctx, deviceOp, printIRBeforeAll, printIRAfterAll, - printIRModuleScope, timing, tempDirPath))) { + if (failed(generateCDO(ctx, deviceOp, tempDirPath))) { llvm::errs() << "Failed to generate CDO\n"; return failure(); } diff --git a/compiler/plugins/target/AMD-AIE/iree-amd-aie/Transforms/Passes.cpp b/compiler/plugins/target/AMD-AIE/iree-amd-aie/Transforms/Passes.cpp index d5243c86d..f1ac91a26 100644 --- a/compiler/plugins/target/AMD-AIE/iree-amd-aie/Transforms/Passes.cpp +++ b/compiler/plugins/target/AMD-AIE/iree-amd-aie/Transforms/Passes.cpp @@ -824,6 +824,7 @@ void addMLIRAIELoweringPasses(OpPassManager &passManager) { devicePM.addPass(createAMDAIENormalizeAddressSpacesPass()); devicePM.addPass(createCanonicalizerPass()); } + } // NOTE: this runs on the top-level program module containing all hal.executable