|
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> |
@@ -4325,6 +4326,8 @@ void ConvertCIRToLLVMPass::buildGlobalAnnotationsVar() { |
4325 | 4326 | } |
4326 | 4327 |
|
4327 | 4328 | void ConvertCIRToLLVMPass::runOnOperation() { |
| 4329 | + llvm::TimeTraceScope scope("Convert CIR to LLVM Pass"); |
| 4330 | + |
4328 | 4331 | auto module = getOperation(); |
4329 | 4332 | mlir::DataLayout dataLayout(module); |
4330 | 4333 | mlir::LLVMTypeConverter converter(&getContext()); |
@@ -4407,6 +4410,8 @@ extern void registerCIRDialectTranslation(mlir::MLIRContext &context); |
4407 | 4410 | std::unique_ptr<llvm::Module> |
4408 | 4411 | lowerDirectlyFromCIRToLLVMIR(mlir::ModuleOp theModule, LLVMContext &llvmCtx, |
4409 | 4412 | bool disableVerifier) { |
| 4413 | + llvm::TimeTraceScope scope("lower from CIR to LLVM directly"); |
| 4414 | + |
4410 | 4415 | mlir::MLIRContext *mlirCtx = theModule.getContext(); |
4411 | 4416 | mlir::PassManager pm(mlirCtx); |
4412 | 4417 | populateCIRToLLVMPasses(pm); |
@@ -4438,6 +4443,8 @@ lowerDirectlyFromCIRToLLVMIR(mlir::ModuleOp theModule, LLVMContext &llvmCtx, |
4438 | 4443 | mlir::registerOpenMPDialectTranslation(*mlirCtx); |
4439 | 4444 | registerCIRDialectTranslation(*mlirCtx); |
4440 | 4445 |
|
| 4446 | + llvm::TimeTraceScope __scope("translateModuleToLLVMIR"); |
| 4447 | + |
4441 | 4448 | auto ModuleName = theModule.getName(); |
4442 | 4449 | auto llvmModule = mlir::translateModuleToLLVMIR( |
4443 | 4450 | theModule, llvmCtx, ModuleName ? *ModuleName : "CIRToLLVMModule"); |
|
0 commit comments