Skip to content
This repository was archived by the owner on Nov 27, 2025. It is now read-only.

Commit 02d0198

Browse files
committed
EISW-170058 Add CMake option to conditionally enable VectorToXeGPU conversion
1 parent 92a2cb5 commit 02d0198

File tree

9 files changed

+32
-14
lines changed

9 files changed

+32
-14
lines changed

mlir/include/mlir/Conversion/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,10 @@ add_public_tablegen_target(MLIRConversionPassIncGen)
77

88
add_mlir_doc(Passes ConversionPasses ./ -gen-pass-doc)
99

10+
if(MLIR_CONVERSION_TOSATOTENSOR_ENABLE)
11+
add_subdirectory(TosaToTensor)
12+
endif()
13+
if(MLIR_DIALECT_XEGPU_ENABLE)
14+
add_subdirectory(VectorToXeGPU)
15+
endif()
1016
add_subdirectory(ConvertToLLVM)

mlir/include/mlir/Conversion/Passes.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@
7979
#include "mlir/Conversion/VectorToLLVM/ConvertVectorToLLVMPass.h"
8080
#include "mlir/Conversion/VectorToSCF/VectorToSCF.h"
8181
#include "mlir/Conversion/VectorToSPIRV/VectorToSPIRVPass.h"
82+
#ifdef MLIR_DIALECT_XEGPU_ENABLE
8283
#include "mlir/Conversion/VectorToXeGPU/VectorToXeGPU.h"
84+
#endif
8385

8486
namespace mlir {
8587

mlir/include/mlir/Conversion/Passes.td

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1464,6 +1464,7 @@ def ConvertVectorToSPIRV : Pass<"convert-vector-to-spirv"> {
14641464
// VectorToXeGPU
14651465
//===----------------------------------------------------------------------===//
14661466

1467+
#ifdef MLIR_DIALECT_XEGPU_ENABLE
14671468
def ConvertVectorToXeGPU : Pass<"convert-vector-to-xegpu"> {
14681469
let summary = "Lower the operations from the vector dialect into the XeGPU "
14691470
"dialect";
@@ -1473,5 +1474,6 @@ def ConvertVectorToXeGPU : Pass<"convert-vector-to-xegpu"> {
14731474
"vector::VectorDialect", "xegpu::XeGPUDialect"
14741475
];
14751476
}
1477+
#endif
14761478

14771479
#endif // MLIR_CONVERSION_PASSES

mlir/lib/Conversion/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,6 @@ add_subdirectory(VectorToGPU)
7070
add_subdirectory(VectorToLLVM)
7171
add_subdirectory(VectorToSCF)
7272
add_subdirectory(VectorToSPIRV)
73-
add_subdirectory(VectorToXeGPU)
73+
if(MLIR_DIALECT_XEGPU_ENABLE)
74+
add_subdirectory(VectorToXeGPU)
75+
endif()
Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
add_mlir_conversion_library(MLIRVectorToXeGPU
2-
VectorToXeGPU.cpp
1+
if(MLIR_DIALECT_XEGPU_ENABLE)
2+
add_mlir_conversion_library(MLIRVectorToXeGPU
3+
VectorToXeGPU.cpp
34

4-
ADDITIONAL_HEADER_DIRS
5-
${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/VectorToXeGPU
5+
ADDITIONAL_HEADER_DIRS
6+
${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/VectorToXeGPU
67

7-
DEPENDS
8-
MLIRConversionPassIncGen
8+
DEPENDS
9+
MLIRConversionPassIncGen
910

10-
LINK_LIBS PUBLIC
11-
MLIRArithDialect
12-
MLIRMemRefDialect
13-
MLIRTransforms
14-
MLIRVectorDialect
15-
MLIRXeGPUDialect
16-
)
11+
LINK_LIBS PUBLIC
12+
MLIRArithDialect
13+
MLIRMemRefDialect
14+
MLIRTransforms
15+
MLIRVectorDialect
16+
MLIRXeGPUDialect
17+
)
18+
endif()

mlir/test/Conversion/VectorToXeGPU/load-to-xegpu.mlir

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// REQUIRES: xegpu-dialect-enabled
12
// RUN: mlir-opt %s -convert-vector-to-xegpu -split-input-file | FileCheck %s
23

34
func.func @load_1D_vector(%source: memref<8x16x32xf32>, %offset: index) -> vector<8xf32> {

mlir/test/Conversion/VectorToXeGPU/store-to-xegpu.mlir

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// REQUIRES: xegpu-dialect-enabled
12
// RUN: mlir-opt %s -convert-vector-to-xegpu -split-input-file | FileCheck %s
23

34
func.func @store_1D_vector(%vec: vector<8xf32>,

mlir/test/Conversion/VectorToXeGPU/transfer-read-to-xegpu.mlir

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// REQUIRES: xegpu-dialect-enabled
12
// RUN: mlir-opt %s -convert-vector-to-xegpu -split-input-file | FileCheck %s
23

34
func.func @load_1D_vector(%source: memref<8x16x32xf32>, %offset: index) -> vector<8xf32> {

mlir/test/Conversion/VectorToXeGPU/transfer-write-to-xegpu.mlir

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// REQUIRES: xegpu-dialect-enabled
12
// RUN: mlir-opt %s -convert-vector-to-xegpu -split-input-file | FileCheck %s
23

34
func.func @store_1D_vector(%vec: vector<8xf32>,

0 commit comments

Comments
 (0)