Skip to content

Commit 9725f01

Browse files
committed
[GPUToSPIRV] Add all SPIR-V patterns to convert-gpu-to-spirv pass.
This allows for one-shot SPIR-V conversion like `convert-to-llvm`.
1 parent 0c28482 commit 9725f01

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRVPass.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,17 @@
1212
//===----------------------------------------------------------------------===//
1313

1414
#include "mlir/Conversion/GPUToSPIRV/GPUToSPIRVPass.h"
15-
1615
#include "mlir/Conversion/ArithToSPIRV/ArithToSPIRV.h"
16+
#include "mlir/Conversion/ComplexToSPIRV/ComplexToSPIRV.h"
17+
#include "mlir/Conversion/ControlFlowToSPIRV/ControlFlowToSPIRV.h"
1718
#include "mlir/Conversion/FuncToSPIRV/FuncToSPIRV.h"
1819
#include "mlir/Conversion/GPUToSPIRV/GPUToSPIRV.h"
20+
#include "mlir/Conversion/IndexToSPIRV/IndexToSPIRV.h"
21+
#include "mlir/Conversion/MathToSPIRV/MathToSPIRV.h"
1922
#include "mlir/Conversion/MemRefToSPIRV/MemRefToSPIRV.h"
2023
#include "mlir/Conversion/SCFToSPIRV/SCFToSPIRV.h"
24+
#include "mlir/Conversion/TensorToSPIRV/TensorToSPIRV.h"
25+
#include "mlir/Conversion/UBToSPIRV/UBToSPIRV.h"
2126
#include "mlir/Conversion/VectorToSPIRV/VectorToSPIRV.h"
2227
#include "mlir/Dialect/Func/IR/FuncOps.h"
2328
#include "mlir/Dialect/GPU/IR/GPUDialect.h"
@@ -159,6 +164,15 @@ void GPUToSPIRVPass::runOnOperation() {
159164
populateFuncToSPIRVPatterns(typeConverter, patterns);
160165
populateVectorToSPIRVPatterns(typeConverter, patterns);
161166

167+
mlir::populateBuiltinFuncToSPIRVPatterns(typeConverter, patterns);
168+
mlir::populateComplexToSPIRVPatterns(typeConverter, patterns);
169+
mlir::cf::populateControlFlowToSPIRVPatterns(typeConverter, patterns);
170+
mlir::index::populateIndexToSPIRVPatterns(typeConverter, patterns);
171+
mlir::populateMathToSPIRVPatterns(typeConverter, patterns);
172+
mlir::populateTensorToSPIRVPatterns(typeConverter,
173+
/*byteCountThreshold=*/64, patterns);
174+
mlir::ub::populateUBToSPIRVConversionPatterns(typeConverter, patterns);
175+
162176
if (failed(applyFullConversion(gpuModule, *target, std::move(patterns))))
163177
return signalPassFailure();
164178
}

0 commit comments

Comments
 (0)