#include "mlir/Dialect/SCF/IR/SCF.h"
#include "mlir/Dialect/SCF/Transforms/Patterns.h"
#include "mlir/Transforms/DialectConversion.h"
#include <optional>
usingnamespacemlir;
usingnamespacemlir::scf;
namespace {
static void unpackUnrealizedConversionCast(Value v,
SmallVectorImpl<Value> &unpacked) { … }
template <typename SourceOp, typename ConcretePattern>
class Structural1ToNConversionPattern : public OpConversionPattern<SourceOp> { … };
class ConvertForOpTypes
: public Structural1ToNConversionPattern<ForOp, ConvertForOpTypes> { … };
}
namespace {
class ConvertIfOpTypes
: public Structural1ToNConversionPattern<IfOp, ConvertIfOpTypes> { … };
}
namespace {
class ConvertWhileOpTypes
: public Structural1ToNConversionPattern<WhileOp, ConvertWhileOpTypes> { … };
}
namespace {
class ConvertYieldOpTypes : public OpConversionPattern<scf::YieldOp> { … };
}
namespace {
class ConvertConditionOpTypes : public OpConversionPattern<ConditionOp> { … };
}
void mlir::scf::populateSCFStructuralTypeConversions(
TypeConverter &typeConverter, RewritePatternSet &patterns) { … }
void mlir::scf::populateSCFStructuralTypeConversionTarget(
const TypeConverter &typeConverter, ConversionTarget &target) { … }
void mlir::scf::populateSCFStructuralTypeConversionsAndLegality(
TypeConverter &typeConverter, RewritePatternSet &patterns,
ConversionTarget &target) { … }