treewide: rename to src/

This commit is contained in:
2024-06-20 15:16:49 +08:00
parent d396b0d24d
commit e9fd3de6c5
15 changed files with 60 additions and 14 deletions

37
src/gua-spec.ts Normal file
View File

@@ -0,0 +1,37 @@
import { spawn } from "child_process";
import { promisifySpawn } from "lyc/cli";
import { runcpuOptions } from "lyc/commands/spec";
import { systemdRunOptions } from "lyc/commands/systemd";
import { LLVM_INSTALL } from "lyc/environment";
import path from "path";
import { defaultSPEC, renderConfig } from "lyc/spec";
(async () => {
const llvmHash = "31c8e21f40ea654f9d49b3a926acc6ef1f2ca5d5"; // ipa-pure-const.c
const llvmPrefix = path.join(LLVM_INSTALL, llvmHash);
const config = `clang-O2-${llvmHash}.cfg`;
const spec = defaultSPEC;
spec.newConfig(config, renderConfig({
gccdir: llvmPrefix,
optimize: ["-O2", "-msimd"].join(" "),
}));
await promisifySpawn(spawn("systemd-run", [
...systemdRunOptions({
scope: false,
unit: "spec-loadu",
user: true,
}),
"runcpu",
...runcpuOptions({
benchmarks: ["intspeed"],
buildType: "rebuild",
config,
workload: "ref",
})
], { env: spec.getEnvironment(), }));
})();