bin/runcpu: support optimize flag configuration
This commit is contained in:
@@ -29,6 +29,15 @@ const argv = await yargs(hideBin(process.argv))
|
||||
choices: ['test', 'train', 'ref'],
|
||||
default: 'ref',
|
||||
})
|
||||
.option('optimize-profile', {
|
||||
type: 'string',
|
||||
choices: ['O2', 'base'],
|
||||
demandOption: true,
|
||||
})
|
||||
.option('allow-misaligned', {
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
})
|
||||
.option('spec', {
|
||||
alias: 's',
|
||||
type: 'string',
|
||||
@@ -90,7 +99,7 @@ const uuid = crypto.randomUUID();
|
||||
|
||||
const prefix = path.resolve(argv.compilerPrefix);
|
||||
|
||||
const o3LTOFlags = [
|
||||
const baseFlags = [
|
||||
"-O3",
|
||||
"-flto",
|
||||
"-fuse-ld=lld",
|
||||
@@ -109,7 +118,8 @@ const specProc = await spawnSPECWithID(
|
||||
spec,
|
||||
{
|
||||
optimize: [
|
||||
"-O2",
|
||||
...argv.optimizeProfile === "O2" ? ["-O2"] : baseFlags,
|
||||
...argv.allowMisaligned ? unalignedFlags : [],
|
||||
...sw64TargetOptions({ simd: argv.simd }),
|
||||
...argv.compilerSuite == "llvm" ? [sunway.mcpu(sunwayGeneration)] : [], // Only add -mcpu for llvm
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user