Skip to content

Commit cdbba68

Browse files
committed
[mlir][target] RAII wrap moduleToObject timer to ensure call clear function
1 parent 594bfad commit cdbba68

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

mlir/lib/Target/LLVM/NVVM/Target.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,7 @@ NVPTXSerializer::moduleToObject(llvm::Module &llvmModule) {
673673
llvm::Timer moduleToObjectTimer(
674674
"moduleToObjectTimer",
675675
"Timer for perf llvm-ir -> isa and isa -> binary.");
676+
auto clear = llvm::make_scope_exit([&]() { moduleToObjectTimer.clear(); });
676677
// Return LLVM IR if the compilation target is `offload`.
677678
#define DEBUG_TYPE "serialize-to-llvm"
678679
LLVM_DEBUG({

0 commit comments

Comments
 (0)