diff --git a/clang/docs/tools/clang-formatted-files.txt b/clang/docs/tools/clang-formatted-files.txt --- a/clang/docs/tools/clang-formatted-files.txt +++ b/clang/docs/tools/clang-formatted-files.txt @@ -7721,9 +7721,9 @@ mlir/include/mlir/Dialect/Quant/QuantTypes.h mlir/include/mlir/Dialect/Quant/UniformSupport.h mlir/include/mlir/Dialect/SCF/BufferizableOpInterfaceImpl.h -mlir/include/mlir/Dialect/SCF/Passes.h -mlir/include/mlir/Dialect/SCF/SCF.h -mlir/include/mlir/Dialect/SCF/Transforms.h +mlir/include/mlir/Dialect/SCF/Transforms/Passes.h +mlir/include/mlir/Dialect/SCF/IR/SCF.h +mlir/include/mlir/Dialect/SCF/Transforms/Transforms.h mlir/include/mlir/Dialect/SCF/Utils/AffineCanonicalizationUtils.h mlir/include/mlir/Dialect/SCF/Utils/Utils.h mlir/include/mlir/Dialect/Shape/IR/Shape.h diff --git a/flang/lib/Optimizer/Transforms/AffineDemotion.cpp b/flang/lib/Optimizer/Transforms/AffineDemotion.cpp --- a/flang/lib/Optimizer/Transforms/AffineDemotion.cpp +++ b/flang/lib/Optimizer/Transforms/AffineDemotion.cpp @@ -25,7 +25,7 @@ #include "mlir/Dialect/Affine/Utils.h" #include "mlir/Dialect/Func/IR/FuncOps.h" #include "mlir/Dialect/MemRef/IR/MemRef.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/IR/BuiltinAttributes.h" #include "mlir/IR/IntegerSet.h" #include "mlir/IR/Visitors.h" diff --git a/flang/lib/Optimizer/Transforms/AffinePromotion.cpp b/flang/lib/Optimizer/Transforms/AffinePromotion.cpp --- a/flang/lib/Optimizer/Transforms/AffinePromotion.cpp +++ b/flang/lib/Optimizer/Transforms/AffinePromotion.cpp @@ -22,7 +22,7 @@ #include "flang/Optimizer/Transforms/Passes.h" #include "mlir/Dialect/Affine/IR/AffineOps.h" #include "mlir/Dialect/Func/IR/FuncOps.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/IR/BuiltinAttributes.h" #include "mlir/IR/IntegerSet.h" #include "mlir/IR/Visitors.h" diff --git a/flang/lib/Optimizer/Transforms/ArrayValueCopy.cpp b/flang/lib/Optimizer/Transforms/ArrayValueCopy.cpp --- a/flang/lib/Optimizer/Transforms/ArrayValueCopy.cpp +++ b/flang/lib/Optimizer/Transforms/ArrayValueCopy.cpp @@ -18,7 +18,7 @@ #include "flang/Optimizer/Support/FIRContext.h" #include "flang/Optimizer/Transforms/Passes.h" #include "mlir/Dialect/ControlFlow/IR/ControlFlowOps.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Transforms/DialectConversion.h" #include "llvm/Support/Debug.h" diff --git a/mlir/examples/toy/Ch6/mlir/LowerToLLVM.cpp b/mlir/examples/toy/Ch6/mlir/LowerToLLVM.cpp --- a/mlir/examples/toy/Ch6/mlir/LowerToLLVM.cpp +++ b/mlir/examples/toy/Ch6/mlir/LowerToLLVM.cpp @@ -39,7 +39,7 @@ #include "mlir/Dialect/Func/IR/FuncOps.h" #include "mlir/Dialect/LLVMIR/LLVMDialect.h" #include "mlir/Dialect/MemRef/IR/MemRef.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Pass/Pass.h" #include "mlir/Transforms/DialectConversion.h" #include "llvm/ADT/Sequence.h" diff --git a/mlir/examples/toy/Ch7/mlir/LowerToLLVM.cpp b/mlir/examples/toy/Ch7/mlir/LowerToLLVM.cpp --- a/mlir/examples/toy/Ch7/mlir/LowerToLLVM.cpp +++ b/mlir/examples/toy/Ch7/mlir/LowerToLLVM.cpp @@ -39,7 +39,7 @@ #include "mlir/Dialect/Func/IR/FuncOps.h" #include "mlir/Dialect/LLVMIR/LLVMDialect.h" #include "mlir/Dialect/MemRef/IR/MemRef.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Pass/Pass.h" #include "mlir/Transforms/DialectConversion.h" #include "llvm/ADT/Sequence.h" diff --git a/mlir/include/mlir/Dialect/Async/Transforms.h b/mlir/include/mlir/Dialect/Async/Transforms.h --- a/mlir/include/mlir/Dialect/Async/Transforms.h +++ b/mlir/include/mlir/Dialect/Async/Transforms.h @@ -13,7 +13,7 @@ #ifndef MLIR_DIALECT_ASYNC_TRANSFORMS_H_ #define MLIR_DIALECT_ASYNC_TRANSFORMS_H_ -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/IR/ImplicitLocOpBuilder.h" namespace mlir { diff --git a/mlir/include/mlir/Dialect/Linalg/Utils/Utils.h b/mlir/include/mlir/Dialect/Linalg/Utils/Utils.h --- a/mlir/include/mlir/Dialect/Linalg/Utils/Utils.h +++ b/mlir/include/mlir/Dialect/Linalg/Utils/Utils.h @@ -11,7 +11,7 @@ #include "mlir/Dialect/Linalg/Analysis/DependenceAnalysis.h" #include "mlir/Dialect/Linalg/IR/Linalg.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "llvm/ADT/MapVector.h" #include "llvm/ADT/SetVector.h" diff --git a/mlir/include/mlir/Dialect/SCF/BufferizableOpInterfaceImpl.h b/mlir/include/mlir/Dialect/SCF/BufferizableOpInterfaceImpl.h deleted file mode 100644 --- a/mlir/include/mlir/Dialect/SCF/BufferizableOpInterfaceImpl.h +++ /dev/null @@ -1,20 +0,0 @@ -//===- BufferizableOpInterfaceImpl.h - Impl. of BufferizableOpInterface ---===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef MLIR_DIALECT_SCF_BUFFERIZABLEOPINTERFACEIMPL_H -#define MLIR_DIALECT_SCF_BUFFERIZABLEOPINTERFACEIMPL_H - -namespace mlir { -class DialectRegistry; - -namespace scf { -void registerBufferizableOpInterfaceExternalModels(DialectRegistry ®istry); -} // namespace scf -} // namespace mlir - -#endif // MLIR_DIALECT_SCF_BUFFERIZABLEOPINTERFACEIMPL_H diff --git a/mlir/include/mlir/Dialect/SCF/CMakeLists.txt b/mlir/include/mlir/Dialect/SCF/CMakeLists.txt --- a/mlir/include/mlir/Dialect/SCF/CMakeLists.txt +++ b/mlir/include/mlir/Dialect/SCF/CMakeLists.txt @@ -1,11 +1,3 @@ -add_mlir_dialect(SCFOps scf Ops) -add_mlir_doc(SCFOps SCFDialect Dialects/ -gen-dialect-doc) - -set(LLVM_TARGET_DEFINITIONS Passes.td) -mlir_tablegen(Passes.h.inc -gen-pass-decls -name SCF) -add_public_tablegen_target(MLIRSCFPassIncGen) -add_dependencies(mlir-headers MLIRSCFPassIncGen) - -add_mlir_doc(Passes SCFPasses ./ -gen-pass-doc) - +add_subdirectory(IR) add_subdirectory(TransformOps) +add_subdirectory(Transforms) diff --git a/mlir/include/mlir/Dialect/SCF/IR/CMakeLists.txt b/mlir/include/mlir/Dialect/SCF/IR/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/mlir/include/mlir/Dialect/SCF/IR/CMakeLists.txt @@ -0,0 +1,3 @@ +add_mlir_dialect(SCFOps scf Ops) +add_mlir_doc(SCFOps SCFDialect Dialects/ -gen-dialect-doc) + diff --git a/mlir/include/mlir/Dialect/SCF/Passes.h b/mlir/include/mlir/Dialect/SCF/Passes.h deleted file mode 100644 --- a/mlir/include/mlir/Dialect/SCF/Passes.h +++ /dev/null @@ -1,72 +0,0 @@ -//===- Passes.h - Pass Entrypoints ------------------------------*- C++ -*-===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -// -// This header file defines prototypes that expose pass constructors. -// -//===----------------------------------------------------------------------===// - -#ifndef MLIR_DIALECT_SCF_PASSES_H_ -#define MLIR_DIALECT_SCF_PASSES_H_ - -#include "mlir/Pass/Pass.h" - -namespace mlir { - -/// Creates a pass that bufferizes the SCF dialect. -std::unique_ptr createSCFBufferizePass(); - -/// Creates a pass that specializes for loop for unrolling and -/// vectorization. -std::unique_ptr createForLoopSpecializationPass(); - -/// Creates a pass that peels for loops at their upper bounds for -/// better vectorization. -std::unique_ptr createForLoopPeelingPass(); - -/// Creates a pass that canonicalizes affine.min and affine.max operations -/// inside of scf.for loops with known lower and upper bounds. -std::unique_ptr createSCFForLoopCanonicalizationPass(); - -/// Creates a pass that transforms a single ParallelLoop over N induction -/// variables into another ParallelLoop over less than N induction variables. -std::unique_ptr createParallelLoopCollapsingPass(); - -/// Creates a loop fusion pass which fuses parallel loops. -std::unique_ptr createParallelLoopFusionPass(); - -/// Creates a pass that specializes parallel loop for unrolling and -/// vectorization. -std::unique_ptr createParallelLoopSpecializationPass(); - -/// Creates a pass which tiles innermost parallel loops. -/// If noMinMaxBounds, the upper bound of the inner loop will -/// be a same value among different outter loop iterations, and -/// an additional inbound check will be emitted inside the internal -/// loops. -std::unique_ptr -createParallelLoopTilingPass(llvm::ArrayRef tileSize = {}, - bool noMinMaxBounds = false); - -/// Creates a pass which folds arith ops on induction variable into -/// loop range. -std::unique_ptr createForLoopRangeFoldingPass(); - -// Creates a pass which lowers for loops into while loops. -std::unique_ptr createForToWhileLoopPass(); - -//===----------------------------------------------------------------------===// -// Registration -//===----------------------------------------------------------------------===// - -/// Generate the code for registering passes. -#define GEN_PASS_REGISTRATION -#include "mlir/Dialect/SCF/Passes.h.inc" - -} // namespace mlir - -#endif // MLIR_DIALECT_SCF_PASSES_H_ diff --git a/mlir/include/mlir/Dialect/SCF/Passes.td b/mlir/include/mlir/Dialect/SCF/Passes.td deleted file mode 100644 --- a/mlir/include/mlir/Dialect/SCF/Passes.td +++ /dev/null @@ -1,125 +0,0 @@ -//===-- Passes.td - SCF pass definition file ---------------*- tablegen -*-===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef MLIR_DIALECT_SCF_PASSES -#define MLIR_DIALECT_SCF_PASSES - -include "mlir/Pass/PassBase.td" - -def SCFBufferize : Pass<"scf-bufferize", "func::FuncOp"> { - let summary = "Bufferize the scf dialect."; - let constructor = "mlir::createSCFBufferizePass()"; - let dependentDialects = ["bufferization::BufferizationDialect", - "memref::MemRefDialect"]; -} - -// Note: Making these canonicalization patterns would require a dependency -// of the SCF dialect on the Affine/Tensor/MemRef dialects or vice versa. -def SCFForLoopCanonicalization - : Pass<"scf-for-loop-canonicalization", "func::FuncOp"> { - let summary = "Canonicalize operations within scf.for loop bodies"; - let constructor = "mlir::createSCFForLoopCanonicalizationPass()"; - let dependentDialects = ["AffineDialect", "tensor::TensorDialect", - "memref::MemRefDialect"]; -} - -def SCFForLoopPeeling : Pass<"scf-for-loop-peeling", "func::FuncOp"> { - let summary = "Peel `for` loops at their upper bounds."; - let constructor = "mlir::createForLoopPeelingPass()"; - let options = [ - Option<"skipPartial", "skip-partial", "bool", - /*default=*/"true", - "Do not peel loops inside of the last, partial iteration of another " - "already peeled loop."> - ]; - let dependentDialects = ["AffineDialect"]; -} - -def SCFForLoopSpecialization : Pass<"scf-for-loop-specialization", "func::FuncOp"> { - let summary = "Specialize `for` loops for vectorization"; - let constructor = "mlir::createForLoopSpecializationPass()"; -} - -def SCFParallelLoopFusion : Pass<"scf-parallel-loop-fusion"> { - let summary = "Fuse adjacent parallel loops"; - let constructor = "mlir::createParallelLoopFusionPass()"; -} - -def SCFParallelLoopCollapsing : Pass<"scf-parallel-loop-collapsing"> { - let summary = "Collapse parallel loops to use less induction variables"; - let constructor = "mlir::createParallelLoopCollapsingPass()"; - let options = [ - ListOption<"clCollapsedIndices0", "collapsed-indices-0", "unsigned", - "Which loop indices to combine 0th loop index">, - ListOption<"clCollapsedIndices1", "collapsed-indices-1", "unsigned", - "Which loop indices to combine into the position 1 loop index">, - ListOption<"clCollapsedIndices2", "collapsed-indices-2", "unsigned", - "Which loop indices to combine into the position 2 loop index">, - ]; -} - -def SCFParallelLoopSpecialization - : Pass<"scf-parallel-loop-specialization", "func::FuncOp"> { - let summary = "Specialize parallel loops for vectorization"; - let constructor = "mlir::createParallelLoopSpecializationPass()"; -} - -def SCFParallelLoopTiling : Pass<"scf-parallel-loop-tiling", "func::FuncOp"> { - let summary = "Tile parallel loops"; - let constructor = "mlir::createParallelLoopTilingPass()"; - let options = [ - ListOption<"tileSizes", "parallel-loop-tile-sizes", "int64_t", - "Factors to tile parallel loops by", "llvm::cl::ZeroOrMore">, - Option<"noMinMaxBounds", "no-min-max-bounds", "bool", - /*default=*/"false", - "Perform tiling with fixed upper bound with inbound check " - "inside the internal loops"> - ]; - let dependentDialects = ["AffineDialect"]; -} - -def SCFForLoopRangeFolding : Pass<"scf-for-loop-range-folding"> { - let summary = "Fold add/mul ops into loop range"; - let constructor = "mlir::createForLoopRangeFoldingPass()"; -} - -def SCFForToWhileLoop : Pass<"scf-for-to-while", "func::FuncOp"> { - let summary = "Convert SCF for loops to SCF while loops"; - let constructor = "mlir::createForToWhileLoopPass()"; - let description = [{ - This pass transforms SCF.ForOp operations to SCF.WhileOp. The For loop - condition is placed in the 'before' region of the while operation, and the - induction variable incrementation and loop body in the 'after' region. - The loop carried values of the while op are the induction variable (IV) of - the for-loop + any iter_args specified for the for-loop. - Any 'yield' ops in the for-loop are rewritten to additionally yield the - (incremented) induction variable. - - ```mlir - # Before: - scf.for %i = %c0 to %arg1 step %c1 { - %0 = arith.addi %arg2, %arg2 : i32 - memref.store %0, %arg0[%i] : memref - } - - # After: - %0 = scf.while (%i = %c0) : (index) -> index { - %1 = arith.cmpi slt, %i, %arg1 : index - scf.condition(%1) %i : index - } do { - ^bb0(%i: index): - %1 = arith.addi %i, %c1 : index - %2 = arith.addi %arg2, %arg2 : i32 - memref.store %2, %arg0[%i] : memref - scf.yield %1 : index - } - ``` - }]; -} - -#endif // MLIR_DIALECT_SCF_PASSES diff --git a/mlir/include/mlir/Dialect/SCF/Patterns.h b/mlir/include/mlir/Dialect/SCF/Patterns.h deleted file mode 100644 --- a/mlir/include/mlir/Dialect/SCF/Patterns.h +++ /dev/null @@ -1,54 +0,0 @@ -//===- Patterns.h - SCF dialect rewrite patterns ----------------*- C++ -*-===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef MLIR_DIALECT_SCF_PATTERNS_H -#define MLIR_DIALECT_SCF_PATTERNS_H - -#include "mlir/Dialect/SCF/SCF.h" -#include "mlir/Dialect/SCF/Transforms.h" -#include "mlir/IR/PatternMatch.h" - -namespace mlir { -namespace scf { -/// Generate a pipelined version of the scf.for loop based on the schedule given -/// as option. This applies the mechanical transformation of changing the loop -/// and generating the prologue/epilogue for the pipelining and doesn't make any -/// decision regarding the schedule. -/// Based on the options the loop is split into several stages. -/// The transformation assumes that the scheduling given by user is valid. -/// For example if we break a loop into 3 stages named S0, S1, S2 we would -/// generate the following code with the number in parenthesis as the iteration -/// index: -/// S0(0) // Prologue -/// S0(1) S1(0) // Prologue -/// scf.for %I = %C0 to %N - 2 { -/// S0(I+2) S1(I+1) S2(I) // Pipelined kernel -/// } -/// S1(N) S2(N-1) // Epilogue -/// S2(N) // Epilogue -class ForLoopPipeliningPattern : public OpRewritePattern { -public: - ForLoopPipeliningPattern(const PipeliningOption &options, - MLIRContext *context) - : OpRewritePattern(context), options(options) {} - LogicalResult matchAndRewrite(ForOp forOp, - PatternRewriter &rewriter) const override { - return returningMatchAndRewrite(forOp, rewriter); - } - - FailureOr returningMatchAndRewrite(ForOp forOp, - PatternRewriter &rewriter) const; - -protected: - PipeliningOption options; -}; - -} // namespace scf -} // namespace mlir - -#endif // MLIR_DIALECT_SCF_PATTERNS_H diff --git a/mlir/include/mlir/Dialect/SCF/SCF.h b/mlir/include/mlir/Dialect/SCF/SCF.h deleted file mode 100644 --- a/mlir/include/mlir/Dialect/SCF/SCF.h +++ /dev/null @@ -1,100 +0,0 @@ -//===- SCFOps.h - Structured Control Flow -----------------------*- C++ -*-===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -// -// This file defines structured control flow operations. -// -//===----------------------------------------------------------------------===// - -#ifndef MLIR_DIALECT_SCF_SCF_H -#define MLIR_DIALECT_SCF_SCF_H - -#include "mlir/IR/Builders.h" -#include "mlir/IR/BuiltinTypes.h" -#include "mlir/IR/RegionKindInterface.h" -#include "mlir/Interfaces/ControlFlowInterfaces.h" -#include "mlir/Interfaces/LoopLikeInterface.h" -#include "mlir/Interfaces/SideEffectInterfaces.h" -#include "mlir/Interfaces/ViewLikeInterface.h" - -namespace mlir { -namespace scf { -void buildTerminatedBody(OpBuilder &builder, Location loc); -} // namespace scf -} // namespace mlir - -#include "mlir/Dialect/SCF/SCFOpsDialect.h.inc" - -#define GET_OP_CLASSES -#include "mlir/Dialect/SCF/SCFOps.h.inc" - -namespace mlir { -namespace scf { - -// Insert `loop.yield` at the end of the only region's only block if it -// does not have a terminator already. If a new `loop.yield` is inserted, -// the location is specified by `loc`. If the region is empty, insert a new -// block first. -void ensureLoopTerminator(Region ®ion, Builder &builder, Location loc); - -/// Returns the loop parent of an induction variable. If the provided value is -/// not an induction variable, then return nullptr. -ForOp getForInductionVarOwner(Value val); - -/// Returns the parallel loop parent of an induction variable. If the provided -/// value is not an induction variable, then return nullptr. -ParallelOp getParallelForInductionVarOwner(Value val); - -/// Return true if ops a and b (or their ancestors) are in mutually exclusive -/// regions/blocks of an IfOp. -// TODO: Consider moving this functionality to RegionBranchOpInterface. -bool insideMutuallyExclusiveBranches(Operation *a, Operation *b); - -/// An owning vector of values, handy to return from functions. -using ValueVector = std::vector; -using LoopVector = std::vector; -struct LoopNest { - ResultRange getResults() { return loops.front().getResults(); } - LoopVector loops; -}; - -/// Creates a perfect nest of "for" loops, i.e. all loops but the innermost -/// contain only another loop and a terminator. The lower, upper bounds and -/// steps are provided as `lbs`, `ubs` and `steps`, which are expected to be of -/// the same size. `iterArgs` points to the initial values of the loop iteration -/// arguments, which will be forwarded through the nest to the innermost loop. -/// The body of the loop is populated using `bodyBuilder`, which accepts an -/// ordered list of induction variables of all loops, followed by a list of -/// iteration arguments of the innermost loop, in the same order as provided to -/// `iterArgs`. This function is expected to return as many values as -/// `iterArgs`, of the same type and in the same order, that will be treated as -/// yielded from the loop body and forwarded back through the loop nest. If the -/// function is not provided, the loop nest is not expected to have iteration -/// arguments, the body of the innermost loop will be left empty, containing -/// only the zero-operand terminator. Returns the LoopNest containing the list -/// of perfectly nest scf::ForOp build during the call. -/// If bound arrays are empty, the body builder will be called -/// once to construct the IR outside of the loop with an empty list of induction -/// variables. -LoopNest buildLoopNest( - OpBuilder &builder, Location loc, ValueRange lbs, ValueRange ubs, - ValueRange steps, ValueRange iterArgs, - function_ref - bodyBuilder = nullptr); - -/// A convenience version for building loop nests without iteration arguments -/// (like for reductions). Does not take the initial value of reductions or -/// expect the body building functions to return their current value. -/// The built nested scf::For are captured in `capturedLoops` when non-null. -LoopNest buildLoopNest(OpBuilder &builder, Location loc, ValueRange lbs, - ValueRange ubs, ValueRange steps, - function_ref - bodyBuilder = nullptr); - -} // namespace scf -} // namespace mlir -#endif // MLIR_DIALECT_SCF_SCF_H diff --git a/mlir/include/mlir/Dialect/SCF/SCFOps.td b/mlir/include/mlir/Dialect/SCF/SCFOps.td deleted file mode 100644 --- a/mlir/include/mlir/Dialect/SCF/SCFOps.td +++ /dev/null @@ -1,997 +0,0 @@ -//===- SCFOps.td - Structured Control Flow operations ------*- tablegen -*-===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -// -// Defines MLIR structured control flow operations. -// -//===----------------------------------------------------------------------===// - -#ifndef MLIR_DIALECT_SCF_SCFOPS -#define MLIR_DIALECT_SCF_SCFOPS - -include "mlir/Interfaces/ControlFlowInterfaces.td" -include "mlir/Interfaces/LoopLikeInterface.td" -include "mlir/IR/RegionKindInterface.td" -include "mlir/Interfaces/SideEffectInterfaces.td" -include "mlir/Interfaces/ViewLikeInterface.td" - -def SCF_Dialect : Dialect { - let name = "scf"; - let cppNamespace = "::mlir::scf"; - let dependentDialects = ["arith::ArithmeticDialect"]; - let emitAccessorPrefix = kEmitAccessorPrefix_Prefixed; -} - -// Base class for SCF dialect ops. -class SCF_Op traits = []> : - Op; - -//===----------------------------------------------------------------------===// -// ConditionOp -//===----------------------------------------------------------------------===// - -def ConditionOp : SCF_Op<"condition", [ - HasParent<"WhileOp">, - DeclareOpInterfaceMethods, - NoSideEffect, - Terminator -]> { - let summary = "loop continuation condition"; - let description = [{ - This operation accepts the continuation (i.e., inverse of exit) condition - of the `scf.while` construct. If its first argument is true, the "after" - region of `scf.while` is executed, with the remaining arguments forwarded - to the entry block of the region. Otherwise, the loop terminates. - }]; - - let arguments = (ins I1:$condition, Variadic:$args); - - let assemblyFormat = - [{ `(` $condition `)` attr-dict ($args^ `:` type($args))? }]; -} - -//===----------------------------------------------------------------------===// -// ExecuteRegionOp -//===----------------------------------------------------------------------===// - -def ExecuteRegionOp : SCF_Op<"execute_region", [ - DeclareOpInterfaceMethods]> { - let summary = "operation that executes its region exactly once"; - let description = [{ - The `execute_region` operation is used to allow multiple blocks within SCF - and other operations which can hold only one block. The `execute_region` - operation executes the region held exactly once and cannot have any operands. - As such, its region has no arguments. All SSA values that dominate the op can - be accessed inside the op. The op's region can have multiple blocks and the - blocks can have multiple distinct terminators. Values returned from this op's - region define the op's results. - - Example: - - ```mlir - scf.for %i = 0 to 128 step %c1 { - %y = scf.execute_region -> i32 { - %x = load %A[%i] : memref<128xi32> - scf.yield %x : i32 - } - } - - affine.for %i = 0 to 100 { - "foo"() : () -> () - %v = scf.execute_region -> i64 { - cf.cond_br %cond, ^bb1, ^bb2 - - ^bb1: - %c1 = arith.constant 1 : i64 - cf.br ^bb3(%c1 : i64) - - ^bb2: - %c2 = arith.constant 2 : i64 - cf.br ^bb3(%c2 : i64) - - ^bb3(%x : i64): - scf.yield %x : i64 - } - "bar"(%v) : (i64) -> () - } - ``` - }]; - - let results = (outs Variadic); - - let regions = (region AnyRegion:$region); - - let hasCanonicalizer = 1; - let hasCustomAssemblyFormat = 1; - - let hasVerifier = 1; -} - -//===----------------------------------------------------------------------===// -// ForOp -//===----------------------------------------------------------------------===// - -def ForOp : SCF_Op<"for", - [AutomaticAllocationScope, DeclareOpInterfaceMethods, - DeclareOpInterfaceMethods, - SingleBlockImplicitTerminator<"scf::YieldOp">, - RecursiveSideEffects]> { - let summary = "for operation"; - let description = [{ - The "scf.for" operation represents a loop taking 3 SSA value as operands - that represent the lower bound, upper bound and step respectively. The - operation defines an SSA value for its induction variable. It has one - region capturing the loop body. The induction variable is represented as an - argument of this region. This SSA value always has type index, which is the - size of the machine word. The step is a value of type index, required to be - positive. - The lower and upper bounds specify a half-open range: the range includes - the lower bound but does not include the upper bound. - - The body region must contain exactly one block that terminates with - "scf.yield". Calling ForOp::build will create such a region and insert - the terminator implicitly if none is defined, so will the parsing even in - cases when it is absent from the custom format. For example: - - ```mlir - scf.for %iv = %lb to %ub step %step { - ... // body - } - ``` - - `scf.for` can also operate on loop-carried variables and returns the final - values after loop termination. The initial values of the variables are - passed as additional SSA operands to the "scf.for" following the 3 loop - control SSA values mentioned above (lower bound, upper bound and step). The - operation region has an argument for the induction variable, followed by - one argument for each loop-carried variable, representing the value of the - variable at the current iteration. - - The region must terminate with a "scf.yield" that passes the current - values of all loop-carried variables to the next iteration, or to the - "scf.for" result, if at the last iteration. The static type of a - loop-carried variable may not change with iterations; its runtime type is - allowed to change. Note, that when the loop-carried variables are present, - calling ForOp::build will not insert the terminator implicitly. The caller - must insert "scf.yield" in that case. - - "scf.for" results hold the final values after the last iteration. - For example, to sum-reduce a memref: - - ```mlir - func.func @reduce(%buffer: memref<1024xf32>, %lb: index, - %ub: index, %step: index) -> (f32) { - // Initial sum set to 0. - %sum_0 = arith.constant 0.0 : f32 - // iter_args binds initial values to the loop's region arguments. - %sum = scf.for %iv = %lb to %ub step %step - iter_args(%sum_iter = %sum_0) -> (f32) { - %t = load %buffer[%iv] : memref<1024xf32> - %sum_next = arith.addf %sum_iter, %t : f32 - // Yield current iteration sum to next iteration %sum_iter or to %sum - // if final iteration. - scf.yield %sum_next : f32 - } - return %sum : f32 - } - ``` - - If the "scf.for" defines any values, a yield must be explicitly present. - The number and types of the "scf.for" results must match the initial - values in the "iter_args" binding and the yield operands. - - Another example with a nested "scf.if" (see "scf.if" for details) to - perform conditional reduction: - - ```mlir - func.func @conditional_reduce(%buffer: memref<1024xf32>, %lb: index, - %ub: index, %step: index) -> (f32) { - %sum_0 = arith.constant 0.0 : f32 - %c0 = arith.constant 0.0 : f32 - %sum = scf.for %iv = %lb to %ub step %step - iter_args(%sum_iter = %sum_0) -> (f32) { - %t = load %buffer[%iv] : memref<1024xf32> - %cond = arith.cmpf "ugt", %t, %c0 : f32 - %sum_next = scf.if %cond -> (f32) { - %new_sum = arith.addf %sum_iter, %t : f32 - scf.yield %new_sum : f32 - } else { - scf.yield %sum_iter : f32 - } - scf.yield %sum_next : f32 - } - return %sum : f32 - } - ``` - }]; - let arguments = (ins Index:$lowerBound, - Index:$upperBound, - Index:$step, - Variadic:$initArgs); - let results = (outs Variadic:$results); - let regions = (region SizedRegion<1>:$region); - - let skipDefaultBuilders = 1; - let builders = [ - OpBuilder<(ins "Value":$lowerBound, "Value":$upperBound, "Value":$step, - CArg<"ValueRange", "llvm::None">:$iterArgs, - CArg<"function_ref", - "nullptr">)> - ]; - - let extraClassDeclaration = [{ - using BodyBuilderFn = - function_ref; - - Value getInductionVar() { return getBody()->getArgument(0); } - Block::BlockArgListType getRegionIterArgs() { - return getBody()->getArguments().drop_front(getNumInductionVars()); - } - Operation::operand_range getIterOperands() { - return getOperands().drop_front(getNumControlOperands()); - } - MutableArrayRef getIterOpOperands() { - return - getOperation()->getOpOperands().drop_front(getNumControlOperands()); - } - - void setLowerBound(Value bound) { getOperation()->setOperand(0, bound); } - void setUpperBound(Value bound) { getOperation()->setOperand(1, bound); } - void setStep(Value step) { getOperation()->setOperand(2, step); } - - /// Number of induction variables, always 1 for scf::ForOp. - unsigned getNumInductionVars() { return 1; } - /// Number of region arguments for loop-carried values - unsigned getNumRegionIterArgs() { - return getBody()->getNumArguments() - getNumInductionVars(); - } - /// Number of operands controlling the loop: lb, ub, step - unsigned getNumControlOperands() { return 3; } - /// Does the operation hold operands for loop-carried values - bool hasIterOperands() { - return getOperation()->getNumOperands() > getNumControlOperands(); - } - /// Get Number of loop-carried values - unsigned getNumIterOperands() { - return getOperation()->getNumOperands() - getNumControlOperands(); - } - /// Get the region iter arg that corresponds to an OpOperand. - /// This helper prevents internal op implementation detail leakage to - /// clients by hiding the operand / block argument mapping. - BlockArgument getRegionIterArgForOpOperand(OpOperand &opOperand) { - assert(opOperand.getOperandNumber() >= getNumControlOperands() && - "expected an iter args operand"); - assert(opOperand.getOwner() == getOperation() && - "opOperand does not belong to this scf::ForOp operation"); - return getRegionIterArgs()[ - opOperand.getOperandNumber() - getNumControlOperands()]; - } - /// Get the OpOperand& that corresponds to a region iter arg. - /// This helper prevents internal op implementation detail leakage to - /// clients by hiding the operand / block argument mapping. - OpOperand &getOpOperandForRegionIterArg(BlockArgument bbArg) { - assert(bbArg.getArgNumber() >= getNumInductionVars() && - "expected a bbArg that is not an induction variable"); - assert(bbArg.getOwner()->getParentOp() == getOperation() && - "bbArg does not belong to the scf::ForOp body"); - return getOperation()->getOpOperand( - getNumControlOperands() + bbArg.getArgNumber() - getNumInductionVars()); - } - /// Get the OpResult that corresponds to an OpOperand. - /// Assert that opOperand is an iterArg. - /// This helper prevents internal op implementation detail leakage to - /// clients by hiding the operand / block argument mapping. - OpResult getResultForOpOperand(OpOperand &opOperand) { - assert(opOperand.getOperandNumber() >= getNumControlOperands() && - "expected an iter args operand"); - assert(opOperand.getOwner() == getOperation() && - "opOperand does not belong to this scf::ForOp operation"); - return getOperation()->getResult( - opOperand.getOperandNumber() - getNumControlOperands()); - } - /// Get the OpOperand& that corresponds to an OpResultOpOperand. - /// This helper prevents internal op implementation detail leakage to - /// clients by hiding the operand / block argument mapping. - OpOperand &getOpOperandForResult(OpResult opResult) { - assert(opResult.getDefiningOp() == getOperation() && - "opResult does not belong to the scf::ForOp operation"); - return getOperation()->getOpOperand( - getNumControlOperands() + opResult.getResultNumber()); - } - - /// Return operands used when entering the region at 'index'. These operands - /// correspond to the loop iterator operands, i.e., those exclusing the - /// induction variable. LoopOp only has one region, so 0 is the only valid - /// value for `index`. - OperandRange getSuccessorEntryOperands(Optional index); - }]; - - let hasCanonicalizer = 1; - let hasCustomAssemblyFormat = 1; - let hasVerifier = 1; - let hasRegionVerifier = 1; -} - -//===----------------------------------------------------------------------===// -// ForeachThreadOp -//===----------------------------------------------------------------------===// - -def ForeachThreadOp : SCF_Op<"foreach_thread", [ - SingleBlockImplicitTerminator<"scf::PerformConcurrentlyOp">, - RecursiveSideEffects, - AutomaticAllocationScope, - ]> { - let summary = "evaluate a block multiple times in parallel"; - let description = [{ - `scf.foreach_thread` is a target-independent multi-dimensional parallel - region application operation. It has exactly one block that represents the - parallel body and it takes index operands that indicate how many parallel - instances of that function are created. - - The name "thread" conveys the fact that the parallel execution is mapped - (i.e. distributed) to a set of virtual threads of execution, one function - application per thread. Further lowerings are responsible for specifying - how this is materialized on concrete hardware resources. - - The only allowed terminator is `scf.foreach_thread.perform_concurrently`, - which dictates how the partial results of all parallel invocations should be - reconciled into a full value. - - `scf.foreach_thread` returns values that are formed by aggregating the - actions of all the `perform_concurrently` terminator of all the virtual - threads, in some unspecified order. - In other words, `scf.foreach_thread` performs all actions specified in the - `perform_concurrently` terminator, after it receives the control back from - its body along each virtual thread of execution. - The actions involved in constructing the return values are further described - by [parallel_insert_slice](#parallelinsertslice-parallelinsertsliceop). - - `scf.foreach_thread` acts as an implicit synchronization point. - - Multi-value returns are encoded by including multiple operations inside the - `perform_concurrently` block. - - When the parallel function body has side effects, the order of reads and - writes to memory is unspecified across threads. - - Example: - - ```mlir - // - // Sequential context. - // - %matmul_and_pointwise:2 = scf.foreach_thread (%thread_id_1, %thread_id_2) in - (%num_threads_1, %numthread_id_2) -> (tensor, tensor) { - // - // Parallel context, each thread with id = (%thread_id_1, %thread_id_2) - // runs its version of the code. - // - %sA = tensor.extract_slice %A[f((%thread_id_1, %thread_id_2))]: - tensor to tensor - %sB = tensor.extract_slice %B[g((%thread_id_1, %thread_id_2))]: - tensor to tensor - %sC = tensor.extract_slice %C[h((%thread_id_1, %thread_id_2))]: - tensor to tensor - %sD = matmul ins(%sA, %sB) outs(%sC) - - %spointwise = subtensor %pointwise[i((%thread_id_1, %thread_id_2))]: - tensor to tensor - %sE = add ins(%spointwise) outs(%sD) - - scf.foreach_thread.perform_concurrently { - // First op within the parallel terminator contributes to producing %matmul_and_pointwise#0. - scf.foreach_thread.parallel_insert_slice %sD into %C[h((%thread_id_1, %thread_id_2))]: - tensor into tensor - - // Second op within the parallel terminator contributes to producing %matmul_and_pointwise#1. - scf.foreach_thread.parallel_insert_slice %spointwise into %pointwise[i((%thread_id_1, %thread_id_2))]: - tensor into tensor - } - } - // Implicit synchronization point. - // Sequential context. - // - ``` - }]; - let arguments = (ins Variadic:$num_threads); - - let results = (outs Variadic:$results); - let regions = (region SizedRegion<1>:$region); - - let hasCustomAssemblyFormat = 1; - let hasVerifier = 1; - - // The default builder does not add the proper body BBargs, roll our own. - let skipDefaultBuilders = 1; - let builders = [ - // Bodyless builder, result types must be specified. - OpBuilder<(ins "TypeRange":$resultTypes, "ValueRange":$num_threads)>, - // Builder that takes a bodyBuilder lambda, result types are inferred from - // the terminator. - OpBuilder<(ins "ValueRange":$num_threads, - "function_ref":$bodyBuilder)> - ]; - let extraClassDeclaration = [{ - int64_t getRank() { return getNumThreads().size(); } - ::mlir::ValueRange getThreadIndices() { return getBody()->getArguments(); } - ::mlir::Value getThreadIndex(int64_t idx) { return getBody()->getArgument(idx); } - - // The ensureTerminator method generated by SingleBlockImplicitTerminator is - // unaware of the fact that our terminator also needs a region to be - // well-formed. We override it here to ensure that we do the right thing. - static void ensureTerminator(Region ®ion, OpBuilder &builder, Location loc); - - PerformConcurrentlyOp getTerminator(); - }]; -} - -//===----------------------------------------------------------------------===// -// PerformConcurrentlyOp -//===----------------------------------------------------------------------===// - -def PerformConcurrentlyOp : SCF_Op<"foreach_thread.perform_concurrently", [ - NoSideEffect, - Terminator, - HasParent<"ForeachThreadOp">, - ] # GraphRegionNoTerminator.traits> { - let summary = "terminates a `foreach_thread` block"; - let description = [{ - `scf.foreach_thread.perform_concurrently` is a designated terminator for - the `scf.foreach_thread` operation. - - It has a single region with a single block that contains a flat list of ops. - Each such op participates in the aggregate formation of a single result of - the enclosing `scf.foreach_thread`. - The result number corresponds to the position of the op in the terminator. - }]; - - let regions = (region SizedRegion<1>:$region); - - let hasCustomAssemblyFormat = 1; - let hasVerifier = 1; - - // The default builder does not add a region with an empty body, add our own. - let skipDefaultBuilders = 1; - let builders = [ - OpBuilder<(ins)>, - ]; - - // TODO: Add a `PerformConcurrentlyOpInterface` interface for ops that can - // appear inside perform_concurrently. - let extraClassDeclaration = [{ - SmallVector yieldedTypes(); - ::llvm::iterator_range yieldingOps(); - }]; -} - -//===----------------------------------------------------------------------===// -// ParallelInsertSliceOp -//===----------------------------------------------------------------------===// - -// TODO: Implement PerformConcurrentlyOpInterface. -def ParallelInsertSliceOp : SCF_Op<"foreach_thread.parallel_insert_slice", [ - AttrSizedOperandSegments, - OffsetSizeAndStrideOpInterface, - HasParent<"PerformConcurrentlyOp">]> { - let summary = [{ - Specify the tensor slice update of a single thread within the terminator of - an `scf.foreach_thread`. - }]; - let description = [{ - The parent `scf.foreach_thread` returns values that are formed by aggregating - the actions of all the ops contained within the `perform_concurrently` - terminator of all the threads, in some unspecified order. - The `scf.foreach_thread.parallel_insert_slice` is one such op allowed in - the `scf.foreach_thread.perform_concurrently` terminator. - - Conflicting writes result in undefined semantics, in that the indices written - to by multiple parallel updates might contain data from any of the updates, or - even a malformed bit pattern. - - If an index is updated exactly once, the value contained at that index - in the resulting tensor will be equal to the value at a corresponding index of a - slice that was used for the updated. If an index is not updated at all, its value - will be equal to the one in the original tensor. - - This op does not create a new value, which allows maintaining a clean - separation between the subset and full tensor. - Note that we cannot mark this operation as pure (NoSideEffects), even - though it has no side effects, because it will get DCEd during - canonicalization. - }]; - - let arguments = (ins - AnyRankedTensor:$source, - AnyRankedTensor:$dest, - Variadic:$offsets, - Variadic:$sizes, - Variadic:$strides, - I64ArrayAttr:$static_offsets, - I64ArrayAttr:$static_sizes, - I64ArrayAttr:$static_strides - ); - let assemblyFormat = [{ - $source `into` $dest `` - custom($offsets, $static_offsets) - custom($sizes, $static_sizes) - custom($strides, $static_strides) - attr-dict `:` type($source) `into` type($dest) - }]; - - let extraClassDeclaration = [{ - ::mlir::Operation::operand_range offsets() { return getOffsets(); } - ::mlir::Operation::operand_range sizes() { return getSizes(); } - ::mlir::Operation::operand_range strides() { return getStrides(); } - ::mlir::ArrayAttr static_offsets() { return getStaticOffsets(); } - ::mlir::ArrayAttr static_sizes() { return getStaticSizes(); } - ::mlir::ArrayAttr static_strides() { return getStaticStrides(); } - - Type yieldedType() { return getDest().getType(); } - - RankedTensorType getSourceType() { - return getSource().getType().cast(); - } - - /// Return the expected rank of each of the `static_offsets`, `static_sizes` - /// and `static_strides` attributes. - std::array getArrayAttrMaxRanks() { - unsigned rank = getSourceType().getRank(); - return {rank, rank, rank}; - } - - /// Return the number of leading operands before `offsets`, `sizes` and - /// `strides` operands. - static unsigned getOffsetSizeAndStrideStartOperandIndex() { return 1; } - }]; - - let builders = [ - // Build a ParallelInsertSliceOp with mixed static and dynamic entries. - OpBuilder<(ins "Value":$source, "Value":$dest, - "ArrayRef":$offsets, "ArrayRef":$sizes, - "ArrayRef":$strides, - CArg<"ArrayRef", "{}">:$attrs)>, - - // Build a ParallelInsertSliceOp with dynamic entries. - OpBuilder<(ins "Value":$source, "Value":$dest, - "ValueRange":$offsets, "ValueRange":$sizes, "ValueRange":$strides, - CArg<"ArrayRef", "{}">:$attrs)> - ]; - - let hasCanonicalizer = 1; -} - -//===----------------------------------------------------------------------===// -// IfOp -//===----------------------------------------------------------------------===// - -def IfOp : SCF_Op<"if", - [DeclareOpInterfaceMethods, - SingleBlockImplicitTerminator<"scf::YieldOp">, RecursiveSideEffects, - NoRegionArguments]> { - let summary = "if-then-else operation"; - let description = [{ - The `scf.if` operation represents an if-then-else construct for - conditionally executing two regions of code. The operand to an if operation - is a boolean value. For example: - - ```mlir - scf.if %b { - ... - } else { - ... - } - ``` - - `scf.if` may also return results that are defined in its regions. The - values defined are determined by which execution path is taken. - - Example: - - ```mlir - %x, %y = scf.if %b -> (f32, f32) { - %x_true = ... - %y_true = ... - scf.yield %x_true, %y_true : f32, f32 - } else { - %x_false = ... - %y_false = ... - scf.yield %x_false, %y_false : f32, f32 - } - ``` - - `scf.if` regions are always terminated with "scf.yield". If "scf.if" - defines no values, the "scf.yield" can be left out, and will be inserted - implicitly. Otherwise, it must be explicit. - Also, if "scf.if" defines one or more values, the 'else' block cannot be - omitted. - - Example: - - ```mlir - scf.if %b { - ... - } - ``` - }]; - let arguments = (ins I1:$condition); - let results = (outs Variadic:$results); - let regions = (region SizedRegion<1>:$thenRegion, AnyRegion:$elseRegion); - - let skipDefaultBuilders = 1; - let builders = [ - OpBuilder<(ins "Value":$cond, "bool":$withElseRegion)>, - OpBuilder<(ins "TypeRange":$resultTypes, "Value":$cond, - "bool":$withElseRegion)>, - OpBuilder<(ins "TypeRange":$resultTypes, "Value":$cond, - CArg<"function_ref", - "buildTerminatedBody">:$thenBuilder, - CArg<"function_ref", - "nullptr">:$elseBuilder)>, - OpBuilder<(ins "Value":$cond, - CArg<"function_ref", - "buildTerminatedBody">:$thenBuilder, - CArg<"function_ref", - "nullptr">:$elseBuilder)> - ]; - - let extraClassDeclaration = [{ - OpBuilder getThenBodyBuilder(OpBuilder::Listener *listener = nullptr) { - Block* body = getBody(0); - return getResults().empty() ? OpBuilder::atBlockTerminator(body, listener) - : OpBuilder::atBlockEnd(body, listener); - } - OpBuilder getElseBodyBuilder(OpBuilder::Listener *listener = nullptr) { - Block* body = getBody(1); - return getResults().empty() ? OpBuilder::atBlockTerminator(body, listener) - : OpBuilder::atBlockEnd(body, listener); - } - Block* thenBlock(); - YieldOp thenYield(); - Block* elseBlock(); - YieldOp elseYield(); - }]; - let hasFolder = 1; - let hasCanonicalizer = 1; - let hasCustomAssemblyFormat = 1; - let hasVerifier = 1; -} - -//===----------------------------------------------------------------------===// -// ParallelOp -//===----------------------------------------------------------------------===// - -def ParallelOp : SCF_Op<"parallel", - [AutomaticAllocationScope, - AttrSizedOperandSegments, - DeclareOpInterfaceMethods, - RecursiveSideEffects, - SingleBlockImplicitTerminator<"scf::YieldOp">]> { - let summary = "parallel for operation"; - let description = [{ - The "scf.parallel" operation represents a loop nest taking 4 groups of SSA - values as operands that represent the lower bounds, upper bounds, steps and - initial values, respectively. The operation defines a variadic number of - SSA values for its induction variables. It has one region capturing the - loop body. The induction variables are represented as an argument of this - region. These SSA values always have type index, which is the size of the - machine word. The steps are values of type index, required to be positive. - The lower and upper bounds specify a half-open range: the range includes - the lower bound but does not include the upper bound. The initial values - have the same types as results of "scf.parallel". If there are no results, - the keyword `init` can be omitted. - - Semantically we require that the iteration space can be iterated in any - order, and the loop body can be executed in parallel. If there are data - races, the behavior is undefined. - - The parallel loop operation supports reduction of values produced by - individual iterations into a single result. This is modeled using the - scf.reduce operation (see scf.reduce for details). Each result of a - scf.parallel operation is associated with an initial value operand and - reduce operation that is an immediate child. Reductions are matched to - result and initial values in order of their appearance in the body. - Consequently, we require that the body region has the same number of - results and initial values as it has reduce operations. - - The body region must contain exactly one block that terminates with - "scf.yield" without operands. Parsing ParallelOp will create such a region - and insert the terminator when it is absent from the custom format. - - Example: - - ```mlir - %init = arith.constant 0.0 : f32 - scf.parallel (%iv) = (%lb) to (%ub) step (%step) init (%init) -> f32 { - %elem_to_reduce = load %buffer[%iv] : memref<100xf32> - scf.reduce(%elem_to_reduce) : f32 { - ^bb0(%lhs : f32, %rhs: f32): - %res = arith.addf %lhs, %rhs : f32 - scf.reduce.return %res : f32 - } - } - ``` - }]; - - let arguments = (ins Variadic:$lowerBound, - Variadic:$upperBound, - Variadic:$step, - Variadic:$initVals); - let results = (outs Variadic:$results); - let regions = (region SizedRegion<1>:$region); - - let skipDefaultBuilders = 1; - let builders = [ - OpBuilder<(ins "ValueRange":$lowerBounds, "ValueRange":$upperBounds, - "ValueRange":$steps, "ValueRange":$initVals, - CArg<"function_ref", - "nullptr">:$bodyBuilderFn)>, - OpBuilder<(ins "ValueRange":$lowerBounds, "ValueRange":$upperBounds, - "ValueRange":$steps, - CArg<"function_ref", - "nullptr">:$bodyBuilderFn)>, - ]; - - let extraClassDeclaration = [{ - ValueRange getInductionVars() { - return getBody()->getArguments(); - } - unsigned getNumLoops() { return getStep().size(); } - unsigned getNumReductions() { return getInitVals().size(); } - }]; - - let hasCanonicalizer = 1; - let hasCustomAssemblyFormat = 1; - let hasVerifier = 1; -} - -//===----------------------------------------------------------------------===// -// ReduceOp -//===----------------------------------------------------------------------===// - -def ReduceOp : SCF_Op<"reduce", [HasParent<"ParallelOp">]> { - let summary = "reduce operation for parallel for"; - let description = [{ - "scf.reduce" is an operation occurring inside "scf.parallel" operations. - It consists of one block with two arguments which have the same type as the - operand of "scf.reduce". - - "scf.reduce" is used to model the value for reduction computations of a - "scf.parallel" operation. It has to appear as an immediate child of a - "scf.parallel" and is associated with a result value of its parent - operation. - - Association is in the order of appearance in the body where the first - result of a parallel loop operation corresponds to the first "scf.reduce" - in the operation's body region. The reduce operation takes a single - operand, which is the value to be used in the reduction. - - The reduce operation contains a region whose entry block expects two - arguments of the same type as the operand. As the iteration order of the - parallel loop and hence reduction order is unspecified, the result of - reduction may be non-deterministic unless the operation is associative and - commutative. - - The result of the reduce operation's body must have the same type as the - operands and associated result value of the parallel loop operation. - Example: - - ```mlir - %operand = arith.constant 1.0 : f32 - scf.reduce(%operand) : f32 { - ^bb0(%lhs : f32, %rhs: f32): - %res = arith.addf %lhs, %rhs : f32 - scf.reduce.return %res : f32 - } - ``` - }]; - - let skipDefaultBuilders = 1; - let builders = [ - OpBuilder<(ins "Value":$operand, - CArg<"function_ref", - "nullptr">:$bodyBuilderFn)> - ]; - - let arguments = (ins AnyType:$operand); - let hasCustomAssemblyFormat = 1; - let regions = (region SizedRegion<1>:$reductionOperator); - let hasRegionVerifier = 1; -} - -//===----------------------------------------------------------------------===// -// ReduceReturnOp -//===----------------------------------------------------------------------===// - -def ReduceReturnOp : - SCF_Op<"reduce.return", [HasParent<"ReduceOp">, NoSideEffect, - Terminator]> { - let summary = "terminator for reduce operation"; - let description = [{ - "scf.reduce.return" is a special terminator operation for the block inside - "scf.reduce". It terminates the region. It should have the same type as - the operand of "scf.reduce". Example for the custom format: - - ```mlir - scf.reduce.return %res : f32 - ``` - }]; - - let arguments = (ins AnyType:$result); - let assemblyFormat = "$result attr-dict `:` type($result)"; - let hasVerifier = 1; -} - -//===----------------------------------------------------------------------===// -// WhileOp -//===----------------------------------------------------------------------===// - -def WhileOp : SCF_Op<"while", - [DeclareOpInterfaceMethods, - RecursiveSideEffects]> { - let summary = "a generic 'while' loop"; - let description = [{ - This operation represents a generic "while"/"do-while" loop that keeps - iterating as long as a condition is satisfied. There is no restriction on - the complexity of the condition. It consists of two regions (with single - block each): "before" region and "after" region. The names of regions - indicates whether they execute before or after the condition check. - Therefore, if the main loop payload is located in the "before" region, the - operation is a "do-while" loop. Otherwise, it is a "while" loop. - - The "before" region terminates with a special operation, `scf.condition`, - that accepts as its first operand an `i1` value indicating whether to - proceed to the "after" region (value is `true`) or not. The two regions - communicate by means of region arguments. Initially, the "before" region - accepts as arguments the operands of the `scf.while` operation and uses them - to evaluate the condition. It forwards the trailing, non-condition operands - of the `scf.condition` terminator either to the "after" region if the - control flow is transferred there or to results of the `scf.while` operation - otherwise. The "after" region takes as arguments the values produced by the - "before" region and uses `scf.yield` to supply new arguments for the - "before" region, into which it transfers the control flow unconditionally. - - A simple "while" loop can be represented as follows. - - ```mlir - %res = scf.while (%arg1 = %init1) : (f32) -> f32 { - // "Before" region. - // In a "while" loop, this region computes the condition. - %condition = call @evaluate_condition(%arg1) : (f32) -> i1 - - // Forward the argument (as result or "after" region argument). - scf.condition(%condition) %arg1 : f32 - - } do { - ^bb0(%arg2: f32): - // "After" region. - // In a "while" loop, this region is the loop body. - %next = call @payload(%arg2) : (f32) -> f32 - - // Forward the new value to the "before" region. - // The operand types must match the types of the `scf.while` operands. - scf.yield %next : f32 - } - ``` - - A simple "do-while" loop can be represented by reducing the "after" block - to a simple forwarder. - - ```mlir - %res = scf.while (%arg1 = %init1) : (f32) -> f32 { - // "Before" region. - // In a "do-while" loop, this region contains the loop body. - %next = call @payload(%arg1) : (f32) -> f32 - - // And also evaluates the condition. - %condition = call @evaluate_condition(%arg1) : (f32) -> i1 - - // Loop through the "after" region. - scf.condition(%condition) %next : f32 - - } do { - ^bb0(%arg2: f32): - // "After" region. - // Forwards the values back to "before" region unmodified. - scf.yield %arg2 : f32 - } - ``` - - Note that the types of region arguments need not to match with each other. - The op expects the operand types to match with argument types of the - "before" region"; the result types to match with the trailing operand types - of the terminator of the "before" region, and with the argument types of the - "after" region. The following scheme can be used to share the results of - some operations executed in the "before" region with the "after" region, - avoiding the need to recompute them. - - ```mlir - %res = scf.while (%arg1 = %init1) : (f32) -> i64 { - // One can perform some computations, e.g., necessary to evaluate the - // condition, in the "before" region and forward their results to the - // "after" region. - %shared = call @shared_compute(%arg1) : (f32) -> i64 - - // Evaluate the condition. - %condition = call @evaluate_condition(%arg1, %shared) : (f32, i64) -> i1 - - // Forward the result of the shared computation to the "after" region. - // The types must match the arguments of the "after" region as well as - // those of the `scf.while` results. - scf.condition(%condition) %shared : i64 - - } do { - ^bb0(%arg2: i64) { - // Use the partial result to compute the rest of the payload in the - // "after" region. - %res = call @payload(%arg2) : (i64) -> f32 - - // Forward the new value to the "before" region. - // The operand types must match the types of the `scf.while` operands. - scf.yield %res : f32 - } - ``` - - The custom syntax for this operation is as follows. - - ``` - op ::= `scf.while` assignments `:` function-type region `do` region - `attributes` attribute-dict - initializer ::= /* empty */ | `(` assignment-list `)` - assignment-list ::= assignment | assignment `,` assignment-list - assignment ::= ssa-value `=` ssa-value - ``` - }]; - - let arguments = (ins Variadic:$inits); - let results = (outs Variadic:$results); - let regions = (region SizedRegion<1>:$before, SizedRegion<1>:$after); - - let extraClassDeclaration = [{ - OperandRange getSuccessorEntryOperands(Optional index); - ConditionOp getConditionOp(); - YieldOp getYieldOp(); - Block::BlockArgListType getBeforeArguments(); - Block::BlockArgListType getAfterArguments(); - }]; - - let hasCanonicalizer = 1; - let hasCustomAssemblyFormat = 1; - let hasVerifier = 1; -} - -//===----------------------------------------------------------------------===// -// YieldOp -//===----------------------------------------------------------------------===// - -def YieldOp : SCF_Op<"yield", [NoSideEffect, ReturnLike, Terminator, - ParentOneOf<["ExecuteRegionOp, ForOp", - "IfOp, ParallelOp, WhileOp"]>]> { - let summary = "loop yield and termination operation"; - let description = [{ - "scf.yield" yields an SSA value from the SCF dialect op region and - terminates the regions. The semantics of how the values are yielded is - defined by the parent operation. - If "scf.yield" has any operands, the operands must match the parent - operation's results. - If the parent operation defines no values, then the "scf.yield" may be - left out in the custom syntax and the builders will insert one implicitly. - Otherwise, it has to be present in the syntax to indicate which values are - yielded. - }]; - - let arguments = (ins Variadic:$results); - let builders = [OpBuilder<(ins), [{ /* nothing to do */ }]>]; - - let assemblyFormat = - [{ attr-dict ($results^ `:` type($results))? }]; -} - -#endif // MLIR_DIALECT_SCF_SCFOPS diff --git a/mlir/include/mlir/Dialect/SCF/TileUsingInterface.h b/mlir/include/mlir/Dialect/SCF/TileUsingInterface.h deleted file mode 100644 --- a/mlir/include/mlir/Dialect/SCF/TileUsingInterface.h +++ /dev/null @@ -1,87 +0,0 @@ -//===- TileUsingInterface.h - Tiling ops using TilingInterface --*- C++ -*-===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#ifndef MLIR_DIALECT_SCF_TILEUSINGINTERFACE_H -#define MLIR_DIALECT_SCF_TILEUSINGINTERFACE_H - -#include "mlir/Dialect/SCF/SCF.h" -#include "mlir/IR/PatternMatch.h" -#include "mlir/Interfaces/TilingInterface.h" - -namespace mlir { -class Operation; -class PatternRewriter; -class TilingInterface; -} // namespace mlir - -namespace mlir { -namespace scf { - -using SCFTileSizeComputationFunction = - std::function(OpBuilder &, Operation *)>; - -/// Options to use to control tiling. -struct SCFTilingOptions { - /// Computation function that returns the tile sizes for each operation. - /// Delayed construction of constant tile sizes should occur to interoperate - /// with folding. - SCFTileSizeComputationFunction tileSizeComputationFunction = nullptr; - - SCFTilingOptions & - setTileSizeComputationFunction(SCFTileSizeComputationFunction fun) { - tileSizeComputationFunction = std::move(fun); - return *this; - } - /// Set the `tileSizeComputationFunction` to return the values `ts`. The - /// values must not fold away when tiling. Otherwise, use a more robust - /// `tileSizeComputationFunction`. - SCFTilingOptions &setTileSizes(const SmallVector &ts) { - tileSizeComputationFunction = [=](OpBuilder &, Operation *) { return ts; }; - return *this; - } - /// Convenience function to set the `tileSizeComputationFunction` to a - /// function that computes tile sizes at the point they are needed. Allows - /// proper interaction with folding. - SCFTilingOptions &setTileSizes(ArrayRef ts); -}; - -struct SCFTilingResult { - Operation *tiledOp; - SmallVector loops; -}; - -/// Pattern to tile an op that implementas the `TilingInterface` using -/// `scf.for` for iterating over the tiles. -struct TileUsingSCFForOp : public OpInterfaceRewritePattern { - /// Construct a generic pattern applied to all TilingInterface ops. - TileUsingSCFForOp(MLIRContext *context, SCFTilingOptions options, - PatternBenefit benefit = 1); - - /// Construct a generic pattern applied to `opName`. - TileUsingSCFForOp(StringRef opName, MLIRContext *context, - SCFTilingOptions options, PatternBenefit benefit = 1); - - /// `matchAndRewrite` implementation that returns the significant transformed - /// pieces of IR. - FailureOr - returningMatchAndRewrite(TilingInterface op, PatternRewriter &rewriter) const; - - LogicalResult matchAndRewrite(TilingInterface op, - PatternRewriter &rewriter) const override { - return returningMatchAndRewrite(op, rewriter); - } - -private: - /// Options to control tiling; - SCFTilingOptions options; -}; - -} // namespace scf -} // namespace mlir - -#endif // MLIR_DIALECT_SCF_TILEUSINGINTERFACE_H diff --git a/mlir/include/mlir/Dialect/SCF/Transforms.h b/mlir/include/mlir/Dialect/SCF/Transforms.h deleted file mode 100644 --- a/mlir/include/mlir/Dialect/SCF/Transforms.h +++ /dev/null @@ -1,174 +0,0 @@ -//===- Transforms.h - SCF dialect transformation utilities ------*- C++ -*-===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -// -// This header file defines transformations on SCF operations. -// -//===----------------------------------------------------------------------===// - -#ifndef MLIR_DIALECT_SCF_TRANSFORMS_H_ -#define MLIR_DIALECT_SCF_TRANSFORMS_H_ - -#include "mlir/Dialect/SCF/Utils/AffineCanonicalizationUtils.h" -#include "mlir/Support/LLVM.h" -#include "llvm/ADT/ArrayRef.h" - -namespace mlir { - -class AffineMap; -class ConversionTarget; -struct LogicalResult; -class MLIRContext; -class Region; -class RewriterBase; -class TypeConverter; -class RewritePatternSet; -class Operation; -class Value; -class ValueRange; -class PatternRewriter; - -namespace scf { - -class IfOp; -class ForOp; -class ParallelOp; - -/// Fuses all adjacent scf.parallel operations with identical bounds and step -/// into one scf.parallel operations. Uses a naive aliasing and dependency -/// analysis. -void naivelyFuseParallelOps(Region ®ion); - -/// Rewrite a for loop with bounds/step that potentially do not divide evenly -/// into a for loop where the step divides the iteration space evenly, followed -/// by another scf.for for the last (partial) iteration (if any; returned via -/// `partialIteration`). This transformation is called "loop peeling". -/// -/// This transformation is beneficial for a wide range of transformations such -/// as vectorization or loop tiling: It enables additional canonicalizations -/// inside the peeled loop body such as rewriting masked loads into unmaked -/// loads. -/// -/// E.g., assuming a lower bound of 0 (for illustration purposes): -/// ``` -/// scf.for %iv = %c0 to %ub step %c4 { -/// (loop body) -/// } -/// ``` -/// is rewritten into the following pseudo IR: -/// ``` -/// %newUb = %ub - (%ub mod %c4) -/// scf.for %iv = %c0 to %newUb step %c4 { -/// (loop body) -/// } -/// scf.for %iv2 = %newUb to %ub { -/// (loop body) -/// } -/// ``` -/// -/// After loop peeling, this function tries to simplify/canonicalize affine.min -/// and affine.max ops in the body of the peeled loop and in the body of the -/// partial iteration loop, taking advantage of the fact that the peeled loop -/// has only "full" iterations. This canonicalization is expected to enable -/// further canonicalization opportunities through other patterns. -/// -/// The return value indicates whether the loop was rewritten or not. Loops are -/// not rewritten if: -/// * Loop step size is 1 or -/// * Loop bounds and step size are static, and step already divides the -/// iteration space evenly. -/// -/// Note: This function rewrites the given scf.for loop in-place and creates a -/// new scf.for operation for the last iteration. It replaces all uses of the -/// unpeeled loop with the results of the newly generated scf.for. -LogicalResult peelAndCanonicalizeForLoop(RewriterBase &rewriter, ForOp forOp, - scf::ForOp &partialIteration); - -/// Tile a parallel loop of the form -/// scf.parallel (%i0, %i1) = (%arg0, %arg1) to (%arg2, %arg3) -/// step (%arg4, %arg5) -/// -/// into -/// scf.parallel (%i0, %i1) = (%arg0, %arg1) to (%arg2, %arg3) -/// step (%arg4*tileSize[0], -/// %arg5*tileSize[1]) -/// scf.parallel (%j0, %j1) = (0, 0) to (min(tileSize[0], %arg2-%j0) -/// min(tileSize[1], %arg3-%j1)) -/// step (%arg4, %arg5) -/// The old loop is replaced with the new one. -/// -/// The function returns the resulting ParallelOps, i.e. {outer_loop_op, -/// inner_loop_op}. -std::pair -tileParallelLoop(ParallelOp op, llvm::ArrayRef tileSizes, - bool noMinMaxBounds); - -/// Populates patterns for SCF structural type conversions and sets up the -/// provided ConversionTarget with the appropriate legality configuration for -/// the ops to get converted properly. -/// -/// A "structural" type conversion is one where the underlying ops are -/// completely agnostic to the actual types involved and simply need to update -/// their types. An example of this is scf.if -- the scf.if op and the -/// corresponding scf.yield ops need to update their types accordingly to the -/// TypeConverter, but otherwise don't care what type conversions are happening. -void populateSCFStructuralTypeConversionsAndLegality( - TypeConverter &typeConverter, RewritePatternSet &patterns, - ConversionTarget &target); - -/// Options to dictate how loops should be pipelined. -struct PipeliningOption { - /// Lambda returning all the operation in the forOp, with their stage, in the - /// order picked for the pipelined loop. - using GetScheduleFnType = std::function> &)>; - GetScheduleFnType getScheduleFn = nullptr; - enum class PipelinerPart { - Prologue, - Kernel, - Epilogue, - }; - /// Lambda called by the pipeliner to allow the user to annotate the IR while - /// it is generated. - /// The callback passes the operation created along with the part of the - /// pipeline and the iteration index. The iteration index is always 0 for the - /// kernel. For the prologue and epilogue, it corresponds to the iteration - /// peeled out of the loop in the range [0, maxStage[. - using AnnotationlFnType = - std::function; - AnnotationlFnType annotateFn = nullptr; - - /// Control whether the epilogue should be peeled out of the loop or - /// operations should be predicated to skip the early stages in the last loop - /// iterations. If the epilogue is predicated; the user needs to provide a - /// lambda to generate the predicated version of operations. - bool peelEpilogue = true; - - // Lamdba to predicate operations when the prologue or epilogue are not - // peeled. This takes the original operation, an i1 predicate value and the - // pattern rewriter. - using PredicateOpFn = - std::function; - PredicateOpFn predicateFn = nullptr; - - // TODO: add option to decide if the prologue should be peeled. -}; - -/// Populate patterns for SCF software pipelining transformation. See the -/// ForLoopPipeliningPattern for the transformation details. -void populateSCFLoopPipeliningPatterns(RewritePatternSet &patterns, - const PipeliningOption &options); - -/// Populate patterns for canonicalizing operations inside SCF loop bodies. -/// At the moment, only affine.min/max computations with iteration variables, -/// loop bounds and loop steps are canonicalized. -void populateSCFForLoopCanonicalizationPatterns(RewritePatternSet &patterns); - -} // namespace scf -} // namespace mlir - -#endif // MLIR_DIALECT_SCF_TRANSFORMS_H_ diff --git a/mlir/include/mlir/Dialect/SCF/CMakeLists.txt b/mlir/include/mlir/Dialect/SCF/Transforms/CMakeLists.txt copy from mlir/include/mlir/Dialect/SCF/CMakeLists.txt copy to mlir/include/mlir/Dialect/SCF/Transforms/CMakeLists.txt --- a/mlir/include/mlir/Dialect/SCF/CMakeLists.txt +++ b/mlir/include/mlir/Dialect/SCF/Transforms/CMakeLists.txt @@ -1,6 +1,3 @@ -add_mlir_dialect(SCFOps scf Ops) -add_mlir_doc(SCFOps SCFDialect Dialects/ -gen-dialect-doc) - set(LLVM_TARGET_DEFINITIONS Passes.td) mlir_tablegen(Passes.h.inc -gen-pass-decls -name SCF) add_public_tablegen_target(MLIRSCFPassIncGen) @@ -8,4 +5,3 @@ add_mlir_doc(Passes SCFPasses ./ -gen-pass-doc) -add_subdirectory(TransformOps) diff --git a/mlir/include/mlir/Dialect/SCF/Utils/Utils.h b/mlir/include/mlir/Dialect/SCF/Utils/Utils.h --- a/mlir/include/mlir/Dialect/SCF/Utils/Utils.h +++ b/mlir/include/mlir/Dialect/SCF/Utils/Utils.h @@ -13,7 +13,7 @@ #ifndef MLIR_DIALECT_SCF_UTILS_UTILS_H_ #define MLIR_DIALECT_SCF_UTILS_UTILS_H_ -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/IR/PatternMatch.h" #include "mlir/Support/LLVM.h" #include "mlir/Support/LogicalResult.h" diff --git a/mlir/include/mlir/InitAllDialects.h b/mlir/include/mlir/InitAllDialects.h --- a/mlir/include/mlir/InitAllDialects.h +++ b/mlir/include/mlir/InitAllDialects.h @@ -46,9 +46,9 @@ #include "mlir/Dialect/PDL/IR/PDL.h" #include "mlir/Dialect/PDLInterp/IR/PDLInterp.h" #include "mlir/Dialect/Quant/QuantOps.h" -#include "mlir/Dialect/SCF/BufferizableOpInterfaceImpl.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/SCF/TransformOps/SCFTransformOps.h" +#include "mlir/Dialect/SCF/Transforms/BufferizableOpInterfaceImpl.h" #include "mlir/Dialect/SPIRV/IR/SPIRVDialect.h" #include "mlir/Dialect/Shape/IR/Shape.h" #include "mlir/Dialect/Shape/Transforms/BufferizableOpInterfaceImpl.h" diff --git a/mlir/include/mlir/InitAllPasses.h b/mlir/include/mlir/InitAllPasses.h --- a/mlir/include/mlir/InitAllPasses.h +++ b/mlir/include/mlir/InitAllPasses.h @@ -25,7 +25,7 @@ #include "mlir/Dialect/Linalg/Passes.h" #include "mlir/Dialect/MemRef/Transforms/Passes.h" #include "mlir/Dialect/Quant/Passes.h" -#include "mlir/Dialect/SCF/Passes.h" +#include "mlir/Dialect/SCF/Transforms/Passes.h" #include "mlir/Dialect/SPIRV/Transforms/Passes.h" #include "mlir/Dialect/Shape/Transforms/Passes.h" #include "mlir/Dialect/SparseTensor/Pipelines/Passes.h" diff --git a/mlir/lib/CAPI/Dialect/SCF.cpp b/mlir/lib/CAPI/Dialect/SCF.cpp --- a/mlir/lib/CAPI/Dialect/SCF.cpp +++ b/mlir/lib/CAPI/Dialect/SCF.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir-c/Dialect/SCF.h" #include "mlir/CAPI/Registration.h" diff --git a/mlir/lib/Conversion/AffineToStandard/AffineToStandard.cpp b/mlir/lib/Conversion/AffineToStandard/AffineToStandard.cpp --- a/mlir/lib/Conversion/AffineToStandard/AffineToStandard.cpp +++ b/mlir/lib/Conversion/AffineToStandard/AffineToStandard.cpp @@ -17,7 +17,7 @@ #include "mlir/Dialect/Affine/IR/AffineOps.h" #include "mlir/Dialect/Affine/Utils.h" #include "mlir/Dialect/MemRef/IR/MemRef.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/Vector/IR/VectorOps.h" #include "mlir/IR/BlockAndValueMapping.h" #include "mlir/IR/IntegerSet.h" diff --git a/mlir/lib/Conversion/LinalgToLLVM/LinalgToLLVM.cpp b/mlir/lib/Conversion/LinalgToLLVM/LinalgToLLVM.cpp --- a/mlir/lib/Conversion/LinalgToLLVM/LinalgToLLVM.cpp +++ b/mlir/lib/Conversion/LinalgToLLVM/LinalgToLLVM.cpp @@ -20,7 +20,7 @@ #include "mlir/Dialect/LLVMIR/LLVMDialect.h" #include "mlir/Dialect/Linalg/IR/Linalg.h" #include "mlir/Dialect/Linalg/Passes.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/IR/AffineExpr.h" #include "mlir/IR/AffineMap.h" #include "mlir/IR/Attributes.h" diff --git a/mlir/lib/Conversion/LinalgToStandard/LinalgToStandard.cpp b/mlir/lib/Conversion/LinalgToStandard/LinalgToStandard.cpp --- a/mlir/lib/Conversion/LinalgToStandard/LinalgToStandard.cpp +++ b/mlir/lib/Conversion/LinalgToStandard/LinalgToStandard.cpp @@ -14,7 +14,7 @@ #include "mlir/Dialect/Linalg/IR/Linalg.h" #include "mlir/Dialect/Linalg/Transforms/Transforms.h" #include "mlir/Dialect/MemRef/IR/MemRef.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" using namespace mlir; using namespace mlir::linalg; diff --git a/mlir/lib/Conversion/OpenACCToSCF/OpenACCToSCF.cpp b/mlir/lib/Conversion/OpenACCToSCF/OpenACCToSCF.cpp --- a/mlir/lib/Conversion/OpenACCToSCF/OpenACCToSCF.cpp +++ b/mlir/lib/Conversion/OpenACCToSCF/OpenACCToSCF.cpp @@ -10,7 +10,7 @@ #include "mlir/Conversion/OpenACCToSCF/ConvertOpenACCToSCF.h" #include "mlir/Dialect/Arithmetic/IR/Arithmetic.h" #include "mlir/Dialect/OpenACC/OpenACC.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Transforms/DialectConversion.h" using namespace mlir; diff --git a/mlir/lib/Conversion/SCFToControlFlow/SCFToControlFlow.cpp b/mlir/lib/Conversion/SCFToControlFlow/SCFToControlFlow.cpp --- a/mlir/lib/Conversion/SCFToControlFlow/SCFToControlFlow.cpp +++ b/mlir/lib/Conversion/SCFToControlFlow/SCFToControlFlow.cpp @@ -15,7 +15,7 @@ #include "../PassDetail.h" #include "mlir/Dialect/Arithmetic/IR/Arithmetic.h" #include "mlir/Dialect/ControlFlow/IR/ControlFlowOps.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/IR/BlockAndValueMapping.h" #include "mlir/IR/Builders.h" #include "mlir/IR/BuiltinOps.h" diff --git a/mlir/lib/Conversion/SCFToGPU/SCFToGPU.cpp b/mlir/lib/Conversion/SCFToGPU/SCFToGPU.cpp --- a/mlir/lib/Conversion/SCFToGPU/SCFToGPU.cpp +++ b/mlir/lib/Conversion/SCFToGPU/SCFToGPU.cpp @@ -20,7 +20,7 @@ #include "mlir/Dialect/GPU/IR/GPUDialect.h" #include "mlir/Dialect/GPU/Transforms/ParallelLoopMapper.h" #include "mlir/Dialect/MemRef/IR/MemRef.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/IR/AffineExpr.h" #include "mlir/IR/BlockAndValueMapping.h" #include "mlir/IR/Builders.h" diff --git a/mlir/lib/Conversion/SCFToGPU/SCFToGPUPass.cpp b/mlir/lib/Conversion/SCFToGPU/SCFToGPUPass.cpp --- a/mlir/lib/Conversion/SCFToGPU/SCFToGPUPass.cpp +++ b/mlir/lib/Conversion/SCFToGPU/SCFToGPUPass.cpp @@ -13,7 +13,7 @@ #include "mlir/Dialect/Arithmetic/IR/Arithmetic.h" #include "mlir/Dialect/Complex/IR/Complex.h" #include "mlir/Dialect/GPU/IR/GPUDialect.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Transforms/DialectConversion.h" #include "llvm/ADT/ArrayRef.h" diff --git a/mlir/lib/Conversion/SCFToOpenMP/SCFToOpenMP.cpp b/mlir/lib/Conversion/SCFToOpenMP/SCFToOpenMP.cpp --- a/mlir/lib/Conversion/SCFToOpenMP/SCFToOpenMP.cpp +++ b/mlir/lib/Conversion/SCFToOpenMP/SCFToOpenMP.cpp @@ -19,7 +19,7 @@ #include "mlir/Dialect/LLVMIR/LLVMDialect.h" #include "mlir/Dialect/MemRef/IR/MemRef.h" #include "mlir/Dialect/OpenMP/OpenMPDialect.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/IR/ImplicitLocOpBuilder.h" #include "mlir/IR/SymbolTable.h" #include "mlir/Transforms/DialectConversion.h" diff --git a/mlir/lib/Conversion/SCFToSPIRV/SCFToSPIRV.cpp b/mlir/lib/Conversion/SCFToSPIRV/SCFToSPIRV.cpp --- a/mlir/lib/Conversion/SCFToSPIRV/SCFToSPIRV.cpp +++ b/mlir/lib/Conversion/SCFToSPIRV/SCFToSPIRV.cpp @@ -11,7 +11,7 @@ //===----------------------------------------------------------------------===// #include "mlir/Conversion/SCFToSPIRV/SCFToSPIRV.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/SPIRV/IR/SPIRVDialect.h" #include "mlir/Dialect/SPIRV/IR/SPIRVOps.h" #include "mlir/Dialect/SPIRV/Transforms/SPIRVConversion.h" diff --git a/mlir/lib/Conversion/SCFToSPIRV/SCFToSPIRVPass.cpp b/mlir/lib/Conversion/SCFToSPIRV/SCFToSPIRVPass.cpp --- a/mlir/lib/Conversion/SCFToSPIRV/SCFToSPIRVPass.cpp +++ b/mlir/lib/Conversion/SCFToSPIRV/SCFToSPIRVPass.cpp @@ -17,7 +17,7 @@ #include "mlir/Conversion/FuncToSPIRV/FuncToSPIRV.h" #include "mlir/Conversion/MemRefToSPIRV/MemRefToSPIRV.h" #include "mlir/Conversion/SCFToSPIRV/SCFToSPIRV.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/SPIRV/IR/SPIRVDialect.h" #include "mlir/Dialect/SPIRV/Transforms/SPIRVConversion.h" diff --git a/mlir/lib/Conversion/ShapeToStandard/ConvertShapeConstraints.cpp b/mlir/lib/Conversion/ShapeToStandard/ConvertShapeConstraints.cpp --- a/mlir/lib/Conversion/ShapeToStandard/ConvertShapeConstraints.cpp +++ b/mlir/lib/Conversion/ShapeToStandard/ConvertShapeConstraints.cpp @@ -10,7 +10,7 @@ #include "../PassDetail.h" #include "mlir/Dialect/ControlFlow/IR/ControlFlowOps.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/Shape/IR/Shape.h" #include "mlir/Dialect/Tensor/IR/Tensor.h" #include "mlir/IR/PatternMatch.h" diff --git a/mlir/lib/Conversion/ShapeToStandard/ShapeToStandard.cpp b/mlir/lib/Conversion/ShapeToStandard/ShapeToStandard.cpp --- a/mlir/lib/Conversion/ShapeToStandard/ShapeToStandard.cpp +++ b/mlir/lib/Conversion/ShapeToStandard/ShapeToStandard.cpp @@ -11,7 +11,7 @@ #include "../PassDetail.h" #include "mlir/Dialect/Arithmetic/IR/Arithmetic.h" #include "mlir/Dialect/Func/IR/FuncOps.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/Shape/IR/Shape.h" #include "mlir/Dialect/Tensor/IR/Tensor.h" #include "mlir/IR/BlockAndValueMapping.h" diff --git a/mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp b/mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp --- a/mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp +++ b/mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp @@ -14,7 +14,7 @@ #include "mlir/Dialect/Arithmetic/IR/Arithmetic.h" #include "mlir/Dialect/Linalg/IR/Linalg.h" #include "mlir/Dialect/Math/IR/Math.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/Tensor/IR/Tensor.h" #include "mlir/Dialect/Tensor/Utils/Utils.h" #include "mlir/Dialect/Tosa/IR/TosaOps.h" diff --git a/mlir/lib/Conversion/TosaToLinalg/TosaToLinalgNamed.cpp b/mlir/lib/Conversion/TosaToLinalg/TosaToLinalgNamed.cpp --- a/mlir/lib/Conversion/TosaToLinalg/TosaToLinalgNamed.cpp +++ b/mlir/lib/Conversion/TosaToLinalg/TosaToLinalgNamed.cpp @@ -14,7 +14,7 @@ #include "mlir/Dialect/Arithmetic/IR/Arithmetic.h" #include "mlir/Dialect/Linalg/IR/Linalg.h" #include "mlir/Dialect/Math/IR/Math.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/Tensor/IR/Tensor.h" #include "mlir/Dialect/Tensor/Utils/Utils.h" #include "mlir/Dialect/Tosa/IR/TosaOps.h" diff --git a/mlir/lib/Conversion/TosaToLinalg/TosaToLinalgNamedPass.cpp b/mlir/lib/Conversion/TosaToLinalg/TosaToLinalgNamedPass.cpp --- a/mlir/lib/Conversion/TosaToLinalg/TosaToLinalgNamedPass.cpp +++ b/mlir/lib/Conversion/TosaToLinalg/TosaToLinalgNamedPass.cpp @@ -15,7 +15,7 @@ #include "mlir/Dialect/Arithmetic/IR/Arithmetic.h" #include "mlir/Dialect/Linalg/IR/Linalg.h" #include "mlir/Dialect/Math/IR/Math.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/Tensor/IR/Tensor.h" #include "mlir/Dialect/Tosa/IR/TosaOps.h" #include "mlir/Dialect/Tosa/Transforms/PassDetail.h" diff --git a/mlir/lib/Conversion/TosaToLinalg/TosaToLinalgPass.cpp b/mlir/lib/Conversion/TosaToLinalg/TosaToLinalgPass.cpp --- a/mlir/lib/Conversion/TosaToLinalg/TosaToLinalgPass.cpp +++ b/mlir/lib/Conversion/TosaToLinalg/TosaToLinalgPass.cpp @@ -15,7 +15,7 @@ #include "mlir/Dialect/Arithmetic/IR/Arithmetic.h" #include "mlir/Dialect/Linalg/IR/Linalg.h" #include "mlir/Dialect/Math/IR/Math.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/Tensor/IR/Tensor.h" #include "mlir/Dialect/Tosa/IR/TosaOps.h" #include "mlir/Dialect/Tosa/Transforms/PassDetail.h" diff --git a/mlir/lib/Conversion/TosaToSCF/TosaToSCF.cpp b/mlir/lib/Conversion/TosaToSCF/TosaToSCF.cpp --- a/mlir/lib/Conversion/TosaToSCF/TosaToSCF.cpp +++ b/mlir/lib/Conversion/TosaToSCF/TosaToSCF.cpp @@ -11,7 +11,7 @@ //===----------------------------------------------------------------------===// #include "mlir/Conversion/TosaToSCF/TosaToSCF.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/Tensor/IR/Tensor.h" #include "mlir/Dialect/Tosa/IR/TosaOps.h" #include "mlir/IR/BlockAndValueMapping.h" diff --git a/mlir/lib/Conversion/TosaToSCF/TosaToSCFPass.cpp b/mlir/lib/Conversion/TosaToSCF/TosaToSCFPass.cpp --- a/mlir/lib/Conversion/TosaToSCF/TosaToSCFPass.cpp +++ b/mlir/lib/Conversion/TosaToSCF/TosaToSCFPass.cpp @@ -12,7 +12,7 @@ #include "../PassDetail.h" #include "mlir/Conversion/TosaToSCF/TosaToSCF.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/Tensor/IR/Tensor.h" #include "mlir/Dialect/Tosa/IR/TosaOps.h" #include "mlir/Dialect/Tosa/Transforms/PassDetail.h" diff --git a/mlir/lib/Conversion/VectorToGPU/VectorToGPU.cpp b/mlir/lib/Conversion/VectorToGPU/VectorToGPU.cpp --- a/mlir/lib/Conversion/VectorToGPU/VectorToGPU.cpp +++ b/mlir/lib/Conversion/VectorToGPU/VectorToGPU.cpp @@ -21,7 +21,7 @@ #include "mlir/Dialect/GPU/IR/GPUDialect.h" #include "mlir/Dialect/MemRef/IR/MemRef.h" #include "mlir/Dialect/NVGPU/NVGPUDialect.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/Utils/StructuredOpsUtils.h" #include "mlir/Dialect/Vector/IR/VectorOps.h" #include "mlir/Dialect/Vector/Utils/VectorUtils.h" diff --git a/mlir/lib/Conversion/VectorToSCF/VectorToSCF.cpp b/mlir/lib/Conversion/VectorToSCF/VectorToSCF.cpp --- a/mlir/lib/Conversion/VectorToSCF/VectorToSCF.cpp +++ b/mlir/lib/Conversion/VectorToSCF/VectorToSCF.cpp @@ -18,7 +18,7 @@ #include "mlir/Dialect/Affine/IR/AffineOps.h" #include "mlir/Dialect/Arithmetic/IR/Arithmetic.h" #include "mlir/Dialect/MemRef/IR/MemRef.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/Vector/Transforms/VectorTransforms.h" #include "mlir/IR/Builders.h" #include "mlir/IR/ImplicitLocOpBuilder.h" diff --git a/mlir/lib/Dialect/Affine/Transforms/LoopCoalescing.cpp b/mlir/lib/Dialect/Affine/Transforms/LoopCoalescing.cpp --- a/mlir/lib/Dialect/Affine/Transforms/LoopCoalescing.cpp +++ b/mlir/lib/Dialect/Affine/Transforms/LoopCoalescing.cpp @@ -10,7 +10,7 @@ #include "mlir/Dialect/Affine/IR/AffineOps.h" #include "mlir/Dialect/Affine/LoopUtils.h" #include "mlir/Dialect/Arithmetic/IR/Arithmetic.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/SCF/Utils/Utils.h" #include "mlir/Transforms/Passes.h" #include "mlir/Transforms/RegionUtils.h" diff --git a/mlir/lib/Dialect/Affine/Utils/LoopUtils.cpp b/mlir/lib/Dialect/Affine/Utils/LoopUtils.cpp --- a/mlir/lib/Dialect/Affine/Utils/LoopUtils.cpp +++ b/mlir/lib/Dialect/Affine/Utils/LoopUtils.cpp @@ -20,7 +20,7 @@ #include "mlir/Dialect/Affine/Utils.h" #include "mlir/Dialect/Func/IR/FuncOps.h" #include "mlir/Dialect/MemRef/IR/MemRef.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/IR/BlockAndValueMapping.h" #include "mlir/IR/IntegerSet.h" #include "mlir/Support/MathExtras.h" diff --git a/mlir/lib/Dialect/Async/Transforms/AsyncParallelFor.cpp b/mlir/lib/Dialect/Async/Transforms/AsyncParallelFor.cpp --- a/mlir/lib/Dialect/Async/Transforms/AsyncParallelFor.cpp +++ b/mlir/lib/Dialect/Async/Transforms/AsyncParallelFor.cpp @@ -18,7 +18,7 @@ #include "mlir/Dialect/Async/Passes.h" #include "mlir/Dialect/Async/Transforms.h" #include "mlir/Dialect/Func/IR/FuncOps.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/IR/BlockAndValueMapping.h" #include "mlir/IR/ImplicitLocOpBuilder.h" #include "mlir/IR/Matchers.h" diff --git a/mlir/lib/Dialect/Async/Transforms/AsyncToAsyncRuntime.cpp b/mlir/lib/Dialect/Async/Transforms/AsyncToAsyncRuntime.cpp --- a/mlir/lib/Dialect/Async/Transforms/AsyncToAsyncRuntime.cpp +++ b/mlir/lib/Dialect/Async/Transforms/AsyncToAsyncRuntime.cpp @@ -18,7 +18,7 @@ #include "mlir/Dialect/Async/Passes.h" #include "mlir/Dialect/ControlFlow/IR/ControlFlowOps.h" #include "mlir/Dialect/Func/IR/FuncOps.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/IR/BlockAndValueMapping.h" #include "mlir/IR/ImplicitLocOpBuilder.h" #include "mlir/IR/PatternMatch.h" diff --git a/mlir/lib/Dialect/Func/Transforms/PassDetail.h b/mlir/lib/Dialect/Func/Transforms/PassDetail.h --- a/mlir/lib/Dialect/Func/Transforms/PassDetail.h +++ b/mlir/lib/Dialect/Func/Transforms/PassDetail.h @@ -9,7 +9,7 @@ #ifndef DIALECT_FUNC_TRANSFORMS_PASSDETAIL_H_ #define DIALECT_FUNC_TRANSFORMS_PASSDETAIL_H_ -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/IR/BuiltinOps.h" #include "mlir/Pass/Pass.h" diff --git a/mlir/lib/Dialect/GPU/Transforms/MemoryPromotion.cpp b/mlir/lib/Dialect/GPU/Transforms/MemoryPromotion.cpp --- a/mlir/lib/Dialect/GPU/Transforms/MemoryPromotion.cpp +++ b/mlir/lib/Dialect/GPU/Transforms/MemoryPromotion.cpp @@ -17,7 +17,7 @@ #include "mlir/Dialect/Arithmetic/IR/Arithmetic.h" #include "mlir/Dialect/GPU/IR/GPUDialect.h" #include "mlir/Dialect/MemRef/IR/MemRef.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/IR/ImplicitLocOpBuilder.h" #include "mlir/Pass/Pass.h" diff --git a/mlir/lib/Dialect/GPU/Transforms/ParallelLoopMapper.cpp b/mlir/lib/Dialect/GPU/Transforms/ParallelLoopMapper.cpp --- a/mlir/lib/Dialect/GPU/Transforms/ParallelLoopMapper.cpp +++ b/mlir/lib/Dialect/GPU/Transforms/ParallelLoopMapper.cpp @@ -16,7 +16,7 @@ #include "PassDetail.h" #include "mlir/Dialect/GPU/IR/GPUDialect.h" #include "mlir/Dialect/GPU/Transforms/Passes.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/IR/AffineMap.h" namespace mlir { diff --git a/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp b/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp --- a/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp +++ b/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp @@ -18,7 +18,7 @@ #include "mlir/Dialect/Complex/IR/Complex.h" #include "mlir/Dialect/Math/IR/Math.h" #include "mlir/Dialect/MemRef/IR/MemRef.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/SparseTensor/IR/SparseTensor.h" #include "mlir/Dialect/Tensor/IR/Tensor.h" #include "mlir/Dialect/Utils/ReshapeOpsUtils.h" diff --git a/mlir/lib/Dialect/Linalg/Transforms/CodegenStrategy.cpp b/mlir/lib/Dialect/Linalg/Transforms/CodegenStrategy.cpp --- a/mlir/lib/Dialect/Linalg/Transforms/CodegenStrategy.cpp +++ b/mlir/lib/Dialect/Linalg/Transforms/CodegenStrategy.cpp @@ -14,7 +14,7 @@ #include "mlir/Dialect/Linalg/Transforms/CodegenStrategy.h" #include "mlir/Dialect/Linalg/Passes.h" #include "mlir/Dialect/Linalg/Transforms/Hoisting.h" -#include "mlir/Dialect/SCF/Transforms.h" +#include "mlir/Dialect/SCF/Transforms/Transforms.h" #include "mlir/Dialect/Vector/IR/VectorOps.h" #include "mlir/Dialect/Vector/Transforms/VectorTransforms.h" #include "mlir/Pass/PassManager.h" diff --git a/mlir/lib/Dialect/Linalg/Transforms/HoistPadding.cpp b/mlir/lib/Dialect/Linalg/Transforms/HoistPadding.cpp --- a/mlir/lib/Dialect/Linalg/Transforms/HoistPadding.cpp +++ b/mlir/lib/Dialect/Linalg/Transforms/HoistPadding.cpp @@ -16,7 +16,7 @@ #include "mlir/Dialect/Func/IR/FuncOps.h" #include "mlir/Dialect/Linalg/IR/Linalg.h" #include "mlir/Dialect/Linalg/Transforms/Transforms.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/SCF/Utils/Utils.h" #include "mlir/Dialect/Tensor/IR/Tensor.h" #include "mlir/Dialect/Utils/IndexingUtils.h" diff --git a/mlir/lib/Dialect/Linalg/Transforms/Hoisting.cpp b/mlir/lib/Dialect/Linalg/Transforms/Hoisting.cpp --- a/mlir/lib/Dialect/Linalg/Transforms/Hoisting.cpp +++ b/mlir/lib/Dialect/Linalg/Transforms/Hoisting.cpp @@ -19,7 +19,7 @@ #include "mlir/Dialect/Func/IR/FuncOps.h" #include "mlir/Dialect/Linalg/IR/Linalg.h" #include "mlir/Dialect/Linalg/Transforms/Transforms.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/SCF/Utils/Utils.h" #include "mlir/Dialect/Tensor/IR/Tensor.h" #include "mlir/Dialect/Vector/IR/VectorOps.h" diff --git a/mlir/lib/Dialect/Linalg/Transforms/LinalgStrategyPasses.cpp b/mlir/lib/Dialect/Linalg/Transforms/LinalgStrategyPasses.cpp --- a/mlir/lib/Dialect/Linalg/Transforms/LinalgStrategyPasses.cpp +++ b/mlir/lib/Dialect/Linalg/Transforms/LinalgStrategyPasses.cpp @@ -23,7 +23,7 @@ #include "mlir/Dialect/Linalg/Transforms/Hoisting.h" #include "mlir/Dialect/Linalg/Transforms/Transforms.h" #include "mlir/Dialect/Linalg/Utils/Utils.h" -#include "mlir/Dialect/SCF/Transforms.h" +#include "mlir/Dialect/SCF/Transforms/Transforms.h" #include "mlir/Dialect/Tensor/IR/Tensor.h" #include "mlir/Dialect/Vector/Transforms/VectorTransforms.h" #include "mlir/IR/AffineExpr.h" diff --git a/mlir/lib/Dialect/Linalg/Transforms/Loops.cpp b/mlir/lib/Dialect/Linalg/Transforms/Loops.cpp --- a/mlir/lib/Dialect/Linalg/Transforms/Loops.cpp +++ b/mlir/lib/Dialect/Linalg/Transforms/Loops.cpp @@ -13,7 +13,7 @@ #include "mlir/Dialect/Linalg/Passes.h" #include "mlir/Dialect/Linalg/Transforms/Transforms.h" #include "mlir/Dialect/Linalg/Utils/Utils.h" -#include "mlir/Dialect/SCF/Transforms.h" +#include "mlir/Dialect/SCF/Transforms/Transforms.h" #include "mlir/Dialect/SCF/Utils/AffineCanonicalizationUtils.h" #include "mlir/IR/AffineExpr.h" #include "mlir/IR/AffineMap.h" diff --git a/mlir/lib/Dialect/Linalg/Transforms/Promotion.cpp b/mlir/lib/Dialect/Linalg/Transforms/Promotion.cpp --- a/mlir/lib/Dialect/Linalg/Transforms/Promotion.cpp +++ b/mlir/lib/Dialect/Linalg/Transforms/Promotion.cpp @@ -17,7 +17,7 @@ #include "mlir/Dialect/Linalg/Passes.h" #include "mlir/Dialect/Linalg/Transforms/Transforms.h" #include "mlir/Dialect/Linalg/Utils/Utils.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/IR/AffineExpr.h" #include "mlir/IR/AffineExprVisitor.h" #include "mlir/IR/AffineMap.h" diff --git a/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp b/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp --- a/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp +++ b/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp @@ -18,7 +18,7 @@ #include "mlir/Dialect/Linalg/Transforms/Transforms.h" #include "mlir/Dialect/Linalg/Utils/Utils.h" #include "mlir/Dialect/MemRef/IR/MemRef.h" -#include "mlir/Dialect/SCF/Transforms.h" +#include "mlir/Dialect/SCF/Transforms/Transforms.h" #include "mlir/Dialect/Tensor/IR/Tensor.h" #include "mlir/Dialect/Utils/IndexingUtils.h" #include "mlir/IR/AffineExpr.h" diff --git a/mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp b/mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp --- a/mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp +++ b/mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp @@ -19,7 +19,7 @@ #include "mlir/Dialect/Linalg/IR/Linalg.h" #include "mlir/Dialect/Linalg/Transforms/HoistPadding.h" #include "mlir/Dialect/Linalg/Utils/Utils.h" -#include "mlir/Dialect/SCF/Transforms.h" +#include "mlir/Dialect/SCF/Transforms/Transforms.h" #include "mlir/Dialect/Tensor/IR/Tensor.h" #include "mlir/Dialect/Tensor/IR/TensorTilingInterfaceImpl.h" #include "mlir/Dialect/Utils/StaticValueUtils.h" diff --git a/mlir/lib/Dialect/Linalg/Utils/Utils.cpp b/mlir/lib/Dialect/Linalg/Utils/Utils.cpp --- a/mlir/lib/Dialect/Linalg/Utils/Utils.cpp +++ b/mlir/lib/Dialect/Linalg/Utils/Utils.cpp @@ -21,7 +21,7 @@ #include "mlir/Dialect/Arithmetic/Utils/Utils.h" #include "mlir/Dialect/Linalg/IR/Linalg.h" #include "mlir/Dialect/MemRef/IR/MemRef.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/Tensor/IR/Tensor.h" #include "mlir/Dialect/Tensor/Utils/Utils.h" #include "mlir/Dialect/Utils/StaticValueUtils.h" diff --git a/mlir/lib/Dialect/Math/Transforms/ExpandPatterns.cpp b/mlir/lib/Dialect/Math/Transforms/ExpandPatterns.cpp --- a/mlir/lib/Dialect/Math/Transforms/ExpandPatterns.cpp +++ b/mlir/lib/Dialect/Math/Transforms/ExpandPatterns.cpp @@ -13,7 +13,7 @@ #include "mlir/Dialect/Arithmetic/IR/Arithmetic.h" #include "mlir/Dialect/Math/IR/Math.h" #include "mlir/Dialect/Math/Transforms/Passes.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/IR/Builders.h" #include "mlir/Transforms/DialectConversion.h" diff --git a/mlir/lib/Dialect/SCF/CMakeLists.txt b/mlir/lib/Dialect/SCF/CMakeLists.txt --- a/mlir/lib/Dialect/SCF/CMakeLists.txt +++ b/mlir/lib/Dialect/SCF/CMakeLists.txt @@ -1,21 +1,4 @@ -add_mlir_dialect_library(MLIRSCFDialect - SCF.cpp - - ADDITIONAL_HEADER_DIRS - ${MLIR_MAIN_INCLUDE_DIR}/mlir/LoopOps - - DEPENDS - MLIRSCFOpsIncGen - - LINK_LIBS PUBLIC - MLIRArithmeticDialect - MLIRBufferizationDialect - MLIRControlFlowDialect - MLIRIR - MLIRLoopLikeInterface - MLIRSideEffectInterfaces - ) - +add_subdirectory(IR) add_subdirectory(TransformOps) add_subdirectory(Transforms) add_subdirectory(Utils) diff --git a/mlir/lib/Dialect/SCF/CMakeLists.txt b/mlir/lib/Dialect/SCF/IR/CMakeLists.txt copy from mlir/lib/Dialect/SCF/CMakeLists.txt copy to mlir/lib/Dialect/SCF/IR/CMakeLists.txt --- a/mlir/lib/Dialect/SCF/CMakeLists.txt +++ b/mlir/lib/Dialect/SCF/IR/CMakeLists.txt @@ -2,7 +2,7 @@ SCF.cpp ADDITIONAL_HEADER_DIRS - ${MLIR_MAIN_INCLUDE_DIR}/mlir/LoopOps + ${MLIR_MAIN_INCLUDE_DIR}/mlir/SCF DEPENDS MLIRSCFOpsIncGen @@ -16,6 +16,3 @@ MLIRSideEffectInterfaces ) -add_subdirectory(TransformOps) -add_subdirectory(Transforms) -add_subdirectory(Utils) diff --git a/mlir/lib/Dialect/SCF/SCF.cpp b/mlir/lib/Dialect/SCF/IR/SCF.cpp rename from mlir/lib/Dialect/SCF/SCF.cpp rename to mlir/lib/Dialect/SCF/IR/SCF.cpp --- a/mlir/lib/Dialect/SCF/SCF.cpp +++ b/mlir/lib/Dialect/SCF/IR/SCF.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/Arithmetic/IR/Arithmetic.h" #include "mlir/Dialect/Arithmetic/Utils/Utils.h" #include "mlir/Dialect/Bufferization/IR/Bufferization.h" @@ -23,7 +23,7 @@ using namespace mlir; using namespace mlir::scf; -#include "mlir/Dialect/SCF/SCFOpsDialect.cpp.inc" +#include "mlir/Dialect/SCF/IR/SCFOpsDialect.cpp.inc" //===----------------------------------------------------------------------===// // SCFDialect Dialect Interfaces @@ -66,7 +66,7 @@ void SCFDialect::initialize() { addOperations< #define GET_OP_LIST -#include "mlir/Dialect/SCF/SCFOps.cpp.inc" +#include "mlir/Dialect/SCF/IR/SCFOps.cpp.inc" >(); addInterfaces(); } @@ -3325,4 +3325,4 @@ //===----------------------------------------------------------------------===// #define GET_OP_CLASSES -#include "mlir/Dialect/SCF/SCFOps.cpp.inc" +#include "mlir/Dialect/SCF/IR/SCFOps.cpp.inc" diff --git a/mlir/lib/Dialect/SCF/TransformOps/SCFTransformOps.cpp b/mlir/lib/Dialect/SCF/TransformOps/SCFTransformOps.cpp --- a/mlir/lib/Dialect/SCF/TransformOps/SCFTransformOps.cpp +++ b/mlir/lib/Dialect/SCF/TransformOps/SCFTransformOps.cpp @@ -9,9 +9,9 @@ #include "mlir/Dialect/SCF/TransformOps/SCFTransformOps.h" #include "mlir/Dialect/Affine/IR/AffineOps.h" #include "mlir/Dialect/Func/IR/FuncOps.h" -#include "mlir/Dialect/SCF/Patterns.h" -#include "mlir/Dialect/SCF/SCF.h" -#include "mlir/Dialect/SCF/Transforms.h" +#include "mlir/Dialect/SCF/IR/SCF.h" +#include "mlir/Dialect/SCF/Transforms/Patterns.h" +#include "mlir/Dialect/SCF/Transforms/Transforms.h" #include "mlir/Dialect/SCF/Utils/Utils.h" #include "mlir/Dialect/Transform/IR/TransformDialect.h" #include "mlir/Dialect/Transform/IR/TransformInterfaces.h" diff --git a/mlir/lib/Dialect/SCF/Transforms/BufferizableOpInterfaceImpl.cpp b/mlir/lib/Dialect/SCF/Transforms/BufferizableOpInterfaceImpl.cpp --- a/mlir/lib/Dialect/SCF/Transforms/BufferizableOpInterfaceImpl.cpp +++ b/mlir/lib/Dialect/SCF/Transforms/BufferizableOpInterfaceImpl.cpp @@ -6,13 +6,13 @@ // //===----------------------------------------------------------------------===// -#include "mlir/Dialect/SCF/BufferizableOpInterfaceImpl.h" +#include "mlir/Dialect/SCF/Transforms/BufferizableOpInterfaceImpl.h" #include "mlir/Dialect/Bufferization/IR/BufferizableOpInterface.h" #include "mlir/Dialect/Bufferization/IR/Bufferization.h" #include "mlir/Dialect/Bufferization/Transforms/OneShotAnalysis.h" #include "mlir/Dialect/MemRef/IR/MemRef.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/Tensor/IR/Tensor.h" #include "mlir/IR/Dialect.h" #include "mlir/IR/Operation.h" diff --git a/mlir/lib/Dialect/SCF/Transforms/Bufferize.cpp b/mlir/lib/Dialect/SCF/Transforms/Bufferize.cpp --- a/mlir/lib/Dialect/SCF/Transforms/Bufferize.cpp +++ b/mlir/lib/Dialect/SCF/Transforms/Bufferize.cpp @@ -10,9 +10,9 @@ #include "PassDetail.h" #include "mlir/Dialect/Bufferization/IR/Bufferization.h" #include "mlir/Dialect/MemRef/IR/MemRef.h" -#include "mlir/Dialect/SCF/Passes.h" -#include "mlir/Dialect/SCF/SCF.h" -#include "mlir/Dialect/SCF/Transforms.h" +#include "mlir/Dialect/SCF/IR/SCF.h" +#include "mlir/Dialect/SCF/Transforms/Passes.h" +#include "mlir/Dialect/SCF/Transforms/Transforms.h" #include "mlir/Transforms/DialectConversion.h" using namespace mlir; diff --git a/mlir/lib/Dialect/SCF/Transforms/ForToWhile.cpp b/mlir/lib/Dialect/SCF/Transforms/ForToWhile.cpp --- a/mlir/lib/Dialect/SCF/Transforms/ForToWhile.cpp +++ b/mlir/lib/Dialect/SCF/Transforms/ForToWhile.cpp @@ -12,9 +12,9 @@ #include "PassDetail.h" #include "mlir/Dialect/Arithmetic/IR/Arithmetic.h" -#include "mlir/Dialect/SCF/Passes.h" -#include "mlir/Dialect/SCF/SCF.h" -#include "mlir/Dialect/SCF/Transforms.h" +#include "mlir/Dialect/SCF/IR/SCF.h" +#include "mlir/Dialect/SCF/Transforms/Passes.h" +#include "mlir/Dialect/SCF/Transforms/Transforms.h" #include "mlir/IR/PatternMatch.h" #include "mlir/Transforms/GreedyPatternRewriteDriver.h" diff --git a/mlir/lib/Dialect/SCF/Transforms/LoopCanonicalization.cpp b/mlir/lib/Dialect/SCF/Transforms/LoopCanonicalization.cpp --- a/mlir/lib/Dialect/SCF/Transforms/LoopCanonicalization.cpp +++ b/mlir/lib/Dialect/SCF/Transforms/LoopCanonicalization.cpp @@ -14,9 +14,9 @@ #include "PassDetail.h" #include "mlir/Dialect/Affine/IR/AffineOps.h" #include "mlir/Dialect/MemRef/IR/MemRef.h" -#include "mlir/Dialect/SCF/Passes.h" -#include "mlir/Dialect/SCF/SCF.h" -#include "mlir/Dialect/SCF/Transforms.h" +#include "mlir/Dialect/SCF/IR/SCF.h" +#include "mlir/Dialect/SCF/Transforms/Passes.h" +#include "mlir/Dialect/SCF/Transforms/Transforms.h" #include "mlir/Dialect/SCF/Utils/AffineCanonicalizationUtils.h" #include "mlir/Dialect/Tensor/IR/Tensor.h" #include "mlir/IR/PatternMatch.h" diff --git a/mlir/lib/Dialect/SCF/Transforms/LoopPipelining.cpp b/mlir/lib/Dialect/SCF/Transforms/LoopPipelining.cpp --- a/mlir/lib/Dialect/SCF/Transforms/LoopPipelining.cpp +++ b/mlir/lib/Dialect/SCF/Transforms/LoopPipelining.cpp @@ -12,9 +12,9 @@ #include "PassDetail.h" #include "mlir/Dialect/Arithmetic/IR/Arithmetic.h" -#include "mlir/Dialect/SCF/Patterns.h" -#include "mlir/Dialect/SCF/SCF.h" -#include "mlir/Dialect/SCF/Transforms.h" +#include "mlir/Dialect/SCF/IR/SCF.h" +#include "mlir/Dialect/SCF/Transforms/Patterns.h" +#include "mlir/Dialect/SCF/Transforms/Transforms.h" #include "mlir/Dialect/SCF/Utils/Utils.h" #include "mlir/IR/BlockAndValueMapping.h" #include "mlir/IR/PatternMatch.h" diff --git a/mlir/lib/Dialect/SCF/Transforms/LoopRangeFolding.cpp b/mlir/lib/Dialect/SCF/Transforms/LoopRangeFolding.cpp --- a/mlir/lib/Dialect/SCF/Transforms/LoopRangeFolding.cpp +++ b/mlir/lib/Dialect/SCF/Transforms/LoopRangeFolding.cpp @@ -12,9 +12,9 @@ #include "PassDetail.h" #include "mlir/Dialect/Arithmetic/IR/Arithmetic.h" -#include "mlir/Dialect/SCF/Passes.h" -#include "mlir/Dialect/SCF/SCF.h" -#include "mlir/Dialect/SCF/Transforms.h" +#include "mlir/Dialect/SCF/IR/SCF.h" +#include "mlir/Dialect/SCF/Transforms/Passes.h" +#include "mlir/Dialect/SCF/Transforms/Transforms.h" #include "mlir/Dialect/SCF/Utils/Utils.h" #include "mlir/IR/BlockAndValueMapping.h" diff --git a/mlir/lib/Dialect/SCF/Transforms/LoopSpecialization.cpp b/mlir/lib/Dialect/SCF/Transforms/LoopSpecialization.cpp --- a/mlir/lib/Dialect/SCF/Transforms/LoopSpecialization.cpp +++ b/mlir/lib/Dialect/SCF/Transforms/LoopSpecialization.cpp @@ -15,9 +15,9 @@ #include "mlir/Dialect/Affine/Analysis/AffineStructures.h" #include "mlir/Dialect/Affine/IR/AffineOps.h" #include "mlir/Dialect/Arithmetic/IR/Arithmetic.h" -#include "mlir/Dialect/SCF/Passes.h" -#include "mlir/Dialect/SCF/SCF.h" -#include "mlir/Dialect/SCF/Transforms.h" +#include "mlir/Dialect/SCF/IR/SCF.h" +#include "mlir/Dialect/SCF/Transforms/Passes.h" +#include "mlir/Dialect/SCF/Transforms/Transforms.h" #include "mlir/Dialect/SCF/Utils/AffineCanonicalizationUtils.h" #include "mlir/Dialect/Utils/StaticValueUtils.h" #include "mlir/IR/AffineExpr.h" diff --git a/mlir/lib/Dialect/SCF/Transforms/ParallelLoopCollapsing.cpp b/mlir/lib/Dialect/SCF/Transforms/ParallelLoopCollapsing.cpp --- a/mlir/lib/Dialect/SCF/Transforms/ParallelLoopCollapsing.cpp +++ b/mlir/lib/Dialect/SCF/Transforms/ParallelLoopCollapsing.cpp @@ -7,8 +7,8 @@ //===----------------------------------------------------------------------===// #include "PassDetail.h" -#include "mlir/Dialect/SCF/Passes.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" +#include "mlir/Dialect/SCF/Transforms/Passes.h" #include "mlir/Dialect/SCF/Utils/Utils.h" #include "mlir/Transforms/RegionUtils.h" #include "llvm/Support/CommandLine.h" diff --git a/mlir/lib/Dialect/SCF/Transforms/ParallelLoopFusion.cpp b/mlir/lib/Dialect/SCF/Transforms/ParallelLoopFusion.cpp --- a/mlir/lib/Dialect/SCF/Transforms/ParallelLoopFusion.cpp +++ b/mlir/lib/Dialect/SCF/Transforms/ParallelLoopFusion.cpp @@ -12,9 +12,9 @@ #include "PassDetail.h" #include "mlir/Dialect/MemRef/IR/MemRef.h" -#include "mlir/Dialect/SCF/Passes.h" -#include "mlir/Dialect/SCF/SCF.h" -#include "mlir/Dialect/SCF/Transforms.h" +#include "mlir/Dialect/SCF/IR/SCF.h" +#include "mlir/Dialect/SCF/Transforms/Passes.h" +#include "mlir/Dialect/SCF/Transforms/Transforms.h" #include "mlir/IR/BlockAndValueMapping.h" #include "mlir/IR/Builders.h" #include "mlir/IR/OpDefinition.h" diff --git a/mlir/lib/Dialect/SCF/Transforms/ParallelLoopTiling.cpp b/mlir/lib/Dialect/SCF/Transforms/ParallelLoopTiling.cpp --- a/mlir/lib/Dialect/SCF/Transforms/ParallelLoopTiling.cpp +++ b/mlir/lib/Dialect/SCF/Transforms/ParallelLoopTiling.cpp @@ -13,9 +13,9 @@ #include "PassDetail.h" #include "mlir/Dialect/Affine/IR/AffineOps.h" #include "mlir/Dialect/Arithmetic/IR/Arithmetic.h" -#include "mlir/Dialect/SCF/Passes.h" -#include "mlir/Dialect/SCF/SCF.h" -#include "mlir/Dialect/SCF/Transforms.h" +#include "mlir/Dialect/SCF/IR/SCF.h" +#include "mlir/Dialect/SCF/Transforms/Passes.h" +#include "mlir/Dialect/SCF/Transforms/Transforms.h" #include "mlir/Dialect/SCF/Utils/Utils.h" using namespace mlir; diff --git a/mlir/lib/Dialect/SCF/Transforms/PassDetail.h b/mlir/lib/Dialect/SCF/Transforms/PassDetail.h --- a/mlir/lib/Dialect/SCF/Transforms/PassDetail.h +++ b/mlir/lib/Dialect/SCF/Transforms/PassDetail.h @@ -36,7 +36,7 @@ } // namespace tensor #define GEN_PASS_CLASSES -#include "mlir/Dialect/SCF/Passes.h.inc" +#include "mlir/Dialect/SCF/Transforms/Passes.h.inc" } // namespace mlir diff --git a/mlir/lib/Dialect/SCF/Transforms/StructuralTypeConversions.cpp b/mlir/lib/Dialect/SCF/Transforms/StructuralTypeConversions.cpp --- a/mlir/lib/Dialect/SCF/Transforms/StructuralTypeConversions.cpp +++ b/mlir/lib/Dialect/SCF/Transforms/StructuralTypeConversions.cpp @@ -7,9 +7,9 @@ //===----------------------------------------------------------------------===// #include "PassDetail.h" -#include "mlir/Dialect/SCF/Passes.h" -#include "mlir/Dialect/SCF/SCF.h" -#include "mlir/Dialect/SCF/Transforms.h" +#include "mlir/Dialect/SCF/IR/SCF.h" +#include "mlir/Dialect/SCF/Transforms/Passes.h" +#include "mlir/Dialect/SCF/Transforms/Transforms.h" #include "mlir/Transforms/DialectConversion.h" using namespace mlir; diff --git a/mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.cpp b/mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.cpp --- a/mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.cpp +++ b/mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.cpp @@ -10,7 +10,7 @@ // //===----------------------------------------------------------------------===// -#include "mlir/Dialect/SCF/TileUsingInterface.h" +#include "mlir/Dialect/SCF/Transforms/TileUsingInterface.h" #include "mlir/Dialect/Affine/IR/AffineOps.h" #include "mlir/Dialect/Arithmetic/IR/Arithmetic.h" diff --git a/mlir/lib/Dialect/SCF/Utils/AffineCanonicalizationUtils.cpp b/mlir/lib/Dialect/SCF/Utils/AffineCanonicalizationUtils.cpp --- a/mlir/lib/Dialect/SCF/Utils/AffineCanonicalizationUtils.cpp +++ b/mlir/lib/Dialect/SCF/Utils/AffineCanonicalizationUtils.cpp @@ -13,7 +13,7 @@ #include "mlir/Dialect/SCF/Utils/AffineCanonicalizationUtils.h" #include "mlir/Dialect/Affine/Analysis/AffineStructures.h" #include "mlir/Dialect/Affine/IR/AffineOps.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/Utils/StaticValueUtils.h" #include "mlir/IR/AffineMap.h" #include "mlir/IR/Matchers.h" diff --git a/mlir/lib/Dialect/SCF/Utils/Utils.cpp b/mlir/lib/Dialect/SCF/Utils/Utils.cpp --- a/mlir/lib/Dialect/SCF/Utils/Utils.cpp +++ b/mlir/lib/Dialect/SCF/Utils/Utils.cpp @@ -14,7 +14,7 @@ #include "mlir/Analysis/SliceAnalysis.h" #include "mlir/Dialect/Arithmetic/IR/Arithmetic.h" #include "mlir/Dialect/Func/IR/FuncOps.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/IR/BlockAndValueMapping.h" #include "mlir/IR/BuiltinOps.h" #include "mlir/IR/PatternMatch.h" diff --git a/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorConversion.cpp b/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorConversion.cpp --- a/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorConversion.cpp +++ b/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorConversion.cpp @@ -21,7 +21,7 @@ #include "mlir/Dialect/LLVMIR/LLVMDialect.h" #include "mlir/Dialect/Linalg/Utils/Utils.h" #include "mlir/Dialect/MemRef/IR/MemRef.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/SparseTensor/IR/SparseTensor.h" #include "mlir/Dialect/SparseTensor/Transforms/Passes.h" #include "mlir/Dialect/Tensor/IR/Tensor.h" diff --git a/mlir/lib/Dialect/SparseTensor/Transforms/Sparsification.cpp b/mlir/lib/Dialect/SparseTensor/Transforms/Sparsification.cpp --- a/mlir/lib/Dialect/SparseTensor/Transforms/Sparsification.cpp +++ b/mlir/lib/Dialect/SparseTensor/Transforms/Sparsification.cpp @@ -21,8 +21,8 @@ #include "mlir/Dialect/Linalg/IR/Linalg.h" #include "mlir/Dialect/Linalg/Utils/Utils.h" #include "mlir/Dialect/MemRef/IR/MemRef.h" -#include "mlir/Dialect/SCF/SCF.h" -#include "mlir/Dialect/SCF/Transforms.h" +#include "mlir/Dialect/SCF/IR/SCF.h" +#include "mlir/Dialect/SCF/Transforms/Transforms.h" #include "mlir/Dialect/SparseTensor/IR/SparseTensor.h" #include "mlir/Dialect/SparseTensor/Transforms/Passes.h" #include "mlir/Dialect/SparseTensor/Utils/Merger.h" diff --git a/mlir/lib/Dialect/Tensor/IR/TensorTilingInterfaceImpl.cpp b/mlir/lib/Dialect/Tensor/IR/TensorTilingInterfaceImpl.cpp --- a/mlir/lib/Dialect/Tensor/IR/TensorTilingInterfaceImpl.cpp +++ b/mlir/lib/Dialect/Tensor/IR/TensorTilingInterfaceImpl.cpp @@ -10,7 +10,7 @@ #include "mlir/Dialect/Affine/IR/AffineOps.h" #include "mlir/Dialect/Arithmetic/Utils/Utils.h" #include "mlir/Dialect/Linalg/IR/Linalg.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/Tensor/IR/Tensor.h" #include "mlir/Interfaces/TilingInterface.h" diff --git a/mlir/lib/Dialect/Tensor/Transforms/BufferizableOpInterfaceImpl.cpp b/mlir/lib/Dialect/Tensor/Transforms/BufferizableOpInterfaceImpl.cpp --- a/mlir/lib/Dialect/Tensor/Transforms/BufferizableOpInterfaceImpl.cpp +++ b/mlir/lib/Dialect/Tensor/Transforms/BufferizableOpInterfaceImpl.cpp @@ -10,7 +10,7 @@ #include "mlir/Dialect/Arithmetic/IR/Arithmetic.h" #include "mlir/Dialect/Bufferization/IR/BufferizableOpInterface.h" #include "mlir/Dialect/MemRef/IR/MemRef.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/Tensor/IR/Tensor.h" #include "mlir/IR/Dialect.h" #include "mlir/IR/Operation.h" diff --git a/mlir/lib/Dialect/Tensor/Transforms/Bufferize.cpp b/mlir/lib/Dialect/Tensor/Transforms/Bufferize.cpp --- a/mlir/lib/Dialect/Tensor/Transforms/Bufferize.cpp +++ b/mlir/lib/Dialect/Tensor/Transforms/Bufferize.cpp @@ -16,7 +16,7 @@ #include "mlir/Dialect/Bufferization/IR/BufferizableOpInterface.h" #include "mlir/Dialect/Bufferization/IR/Bufferization.h" #include "mlir/Dialect/MemRef/IR/MemRef.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/Tensor/IR/Tensor.h" #include "mlir/Dialect/Tensor/Transforms/BufferizableOpInterfaceImpl.h" #include "mlir/Dialect/Tensor/Transforms/Passes.h" diff --git a/mlir/lib/Dialect/Tensor/Transforms/SplitPadding.cpp b/mlir/lib/Dialect/Tensor/Transforms/SplitPadding.cpp --- a/mlir/lib/Dialect/Tensor/Transforms/SplitPadding.cpp +++ b/mlir/lib/Dialect/Tensor/Transforms/SplitPadding.cpp @@ -13,7 +13,7 @@ //===----------------------------------------------------------------------===// #include "mlir/Dialect/Arithmetic/IR/Arithmetic.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/Tensor/IR/Tensor.h" #include "mlir/Dialect/Tensor/Transforms/Transforms.h" #include "mlir/Dialect/Utils/StaticValueUtils.h" diff --git a/mlir/lib/Dialect/Vector/Transforms/VectorDistribute.cpp b/mlir/lib/Dialect/Vector/Transforms/VectorDistribute.cpp --- a/mlir/lib/Dialect/Vector/Transforms/VectorDistribute.cpp +++ b/mlir/lib/Dialect/Vector/Transforms/VectorDistribute.cpp @@ -9,7 +9,7 @@ #include "mlir/Dialect/Affine/IR/AffineOps.h" #include "mlir/Dialect/Arithmetic/IR/Arithmetic.h" #include "mlir/Dialect/MemRef/IR/MemRef.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/Vector/Transforms/VectorDistribution.h" #include "mlir/Dialect/Vector/Utils/VectorUtils.h" #include "mlir/IR/BlockAndValueMapping.h" diff --git a/mlir/lib/Dialect/Vector/Transforms/VectorTransferSplitRewritePatterns.cpp b/mlir/lib/Dialect/Vector/Transforms/VectorTransferSplitRewritePatterns.cpp --- a/mlir/lib/Dialect/Vector/Transforms/VectorTransferSplitRewritePatterns.cpp +++ b/mlir/lib/Dialect/Vector/Transforms/VectorTransferSplitRewritePatterns.cpp @@ -17,7 +17,7 @@ #include "mlir/Dialect/Arithmetic/IR/Arithmetic.h" #include "mlir/Dialect/Linalg/IR/Linalg.h" #include "mlir/Dialect/MemRef/IR/MemRef.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/Utils/StructuredOpsUtils.h" #include "mlir/Dialect/Vector/Transforms/VectorTransforms.h" diff --git a/mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp b/mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp --- a/mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp +++ b/mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp @@ -19,7 +19,7 @@ #include "mlir/Dialect/Arithmetic/Utils/Utils.h" #include "mlir/Dialect/Linalg/IR/Linalg.h" #include "mlir/Dialect/MemRef/IR/MemRef.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/Utils/IndexingUtils.h" #include "mlir/Dialect/Utils/StructuredOpsUtils.h" #include "mlir/Dialect/Vector/Utils/VectorUtils.h" diff --git a/mlir/lib/Target/Cpp/TranslateRegistration.cpp b/mlir/lib/Target/Cpp/TranslateRegistration.cpp --- a/mlir/lib/Target/Cpp/TranslateRegistration.cpp +++ b/mlir/lib/Target/Cpp/TranslateRegistration.cpp @@ -11,7 +11,7 @@ #include "mlir/Dialect/EmitC/IR/EmitC.h" #include "mlir/Dialect/Func/IR/FuncOps.h" #include "mlir/Dialect/Math/IR/Math.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/IR/BuiltinOps.h" #include "mlir/IR/Dialect.h" #include "mlir/Target/Cpp/CppEmitter.h" diff --git a/mlir/lib/Target/Cpp/TranslateToCpp.cpp b/mlir/lib/Target/Cpp/TranslateToCpp.cpp --- a/mlir/lib/Target/Cpp/TranslateToCpp.cpp +++ b/mlir/lib/Target/Cpp/TranslateToCpp.cpp @@ -10,7 +10,7 @@ #include "mlir/Dialect/ControlFlow/IR/ControlFlowOps.h" #include "mlir/Dialect/EmitC/IR/EmitC.h" #include "mlir/Dialect/Func/IR/FuncOps.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/IR/BuiltinOps.h" #include "mlir/IR/BuiltinTypes.h" #include "mlir/IR/Dialect.h" diff --git a/mlir/python/mlir/dialects/SCFOps.td b/mlir/python/mlir/dialects/SCFOps.td --- a/mlir/python/mlir/dialects/SCFOps.td +++ b/mlir/python/mlir/dialects/SCFOps.td @@ -10,6 +10,6 @@ #define PYTHON_BINDINGS_SCF_OPS include "mlir/Bindings/Python/Attributes.td" -include "mlir/Dialect/SCF/SCFOps.td" +include "mlir/Dialect/SCF/IR/SCFOps.td" #endif diff --git a/mlir/test/lib/Dialect/Affine/TestLoopMapping.cpp b/mlir/test/lib/Dialect/Affine/TestLoopMapping.cpp --- a/mlir/test/lib/Dialect/Affine/TestLoopMapping.cpp +++ b/mlir/test/lib/Dialect/Affine/TestLoopMapping.cpp @@ -13,7 +13,7 @@ #include "mlir/Dialect/Affine/IR/AffineOps.h" #include "mlir/Dialect/Affine/LoopUtils.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/IR/Builders.h" #include "mlir/Pass/Pass.h" diff --git a/mlir/test/lib/Dialect/GPU/TestGpuMemoryPromotion.cpp b/mlir/test/lib/Dialect/GPU/TestGpuMemoryPromotion.cpp --- a/mlir/test/lib/Dialect/GPU/TestGpuMemoryPromotion.cpp +++ b/mlir/test/lib/Dialect/GPU/TestGpuMemoryPromotion.cpp @@ -15,7 +15,7 @@ #include "mlir/Dialect/GPU/IR/GPUDialect.h" #include "mlir/Dialect/GPU/Transforms/MemoryPromotion.h" #include "mlir/Dialect/MemRef/IR/MemRef.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/SPIRV/IR/SPIRVDialect.h" #include "mlir/IR/Attributes.h" #include "mlir/Pass/Pass.h" diff --git a/mlir/test/lib/Dialect/Linalg/TestLinalgFusionTransforms.cpp b/mlir/test/lib/Dialect/Linalg/TestLinalgFusionTransforms.cpp --- a/mlir/test/lib/Dialect/Linalg/TestLinalgFusionTransforms.cpp +++ b/mlir/test/lib/Dialect/Linalg/TestLinalgFusionTransforms.cpp @@ -14,7 +14,7 @@ #include "mlir/Dialect/Func/IR/FuncOps.h" #include "mlir/Dialect/Linalg/Analysis/DependenceAnalysis.h" #include "mlir/Dialect/Linalg/Transforms/Transforms.h" -#include "mlir/Dialect/SCF/Transforms.h" +#include "mlir/Dialect/SCF/Transforms/Transforms.h" #include "mlir/Pass/Pass.h" #include "mlir/Pass/PassManager.h" #include "mlir/Transforms/GreedyPatternRewriteDriver.h" diff --git a/mlir/test/lib/Dialect/Math/TestExpandMath.cpp b/mlir/test/lib/Dialect/Math/TestExpandMath.cpp --- a/mlir/test/lib/Dialect/Math/TestExpandMath.cpp +++ b/mlir/test/lib/Dialect/Math/TestExpandMath.cpp @@ -12,7 +12,7 @@ #include "mlir/Dialect/Arithmetic/IR/Arithmetic.h" #include "mlir/Dialect/Math/Transforms/Passes.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Pass/Pass.h" #include "mlir/Transforms/GreedyPatternRewriteDriver.h" diff --git a/mlir/test/lib/Dialect/SCF/TestLoopParametricTiling.cpp b/mlir/test/lib/Dialect/SCF/TestLoopParametricTiling.cpp --- a/mlir/test/lib/Dialect/SCF/TestLoopParametricTiling.cpp +++ b/mlir/test/lib/Dialect/SCF/TestLoopParametricTiling.cpp @@ -10,7 +10,7 @@ // //===----------------------------------------------------------------------===// -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/SCF/Utils/Utils.h" #include "mlir/IR/Builders.h" #include "mlir/Pass/Pass.h" diff --git a/mlir/test/lib/Dialect/SCF/TestLoopUnrolling.cpp b/mlir/test/lib/Dialect/SCF/TestLoopUnrolling.cpp --- a/mlir/test/lib/Dialect/SCF/TestLoopUnrolling.cpp +++ b/mlir/test/lib/Dialect/SCF/TestLoopUnrolling.cpp @@ -11,7 +11,7 @@ //===----------------------------------------------------------------------===// #include "mlir/Dialect/Arithmetic/IR/Arithmetic.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/SCF/Utils/Utils.h" #include "mlir/IR/Builders.h" #include "mlir/Pass/Pass.h" diff --git a/mlir/test/lib/Dialect/SCF/TestSCFUtils.cpp b/mlir/test/lib/Dialect/SCF/TestSCFUtils.cpp --- a/mlir/test/lib/Dialect/SCF/TestSCFUtils.cpp +++ b/mlir/test/lib/Dialect/SCF/TestSCFUtils.cpp @@ -12,8 +12,8 @@ #include "mlir/Dialect/Arithmetic/IR/Arithmetic.h" #include "mlir/Dialect/Func/IR/FuncOps.h" -#include "mlir/Dialect/SCF/SCF.h" -#include "mlir/Dialect/SCF/Transforms.h" +#include "mlir/Dialect/SCF/IR/SCF.h" +#include "mlir/Dialect/SCF/Transforms/Transforms.h" #include "mlir/Dialect/SCF/Utils/Utils.h" #include "mlir/IR/Builders.h" #include "mlir/IR/PatternMatch.h" diff --git a/mlir/test/lib/Dialect/Tensor/TestTensorTransforms.cpp b/mlir/test/lib/Dialect/Tensor/TestTensorTransforms.cpp --- a/mlir/test/lib/Dialect/Tensor/TestTensorTransforms.cpp +++ b/mlir/test/lib/Dialect/Tensor/TestTensorTransforms.cpp @@ -11,7 +11,7 @@ //===----------------------------------------------------------------------===// #include "mlir/Dialect/Arithmetic/IR/Arithmetic.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/Tensor/IR/Tensor.h" #include "mlir/Dialect/Tensor/Transforms/Transforms.h" #include "mlir/Pass/Pass.h" diff --git a/mlir/test/lib/Dialect/Vector/TestVectorTransforms.cpp b/mlir/test/lib/Dialect/Vector/TestVectorTransforms.cpp --- a/mlir/test/lib/Dialect/Vector/TestVectorTransforms.cpp +++ b/mlir/test/lib/Dialect/Vector/TestVectorTransforms.cpp @@ -17,7 +17,7 @@ #include "mlir/Dialect/Linalg/Passes.h" #include "mlir/Dialect/Linalg/Transforms/Transforms.h" #include "mlir/Dialect/MemRef/IR/MemRef.h" -#include "mlir/Dialect/SCF/SCF.h" +#include "mlir/Dialect/SCF/IR/SCF.h" #include "mlir/Dialect/Vector/IR/VectorOps.h" #include "mlir/Dialect/Vector/Transforms/VectorDistribution.h" #include "mlir/Dialect/Vector/Transforms/VectorTransforms.h" diff --git a/mlir/test/lib/Interfaces/TilingInterface/TestTilingInterface.cpp b/mlir/test/lib/Interfaces/TilingInterface/TestTilingInterface.cpp --- a/mlir/test/lib/Interfaces/TilingInterface/TestTilingInterface.cpp +++ b/mlir/test/lib/Interfaces/TilingInterface/TestTilingInterface.cpp @@ -16,8 +16,8 @@ #include "mlir/Dialect/Linalg/Transforms/TilingInterfaceImpl.h" #include "mlir/Dialect/Linalg/Transforms/Transforms.h" #include "mlir/Dialect/MemRef/IR/MemRef.h" -#include "mlir/Dialect/SCF/SCF.h" -#include "mlir/Dialect/SCF/TileUsingInterface.h" +#include "mlir/Dialect/SCF/IR/SCF.h" +#include "mlir/Dialect/SCF/Transforms/TileUsingInterface.h" #include "mlir/Dialect/Tensor/IR/Tensor.h" #include "mlir/Interfaces/TilingInterface.h" #include "mlir/Pass/Pass.h" diff --git a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel --- a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel @@ -1802,7 +1802,7 @@ td_library( name = "SCFTdFiles", - srcs = ["include/mlir/Dialect/SCF/SCFOps.td"], + srcs = ["include/mlir/Dialect/SCF/IR/SCFOps.td"], includes = ["include"], deps = [ ":ControlFlowInterfacesTdFiles", @@ -1818,23 +1818,23 @@ tbl_outs = [ ( ["-gen-op-decls"], - "include/mlir/Dialect/SCF/SCFOps.h.inc", + "include/mlir/Dialect/SCF/IR/SCFOps.h.inc", ), ( ["-gen-op-defs"], - "include/mlir/Dialect/SCF/SCFOps.cpp.inc", + "include/mlir/Dialect/SCF/IR/SCFOps.cpp.inc", ), ( ["-gen-dialect-decls"], - "include/mlir/Dialect/SCF/SCFOpsDialect.h.inc", + "include/mlir/Dialect/SCF/IR/SCFOpsDialect.h.inc", ), ( ["-gen-dialect-defs"], - "include/mlir/Dialect/SCF/SCFOpsDialect.cpp.inc", + "include/mlir/Dialect/SCF/IR/SCFOpsDialect.cpp.inc", ), ], tblgen = ":mlir-tblgen", - td_file = "include/mlir/Dialect/SCF/SCFOps.td", + td_file = "include/mlir/Dialect/SCF/IR/SCFOps.td", deps = [":SCFTdFiles"], ) @@ -1847,11 +1847,11 @@ "-gen-pass-decls", "-name=SCF", ], - "include/mlir/Dialect/SCF/Passes.h.inc", + "include/mlir/Dialect/SCF/Transforms/Passes.h.inc", ), ], tblgen = ":mlir-tblgen", - td_file = "include/mlir/Dialect/SCF/Passes.td", + td_file = "include/mlir/Dialect/SCF/Transforms/Passes.td", deps = [":PassBaseTdFiles"], ) @@ -1861,13 +1861,9 @@ "lib/Dialect/SCF/Transforms/*.cpp", "lib/Dialect/SCF/Transforms/*.h", ]), - hdrs = [ - "include/mlir/Dialect/SCF/BufferizableOpInterfaceImpl.h", - "include/mlir/Dialect/SCF/Passes.h", - "include/mlir/Dialect/SCF/Patterns.h", - "include/mlir/Dialect/SCF/TileUsingInterface.h", - "include/mlir/Dialect/SCF/Transforms.h", - ], + hdrs = glob([ + "include/mlir/Dialect/SCF/Transforms/*.h", + ]), includes = ["include"], deps = [ ":AffineAnalysis", @@ -2637,19 +2633,13 @@ name = "SCFDialect", srcs = glob( [ - "lib/Dialect/SCF/*.cpp", - "lib/Dialect/SCF/*.h", + "lib/Dialect/SCF/IR/*.cpp", + "lib/Dialect/SCF/IR/*.h", ], ), hdrs = glob( [ - "include/mlir/Dialect/SCF/*.h", - ], - exclude = [ - "include/mlir/Dialect/SCF/BufferizableOpInterfaceImpl.h", - "include/mlir/Dialect/SCF/Patterns.h", - "include/mlir/Dialect/SCF/TileUsingInterface.h", - "include/mlir/Dialect/SCF/Transforms.h", + "include/mlir/Dialect/SCF/IR/*.h", ], ), includes = ["include"],