From b5bc33dfdcc859d667466fe65a7b1cba9c0e2ed3 Mon Sep 17 00:00:00 2001 From: makslevental Date: Mon, 19 Aug 2024 13:42:40 -0500 Subject: [PATCH] use iree's path escaping --- cmake/iree_aie_rt.cmake | 1 - .../AMD-AIE/iree-amd-aie/Transforms/Passes.cpp | 18 +++++------------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/cmake/iree_aie_rt.cmake b/cmake/iree_aie_rt.cmake index 5766d7c43..96b9791d2 100644 --- a/cmake/iree_aie_rt.cmake +++ b/cmake/iree_aie_rt.cmake @@ -38,7 +38,6 @@ iree_install_targets( # aie-rt # ############################################################################## -#set(common_DIR ${CMAKE_CURRENT_LIST_DIR}) set(_aie_rt_source_dir ${IREE_AMD_AIE_SOURCE_DIR}/third_party/aie-rt) set(_AIE_RT_BINARY_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/iree_aie_runtime/include) 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 05b3fc400..b4a0e502d 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 @@ -6,9 +6,6 @@ #include "iree-amd-aie/Transforms/Passes.h" -#include -#include - #include "aie/Passes.h" #include "aievec/Passes.h" #include "air/Conversion/Passes.h" @@ -17,6 +14,7 @@ #include "iree-dialects/Dialect/LinalgTransform/Passes.h" #include "iree/compiler/Codegen/Common/Passes.h" #include "iree/compiler/Utils/PassUtils.h" +#include "iree/compiler/Utils/ToolUtils.h" #include "mlir/Conversion/AffineToStandard/AffineToStandard.h" #include "mlir/Conversion/ArithToLLVM/ArithToLLVM.h" #include "mlir/Conversion/ControlFlowToLLVM/ControlFlowToLLVM.h" @@ -308,11 +306,8 @@ void addPackPeelBasedPassPipeline(OpPassManager &funcPassManager, // Lower to UKernels. { AMDAIELowerToUKernelsOptions options; - std::filesystem::path pathToUkernels = clPathToUkernels.getValue(); - // quote for windows paths like `C:/Program Files` - std::stringstream ss; - ss << pathToUkernels.make_preferred(); - ss >> std::quoted(options.pathToUkernels); + // windows + options.pathToUkernels = escapeCommandLineComponent(clPathToUkernels); funcPassManager.addPass(createAMDAIELowerToUKernelsPass(options)); } @@ -419,11 +414,8 @@ void addPadPackBasedPassPipeline(OpPassManager &funcPassManager, // Lower to UKernels { AMDAIELowerToUKernelsOptions options; - std::filesystem::path pathToUkernels = clPathToUkernels.getValue(); - // quote for windows paths like `C:/Program Files` - std::stringstream ss; - ss << pathToUkernels.make_preferred(); - ss >> std::quoted(options.pathToUkernels); + // windows + options.pathToUkernels = escapeCommandLineComponent(clPathToUkernels); funcPassManager.addPass(createAMDAIELowerToUKernelsPass(options)); } // Vectorization passes