|
64 | 64 | #include "llvm/IR/DerivedTypes.h" |
65 | 65 | #include "llvm/Support/Casting.h" |
66 | 66 | #include "llvm/Support/ErrorHandling.h" |
| 67 | +#include "llvm/Support/TimeProfiler.h" |
67 | 68 | #include <cstdint> |
68 | 69 | #include <deque> |
69 | 70 | #include <optional> |
@@ -4322,6 +4323,8 @@ void ConvertCIRToLLVMPass::buildGlobalAnnotationsVar() { |
4322 | 4323 | } |
4323 | 4324 |
|
4324 | 4325 | void ConvertCIRToLLVMPass::runOnOperation() { |
| 4326 | + llvm::TimeTraceScope scope("Convert CIR to LLVM Pass"); |
| 4327 | + |
4325 | 4328 | auto module = getOperation(); |
4326 | 4329 | mlir::DataLayout dataLayout(module); |
4327 | 4330 | mlir::LLVMTypeConverter converter(&getContext()); |
@@ -4404,6 +4407,8 @@ extern void registerCIRDialectTranslation(mlir::MLIRContext &context); |
4404 | 4407 | std::unique_ptr<llvm::Module> |
4405 | 4408 | lowerDirectlyFromCIRToLLVMIR(mlir::ModuleOp theModule, LLVMContext &llvmCtx, |
4406 | 4409 | bool disableVerifier) { |
| 4410 | + llvm::TimeTraceScope scope("lower from CIR to LLVM directly"); |
| 4411 | + |
4407 | 4412 | mlir::MLIRContext *mlirCtx = theModule.getContext(); |
4408 | 4413 | mlir::PassManager pm(mlirCtx); |
4409 | 4414 | populateCIRToLLVMPasses(pm); |
@@ -4435,6 +4440,8 @@ lowerDirectlyFromCIRToLLVMIR(mlir::ModuleOp theModule, LLVMContext &llvmCtx, |
4435 | 4440 | mlir::registerOpenMPDialectTranslation(*mlirCtx); |
4436 | 4441 | registerCIRDialectTranslation(*mlirCtx); |
4437 | 4442 |
|
| 4443 | + llvm::TimeTraceScope __scope("translateModuleToLLVMIR"); |
| 4444 | + |
4438 | 4445 | auto ModuleName = theModule.getName(); |
4439 | 4446 | auto llvmModule = mlir::translateModuleToLLVMIR( |
4440 | 4447 | theModule, llvmCtx, ModuleName ? *ModuleName : "CIRToLLVMModule"); |
|
0 commit comments