Skip to content

Commit

Permalink
Merge pull request #647 from egraphs-good/ajpal-fix-cfgs
Browse files Browse the repository at this point in the history
Align names between tmp file and what cfg generator expects
  • Loading branch information
ajpal authored Oct 31, 2024
2 parents 7c6ee48 + 4229331 commit 774b7f7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions infra/generate_cfgs.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ def make_cfgs(bench, data_dir):
opt = "opt"

# https://llvm.org/docs/Passes.html#dot-cfg-print-cfg-of-function-to-dot-file
cmd = f"{opt} -disable-output -passes=dot-cfg {bench}-{mode}.ll"
cmd = f"{opt} -disable-output -passes=dot-cfg {bench}-{mode}-{mode}.ll"
os.system(cmd)

# Delete the -init.ll file (We don't need it for nightly,
# so just reduce the amount of clutter we copy to the nightly machine)
os.system(f"rm {bench}-{mode}-init.ll")
os.system(f"rm {bench}-{mode}-{mode}-init.ll")

# Find all the dot files (can't use glob because it doesn't match hidden files)
# There are also a bunch of files that start with ._Z that I don't think we care about?
Expand Down
6 changes: 3 additions & 3 deletions infra/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def setup_benchmark(name):
def optimize(benchmark):
print(f'[{benchmark.index}/{benchmark.total}] Optimizing {benchmark.name} with {benchmark.treatment}')
profile_dir = benchmark_profile_dir(benchmark.name)
optimized_bril_file = f'{profile_dir}/{benchmark.treatment}-optimized.bril'
optimized_bril_file = f'{profile_dir}/{benchmark.name}-{benchmark.treatment}.bril'

# get the commands we need to run
(eggcc_run_mode, llvm_args) = get_eggcc_options(benchmark)
Expand All @@ -89,7 +89,7 @@ def optimize(benchmark):
cmd1 = f'{EGGCC_BINARY} {benchmark.path} --run-mode {eggcc_run_mode}'
cmd2 = f'{EGGCC_BINARY} {optimized_bril_file} --add-timing {llvm_args} -o {profile_dir}/{benchmark.treatment} --llvm-output-dir {llvm_out_dir}'

print(f'Running: {cmd1}', flush=True)
print(f'Running c1: {cmd1}', flush=True)
start_eggcc = time.time()
process = subprocess.run(cmd1, shell=True, capture_output=True, text=True)
process.check_returncode()
Expand All @@ -99,7 +99,7 @@ def optimize(benchmark):
with open(optimized_bril_file, 'w') as f:
f.write(process.stdout)

print(f'Running: {cmd2}', flush=True)
print(f'Running c2: {cmd2}', flush=True)
start_llvm = time.time()
process2 = subprocess.run(cmd2, shell=True)
process2.check_returncode()
Expand Down

0 comments on commit 774b7f7

Please sign in to comment.