Skip to content

Commit

Permalink
[SYCL][NATIVECPU] Move pipeline creation to CodeGen (#12854)
Browse files Browse the repository at this point in the history
Fixes post commit failure from #12659.
  • Loading branch information
PietroGhg committed Feb 28, 2024
1 parent 7be96cf commit 77c12c0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
4 changes: 4 additions & 0 deletions clang/lib/CodeGen/BackendUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1087,6 +1087,10 @@ void EmitAssemblyHelper::RunOptimizationPipeline(

if (SYCLNativeCPUBackend) {
llvm::sycl::utils::addSYCLNativeCPUBackendPasses(MPM, MAM, Level);
// Run optimization passes after all the changes we made to the kernels.
// Todo: maybe we could find a set of relevant passes instead of re-running
// the full optimization pipeline.
MPM.addPass(PB.buildPerModuleDefaultPipeline(Level));
}
if (LangOpts.SYCLIsDevice) {
MPM.addPass(SYCLMutatePrintfAddrspacePass());
Expand Down
10 changes: 1 addition & 9 deletions llvm/lib/SYCLLowerIR/PipelineSYCLNativeCPU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
// When NATIVECPU_USE_OCK is set, adds passes from the oneAPI Construction Kit.
//
//===----------------------------------------------------------------------===//
#include "llvm/Passes/OptimizationLevel.h"
#include "llvm/Passes/PassBuilder.h"
#include "llvm/SYCLLowerIR/ConvertToMuxBuiltinsSYCLNativeCPU.h"
#include "llvm/SYCLLowerIR/PrepareSYCLNativeCPU.h"
#include "llvm/SYCLLowerIR/RenameKernelSYCLNativeCPU.h"
Expand All @@ -24,9 +22,9 @@
#include "compiler/utils/prepare_barriers_pass.h"
#include "compiler/utils/sub_group_analysis.h"
#include "compiler/utils/work_item_loops_pass.h"
#include "llvm/Transforms/IPO/AlwaysInliner.h"
#include "vecz/pass.h"
#include "vecz/vecz_target_info.h"
#include "llvm/Transforms/IPO/AlwaysInliner.h"
#endif

using namespace llvm;
Expand Down Expand Up @@ -88,10 +86,4 @@ void llvm::sycl::utils::addSYCLNativeCPUBackendPasses(
MPM.addPass(PrepareSYCLNativeCPUPass());
MPM.addPass(RenameKernelSYCLNativeCPUPass());

// Run optimization passes after all the changes we made to the kernels.
// Todo: check optimization level from clang
// Todo: maybe we could find a set of relevant passes instead of re-running
// the full optimization pipeline.
PassBuilder PB;
MPM.addPass(PB.buildPerModuleDefaultPipeline(OptLevel));
}

0 comments on commit 77c12c0

Please sign in to comment.