[clang-tidy][NFC]remove deps of clang in clang tidy test (#116588)
[llvm-project.git] / mlir / test / lib / Pass / TestSPIRVCPURunnerPipeline.cpp
blobbf2880aa022eed802082235c0c6af5bbc4340e61
1 //===------------------ TestSPIRVCPURunnerPipeline.cpp --------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // Implements a pipeline for use by SPIR-V CPU Runner tests.
11 //===----------------------------------------------------------------------===//
13 #include "mlir/Conversion/GPUToSPIRV/GPUToSPIRVPass.h"
14 #include "mlir/Conversion/SPIRVToLLVM/SPIRVToLLVMPass.h"
15 #include "mlir/Dialect/GPU/Transforms/Passes.h"
16 #include "mlir/Dialect/SPIRV/IR/SPIRVOps.h"
17 #include "mlir/Dialect/SPIRV/Transforms/Passes.h"
18 #include "mlir/Pass/PassManager.h"
20 using namespace mlir;
22 namespace {
24 void buildTestSPIRVCPURunnerPipeline(OpPassManager &passManager) {
25 passManager.addPass(createGpuKernelOutliningPass());
26 passManager.addPass(createConvertGPUToSPIRVPass(/*mapMemorySpace=*/true));
28 OpPassManager &nestedPM = passManager.nest<spirv::ModuleOp>();
29 nestedPM.addPass(spirv::createSPIRVLowerABIAttributesPass());
30 nestedPM.addPass(spirv::createSPIRVUpdateVCEPass());
31 passManager.addPass(createLowerHostCodeToLLVMPass());
32 passManager.addPass(createConvertSPIRVToLLVMPass());
35 } // namespace
37 namespace mlir {
38 namespace test {
39 void registerTestSPIRVCPURunnerPipeline() {
40 PassPipelineRegistration<>(
41 "test-spirv-cpu-runner-pipeline",
42 "Runs a series of passes for lowering SPIR-V-dialect MLIR to "
43 "LLVM-dialect MLIR intended for SPIR-V CPU Runner tests.",
44 buildTestSPIRVCPURunnerPipeline);
46 } // namespace test
47 } // namespace mlir