[mlir][transform] Create GPU transform dialect
authorGuray Ozen <guray.ozen@gmail.com>
Mon, 3 Oct 2022 07:56:42 +0000 (09:56 +0200)
committerGuray Ozen <guray.ozen@gmail.com>
Tue, 4 Oct 2022 11:09:08 +0000 (13:09 +0200)
commit89bb0cae46f85bdfb04075b24f75064864708e78
treeaab039a42f9160e59e633e7817d57ba3bc758713
parent491ac8f3e81c5b6ecd364b560960cd63dccd3df7
[mlir][transform] Create GPU transform dialect

This revision adds GPU transform dialect. It also introduce a prefix such as "transform.gpu" for all ops related to this dialect.

MLIR already had two GPU transform op in linalg. This revision moves these ops into GPUTransformOps. The Ops are as follows:

`transform.structured.map_nested_foreach_thread_to_gpu_blocks`  -> `transform.gpu.map_foreach_to_blocks`
This op selects the outermost (toplevel) foreach_thread and parallelize across GPU blocks. It can also generate `gpu_launch`.

`transform.structured.map_nested_foreach_thread_to_gpu_threads` -> `transform.gpu.map_nested_foreach_to_threads`
This op parallelizes nested foreach_thread that are inside `gpu_launch` across GPU threads.

It doesn't add new functionality, but there are some minor refactoring of the code.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D134800
13 files changed:
mlir/include/mlir/Dialect/GPU/CMakeLists.txt
mlir/include/mlir/Dialect/GPU/TransformOps/CMakeLists.txt [new file with mode: 0644]
mlir/include/mlir/Dialect/GPU/TransformOps/GPUTransformOps.h [new file with mode: 0644]
mlir/include/mlir/Dialect/GPU/TransformOps/GPUTransformOps.td [new file with mode: 0644]
mlir/include/mlir/Dialect/Linalg/TransformOps/LinalgTransformOps.td
mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
mlir/include/mlir/InitAllDialects.h
mlir/lib/Dialect/GPU/CMakeLists.txt
mlir/lib/Dialect/GPU/TransformOps/CMakeLists.txt [new file with mode: 0644]
mlir/lib/Dialect/GPU/TransformOps/GPUTransformOps.cpp [new file with mode: 0644]
mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp
mlir/test/Dialect/GPU/transform-gpu.mlir [moved from mlir/test/Dialect/Linalg/transform-gpu.mlir with 92% similarity]
utils/bazel/llvm-project-overlay/mlir/BUILD.bazel