@@ -54,8 +54,7 @@ using namespace mlir;
54
54
using namespace onnx_mlir ;
55
55
56
56
mlir::DefaultTimingManager timingManager;
57
- mlir::TimingScope rootScope;
58
-
57
+ mlir::TimingScope rootTimingScope;
59
58
namespace onnx_mlir {
60
59
61
60
// Make a function that forces preserving all files using the runtime arguments
@@ -153,7 +152,8 @@ int Command::exec(std::string wdir) const {
153
152
llvm::errs () << llvm::join (argsRef, " " ) << " \n "
154
153
<< " Error message: " << errMsg << " \n "
155
154
<< " Program path: " << _path << " \n "
156
- << " Command execution failed." << " \n " ;
155
+ << " Command execution failed."
156
+ << " \n " ;
157
157
return rc;
158
158
}
159
159
@@ -333,7 +333,7 @@ std::string getTargetFilename(
333
333
// Returns 0 on success, error code on failure.
334
334
static int genLLVMBitcode (const mlir::OwningOpRef<ModuleOp> &module,
335
335
std::string outputNameNoExt, std::string optimizedBitcodeNameWithExt) {
336
- auto llvmTiming = rootScope .nest (
336
+ auto llvmTiming = rootTimingScope .nest (
337
337
" [onnx-mlir] Compiling MLIR module to LLVM Optimized Bitcode" );
338
338
std::error_code error;
339
339
@@ -406,7 +406,7 @@ static int genLLVMBitcode(const mlir::OwningOpRef<ModuleOp> &module,
406
406
static int genModelObject (
407
407
std::string bitcodeNameWithExt, std::string &modelObjNameWithExt) {
408
408
auto objectTiming =
409
- rootScope .nest (" [onnx-mlir] Compiling LLVM Bitcode to Object File" );
409
+ rootTimingScope .nest (" [onnx-mlir] Compiling LLVM Bitcode to Object File" );
410
410
std::string llcPath = getToolPath (" llc" );
411
411
Command llvmToObj (/* exePath=*/ llcPath);
412
412
setXllcOption ({" --code-model" , modelSizeStr[modelSize]});
@@ -427,7 +427,7 @@ static int genModelObject(
427
427
// Return 0 on success, error code on failure.
428
428
static int genJniObject (const mlir::OwningOpRef<ModuleOp> &module,
429
429
std::string jniSharedLibPath, std::string jniObjPath) {
430
- auto jniTiming = rootScope .nest (" [onnx-mlir] Compiling JNI Object File" );
430
+ auto jniTiming = rootTimingScope .nest (" [onnx-mlir] Compiling JNI Object File" );
431
431
Command ar (/* exePath=*/ getToolPath (" ar" , true ));
432
432
int rc = ar.appendStr (" x" )
433
433
// old version of ar does not support --output so comment out
@@ -495,7 +495,7 @@ static int genSharedLib(std::string sharedLibNameWithExt,
495
495
// Return 0 on success, error code on failure.
496
496
static int genJniJar (const mlir::OwningOpRef<ModuleOp> &module,
497
497
std::string modelSharedLibPath, std::string modelJniJarPath) {
498
- auto jniJarTiming = rootScope .nest (" [onnx-mlir] Creating JNI Jar" );
498
+ auto jniJarTiming = rootTimingScope .nest (" [onnx-mlir] Creating JNI Jar" );
499
499
llvm::SmallString<8 > libraryPath (getLibraryPath ());
500
500
llvm::sys::path::append (libraryPath, " javaruntime.jar" );
501
501
std::string javaRuntimeJarPath = llvm::StringRef (libraryPath).str ();
@@ -578,7 +578,8 @@ static int compileModuleToJniJar(
578
578
#define NOEXECSTACK \
579
579
{}
580
580
#else
581
- #define NOEXECSTACK {" -z" , " noexecstack" }
581
+ #define NOEXECSTACK \
582
+ { " -z" , " noexecstack" }
582
583
#endif
583
584
std::string modelSharedLibPath = getTargetFilename (jniLibBase, EmitLib);
584
585
rc = genSharedLib (modelSharedLibPath, NOEXECSTACK,
@@ -889,7 +890,7 @@ int compileModule(mlir::OwningOpRef<ModuleOp> &module,
889
890
mlir::MLIRContext &context, std::string outputNameNoExt,
890
891
EmissionTargetType emissionTarget) {
891
892
auto compileModuleTiming =
892
- rootScope .nest (" [onnx-mlir] Compiling Module using MLIR" );
893
+ rootTimingScope .nest (" [onnx-mlir] Compiling Module using MLIR" );
893
894
894
895
int rc = setupModule (module, context, outputNameNoExt);
895
896
if (rc != CompilerSuccess)
0 commit comments