@@ -333,9 +333,8 @@ 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 =
337
- rootScope.nest (" [onnx-mlir] Compiling to LLVM Optimized Bitcode" );
338
-
336
+ auto llvmTiming = rootScope.nest (
337
+ " [onnx-mlir] Compiling MLIR module to LLVM Optimized Bitcode" );
339
338
std::error_code error;
340
339
341
340
// Write bitcode to a file.
@@ -429,7 +428,6 @@ static int genModelObject(
429
428
static int genJniObject (const mlir::OwningOpRef<ModuleOp> &module,
430
429
std::string jniSharedLibPath, std::string jniObjPath) {
431
430
auto jniTiming = rootScope.nest (" [onnx-mlir] Compiling JNI Object File" );
432
-
433
431
Command ar (/* exePath=*/ getToolPath (" ar" , true ));
434
432
int rc = ar.appendStr (" x" )
435
433
// old version of ar does not support --output so comment out
@@ -448,7 +446,6 @@ static int genJniObject(const mlir::OwningOpRef<ModuleOp> &module,
448
446
static int genSharedLib (std::string sharedLibNameWithExt,
449
447
std::vector<std::string> opts, std::vector<std::string> objs,
450
448
std::vector<std::string> libs, std::vector<std::string> libDirs) {
451
- auto libraryTiming = rootScope.nest (" [onnx-mlir] Linking Shared Library" );
452
449
#ifdef _WIN32
453
450
std::vector<std::string> outputOpt = {" /Fe:" + sharedLibNameWithExt};
454
451
// link has to be before libpath since they need to be passed through to the
@@ -499,7 +496,6 @@ static int genSharedLib(std::string sharedLibNameWithExt,
499
496
static int genJniJar (const mlir::OwningOpRef<ModuleOp> &module,
500
497
std::string modelSharedLibPath, std::string modelJniJarPath) {
501
498
auto jniJarTiming = rootScope.nest (" [onnx-mlir] Creating JNI Jar" );
502
-
503
499
llvm::SmallString<8 > libraryPath (getLibraryPath ());
504
500
llvm::sys::path::append (libraryPath, " javaruntime.jar" );
505
501
std::string javaRuntimeJarPath = llvm::StringRef (libraryPath).str ();
@@ -522,7 +518,6 @@ static int genJniJar(const mlir::OwningOpRef<ModuleOp> &module,
522
518
// Return 0 on success, error code on failure
523
519
static int compileModuleToObject (const mlir::OwningOpRef<ModuleOp> &module,
524
520
std::string outputNameWithoutExt, std::string &objectNameWithExt) {
525
-
526
521
std::string bitcodeNameWithExt = outputNameWithoutExt + " .bc" ;
527
522
int rc = genLLVMBitcode (module, outputNameWithoutExt, bitcodeNameWithExt);
528
523
if (rc != CompilerSuccess)
@@ -537,7 +532,6 @@ static int compileModuleToObject(const mlir::OwningOpRef<ModuleOp> &module,
537
532
static int compileModuleToSharedLibrary (
538
533
const mlir::OwningOpRef<ModuleOp> &module, std::string outputNameNoExt,
539
534
std::string &libNameWithExt) {
540
-
541
535
std::string modelObjNameWithExt;
542
536
int rc = compileModuleToObject (module, outputNameNoExt, modelObjNameWithExt);
543
537
if (rc != CompilerSuccess)
@@ -584,8 +578,7 @@ static int compileModuleToJniJar(
584
578
#define NOEXECSTACK \
585
579
{}
586
580
#else
587
- #define NOEXECSTACK \
588
- { " -z" , " noexecstack" }
581
+ #define NOEXECSTACK {" -z" , " noexecstack" }
589
582
#endif
590
583
std::string modelSharedLibPath = getTargetFilename (jniLibBase, EmitLib);
591
584
rc = genSharedLib (modelSharedLibPath, NOEXECSTACK,
0 commit comments