13#include "mlir/IR/BuiltinOps.h"
14#include "mlir/Pass/PassManager.h"
18#include "llvm/Support/TimeProfiler.h"
19#include "llvm/TargetParser/Triple.h"
26 if (triple.getArch() == llvm::Triple::x86_64)
34 bool enableIdiomRecognizer,
bool enableCIRSimplify,
35 bool enableLibOpt, llvm::StringRef libOptOptions,
36 bool enableCallConvLowering) {
38 llvm::TimeTraceScope scope(
"CIR To CIR Passes");
40 mlir::PassManager pm(&mlirContext);
43 if (enableCIRSimplify)
46 if (enableIdiomRecognizer)
51 auto errorHandler = [](
const llvm::Twine &) -> mlir::LogicalResult {
52 return mlir::LogicalResult::failure();
55 if (libOptPass->initializeOptions(libOptOptions, errorHandler).failed())
56 return mlir::failure();
58 pm.addPass(std::move(libOptPass));
64 if (enableCallConvLowering) {
73 target, llvm::abi::X86AVXABILevel::None));
78 pm.enableVerifier(enableVerifier);
79 (void)mlir::applyPassManagerCLOptions(pm);
80 return pm.run(theModule);
Defines the clang::ASTContext interface.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
const TargetInfo & getTargetInfo() const
const llvm::Triple & getTriple() const
Returns the target triple of the primary target.
Defines the clang::TargetInfo interface.
static CallConvTarget getCallConvTarget(const llvm::Triple &triple)
Map a target triple to the ABI target that drives CallConvLowering.
mlir::LogicalResult runCIRToCIRPasses(mlir::ModuleOp theModule, mlir::MLIRContext &mlirCtx, clang::ASTContext &astCtx, bool enableVerifier, bool enableIdiomRecognizer, bool enableCIRSimplify, bool enableLibOpt, llvm::StringRef libOptOptions, bool enableCallConvLowering)
CallConvTarget
The ABI target whose calling-convention rules drive CallConvLowering.
std::unique_ptr< Pass > createCallConvLoweringPass()
std::unique_ptr< Pass > createCIREHABILoweringPass()
std::unique_ptr< Pass > createCIRCanonicalizePass()
std::unique_ptr< Pass > createCIRFlattenCFGPass()
std::unique_ptr< Pass > createLibOptPass()
std::unique_ptr< Pass > createIdiomRecognizerPass()
void populateCIRPreLoweringPasses(mlir::OpPassManager &pm)
std::unique_ptr< Pass > createTargetLoweringPass()
std::unique_ptr< Pass > createGotoSolverPass()
std::unique_ptr< Pass > createLoweringPreparePass()
std::unique_ptr< Pass > createCIRSimplifyPass()
std::unique_ptr< Pass > createCXXABILoweringPass()
std::unique_ptr< Pass > createHoistAllocasPass()