#include "mlir/Conversion/ControlFlowToLLVM/ControlFlowToLLVM.h"
#include "mlir/Conversion/ConvertToLLVM/ToLLVMInterface.h"
#include "mlir/Conversion/LLVMCommon/ConversionTarget.h"
#include "mlir/Conversion/LLVMCommon/Pattern.h"
#include "mlir/Conversion/LLVMCommon/PrintCallHelper.h"
#include "mlir/Conversion/LLVMCommon/VectorPattern.h"
#include "mlir/Dialect/ControlFlow/IR/ControlFlowOps.h"
#include "mlir/Dialect/LLVMIR/FunctionCallUtils.h"
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
#include "mlir/IR/BuiltinOps.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/Pass/Pass.h"
#include "mlir/Transforms/DialectConversion.h"
#include "llvm/ADT/StringRef.h"
#include <functional>
namespace mlir {
#define GEN_PASS_DEF_CONVERTCONTROLFLOWTOLLVMPASS
#include "mlir/Conversion/Passes.h.inc"
}
usingnamespacemlir;
#define PASS_NAME …
namespace {
struct AssertOpLowering : public ConvertOpToLLVMPattern<cf::AssertOp> { … };
static LogicalResult verifyMatchingValues(ConversionPatternRewriter &rewriter,
ValueRange operands,
ValueRange blockArgs, Location loc,
llvm::StringRef messagePrefix) { … }
struct BranchOpLowering : public ConvertOpToLLVMPattern<cf::BranchOp> { … };
struct CondBranchOpLowering : public ConvertOpToLLVMPattern<cf::CondBranchOp> { … };
struct SwitchOpLowering : public ConvertOpToLLVMPattern<cf::SwitchOp> { … };
}
void mlir::cf::populateControlFlowToLLVMConversionPatterns(
LLVMTypeConverter &converter, RewritePatternSet &patterns) { … }
void mlir::cf::populateAssertToLLVMConversionPattern(
LLVMTypeConverter &converter, RewritePatternSet &patterns,
bool abortOnFailure) { … }
namespace {
struct ConvertControlFlowToLLVM
: public impl::ConvertControlFlowToLLVMPassBase<ConvertControlFlowToLLVM> { … };
}
namespace {
struct ControlFlowToLLVMDialectInterface
: public ConvertToLLVMPatternInterface { … };
}
void mlir::cf::registerConvertControlFlowToLLVMInterface(
DialectRegistry ®istry) { … }