Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/triton-shared/Conversion/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ add_subdirectory(TritonToStructured)
add_subdirectory(TritonArithToLinalg)
add_subdirectory(TritonToUnstructured)
add_subdirectory(StructuredToMemref)
add_subdirectory(UnstructuredToMemref)
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#===------------------------------------------------------------------------===#
#
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
#
#===------------------------------------------------------------------------===#

set(LLVM_TARGET_DEFINITIONS Passes.td)
mlir_tablegen(Passes.h.inc -gen-pass-decls --name UnstructuredToMemref)
add_public_tablegen_target(UnstructuredToMemrefConversionPassIncGen)
22 changes: 22 additions & 0 deletions include/triton-shared/Conversion/UnstructuredToMemref/Passes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//===----------------------------------------------------------------------===//
//
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
//
//===----------------------------------------------------------------------===//

#ifndef UNSTRUCTURED_TO_MEMREF_CONVERSION_PASSES_H
#define UNSTRUCTURED_TO_MEMREF_CONVERSION_PASSES_H

#include "triton-shared/Conversion/UnstructuredToMemref/UnstructuredToMemref.h"

namespace mlir {
namespace triton {

#define GEN_PASS_REGISTRATION
#include "triton-shared/Conversion/UnstructuredToMemref/Passes.h.inc"

} // namespace triton
} // namespace mlir

#endif
18 changes: 18 additions & 0 deletions include/triton-shared/Conversion/UnstructuredToMemref/Passes.td
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//===----------------------------------------------------------------------===//
//
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
//
//===----------------------------------------------------------------------===//

#ifndef UNSTRUCTURED_TO_MEMREF_CONVERSION_PASSES
#define UNSTRUCTURED_TO_MEMREF_CONVERSION_PASSES

include "mlir/Pass/PassBase.td"

def UnstructuredToMemref : Pass<"unstructured-to-memref", "mlir::ModuleOp"> {
let summary = "Convert unstructured triton ptr (gather / scatter) to memref";
let constructor = "triton::createUnstructuredToMemrefPass()";
}

#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//===----------------------------------------------------------------------===//
//
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
//
//===----------------------------------------------------------------------===//

#ifndef TRITON_CONVERSION_UNSTRUCTUREDTOMEMREF_UNSTRUCTUREDTOMEMREF_H
#define TRITON_CONVERSION_UNSTRUCTUREDTOMEMREF_UNSTRUCTUREDTOMEMREF_H

#include "mlir/Pass/Pass.h"

namespace mlir {
namespace triton {

std::unique_ptr<OperationPass<ModuleOp>> createUnstructuredToMemrefPass();

} // namespace triton
} // namespace mlir

#endif // TRITON_CONVERSION_UNSTRUCTUREDTOMEMREF_UNSTRUCTUREDTOMEMREF_H
1 change: 1 addition & 0 deletions lib/Conversion/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ add_subdirectory(TritonToStructured)
add_subdirectory(TritonToUnstructured)
add_subdirectory(TritonArithToLinalg)
add_subdirectory(StructuredToMemref)
add_subdirectory(UnstructuredToMemref)
28 changes: 28 additions & 0 deletions lib/Conversion/UnstructuredToMemref/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#===------------------------------------------------------------------------===#
#
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
#
#===------------------------------------------------------------------------===#

add_triton_library(UnstructuredToMemref
UnstructuredToMemrefPass.cpp

DEPENDS
UnstructuredToMemrefConversionPassIncGen

LINK_LIBS PUBLIC
TritonTilingExtIR
MLIRArithDialect
MLIRDialectUtils
MLIRIR
MLIRMathDialect
MLIRPass
MLIRTensorDialect
MLIRTransforms
MLIRSupport
TritonAnalysis
TritonIR
TritonTransforms
TritonSharedAnalysis
)
Loading
Loading