#include "mlir/Dialect/SCF/Transforms/Passes.h"
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/Dialect/SCF/IR/SCF.h"
#include "mlir/Dialect/SCF/Transforms/Patterns.h"
#include "mlir/IR/Dominance.h"
#include "mlir/IR/PatternMatch.h"
usingnamespacemlir;
namespace {
struct UpliftWhileOp : public OpRewritePattern<scf::WhileOp> { … };
}
FailureOr<scf::ForOp> mlir::scf::upliftWhileToForLoop(RewriterBase &rewriter,
scf::WhileOp loop) { … }
void mlir::scf::populateUpliftWhileToForPatterns(RewritePatternSet &patterns) { … }