#include "mlir/Conversion/ControlFlowToSCF/ControlFlowToSCF.h"
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/Dialect/ControlFlow/IR/ControlFlow.h"
#include "mlir/Dialect/ControlFlow/IR/ControlFlowOps.h"
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
#include "mlir/Dialect/SCF/IR/SCF.h"
#include "mlir/Dialect/UB/IR/UBOps.h"
#include "mlir/Pass/Pass.h"
#include "mlir/Transforms/CFGToSCF.h"
namespace mlir {
#define GEN_PASS_DEF_LIFTCONTROLFLOWTOSCFPASS
#include "mlir/Conversion/Passes.h.inc"
}
usingnamespacemlir;
FailureOr<Operation *>
ControlFlowToSCFTransformation::createStructuredBranchRegionOp(
OpBuilder &builder, Operation *controlFlowCondOp, TypeRange resultTypes,
MutableArrayRef<Region> regions) { … }
LogicalResult
ControlFlowToSCFTransformation::createStructuredBranchRegionTerminatorOp(
Location loc, OpBuilder &builder, Operation *branchRegionOp,
Operation *replacedControlFlowOp, ValueRange results) { … }
FailureOr<Operation *>
ControlFlowToSCFTransformation::createStructuredDoWhileLoopOp(
OpBuilder &builder, Operation *replacedOp, ValueRange loopVariablesInit,
Value condition, ValueRange loopVariablesNextIter, Region &&loopBody) { … }
Value ControlFlowToSCFTransformation::getCFGSwitchValue(Location loc,
OpBuilder &builder,
unsigned int value) { … }
void ControlFlowToSCFTransformation::createCFGSwitchOp(
Location loc, OpBuilder &builder, Value flag,
ArrayRef<unsigned int> caseValues, BlockRange caseDestinations,
ArrayRef<ValueRange> caseArguments, Block *defaultDest,
ValueRange defaultArgs) { … }
Value ControlFlowToSCFTransformation::getUndefValue(Location loc,
OpBuilder &builder,
Type type) { … }
FailureOr<Operation *>
ControlFlowToSCFTransformation::createUnreachableTerminator(Location loc,
OpBuilder &builder,
Region ®ion) { … }
namespace {
struct LiftControlFlowToSCF
: public impl::LiftControlFlowToSCFPassBase<LiftControlFlowToSCF> { … };
}