Skip to content

Commit ccf9552

Browse files
authored
implement (#2963)
Signed-off-by: chentong319 <[email protected]>
1 parent 2c8e8e5 commit ccf9552

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Compiler/CompilerOptions.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -1246,6 +1246,13 @@ void initCompilerConfig() {
12461246
addCompilerConfig(CCM_SHARED_LIB_DEPS, extraLibs);
12471247
addCompilerConfig(CCM_SHARED_LIB_PATH_DEPS, extraLibPaths);
12481248
}
1249+
1250+
// Enable aggressive optimization for NNPA with -O3
1251+
if (OptimizationLevel == OptLevel::O3 &&
1252+
getTargetAccel().find("NNPA") != std::string::npos &&
1253+
getLLVMOption().find("enable-unsafe-fp-math") == std::string::npos) {
1254+
setLLVMOption(getLLVMOption() + " --enable-unsafe-fp-math");
1255+
}
12491256
}
12501257

12511258
} // namespace onnx_mlir

0 commit comments

Comments
 (0)