|
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> |
@@ -4313,6 +4314,8 @@ void ConvertCIRToLLVMPass::buildGlobalAnnotationsVar() { |
4313 | 4314 | } |
4314 | 4315 |
|
4315 | 4316 | void ConvertCIRToLLVMPass::runOnOperation() { |
| 4317 | + llvm::TimeTraceScope scope("Convert CIR to LLVM Pass"); |
| 4318 | + |
4316 | 4319 | auto module = getOperation(); |
4317 | 4320 | mlir::DataLayout dataLayout(module); |
4318 | 4321 | mlir::LLVMTypeConverter converter(&getContext()); |
@@ -4395,6 +4398,8 @@ extern void registerCIRDialectTranslation(mlir::MLIRContext &context); |
4395 | 4398 | std::unique_ptr<llvm::Module> |
4396 | 4399 | lowerDirectlyFromCIRToLLVMIR(mlir::ModuleOp theModule, LLVMContext &llvmCtx, |
4397 | 4400 | bool disableVerifier) { |
| 4401 | + llvm::TimeTraceScope scope("lower from CIR to LLVM directly"); |
| 4402 | + |
4398 | 4403 | mlir::MLIRContext *mlirCtx = theModule.getContext(); |
4399 | 4404 | mlir::PassManager pm(mlirCtx); |
4400 | 4405 | populateCIRToLLVMPasses(pm); |
@@ -4426,6 +4431,8 @@ lowerDirectlyFromCIRToLLVMIR(mlir::ModuleOp theModule, LLVMContext &llvmCtx, |
4426 | 4431 | mlir::registerOpenMPDialectTranslation(*mlirCtx); |
4427 | 4432 | registerCIRDialectTranslation(*mlirCtx); |
4428 | 4433 |
|
| 4434 | + llvm::TimeTraceScope __scope("translateModuleToLLVMIR"); |
| 4435 | + |
4429 | 4436 | auto ModuleName = theModule.getName(); |
4430 | 4437 | auto llvmModule = mlir::translateModuleToLLVMIR( |
4431 | 4438 | theModule, llvmCtx, ModuleName ? *ModuleName : "CIRToLLVMModule"); |
|
0 commit comments