• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===- ConvertSCFToStandard.h - Pass entrypoint -----------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef MLIR_CONVERSION_SCFTOSTANDARD_SCFTOSTANDARD_H_
10 #define MLIR_CONVERSION_SCFTOSTANDARD_SCFTOSTANDARD_H_
11 
12 #include <memory>
13 #include <vector>
14 
15 namespace mlir {
16 struct LogicalResult;
17 class MLIRContext;
18 class Pass;
19 class RewritePattern;
20 
21 // Owning list of rewriting patterns.
22 class OwningRewritePatternList;
23 
24 /// Collect a set of patterns to lower from scf.for, scf.if, and
25 /// loop.terminator to CFG operations within the Standard dialect, in particular
26 /// convert structured control flow into CFG branch-based control flow.
27 void populateLoopToStdConversionPatterns(OwningRewritePatternList &patterns,
28                                          MLIRContext *ctx);
29 
30 /// Creates a pass to convert scf.for, scf.if and loop.terminator ops to CFG.
31 std::unique_ptr<Pass> createLowerToCFGPass();
32 
33 } // namespace mlir
34 
35 #endif // MLIR_CONVERSION_SCFTOSTANDARD_SCFTOSTANDARD_H_
36