Skip to content
Snippets Groups Projects
Commit 75166d37 authored by Hashim Sharif's avatar Hashim Sharif
Browse files

hpvm-clang: Modifying clang to use -O0 and opt to use -mem2reg

parent 5644fdfc
No related branches found
No related tags found
No related merge requests found
......@@ -122,7 +122,7 @@ def hpvm_c_to_ll(
flags.append(f"-std={std}")
clang = "clang++" if is_cpp else "clang"
return [
str(LLVM_BUILD_BIN / clang), f"-O{optim_level}",
str(LLVM_BUILD_BIN / clang), "-O0", "-Xclang", "-disable-O0-optnone", #### f"-O{optim_level}",
*includes_s, *flags, *macros,
"-emit-llvm", "-S", str(src_file), "-o", str(target_file)
]
......@@ -181,7 +181,9 @@ def _run_opt(
load_passes_strs = [s for pass_ in pass_names for s in ["-load", f"{pass_}.so"]]
pass_flags_strs = [f"-{flag}" for flag in pass_flags]
return [
str(LLVM_BUILD_BIN / "opt"), *load_passes_strs, *pass_flags_strs,
str(LLVM_BUILD_BIN / "opt"),
"-mem2reg",
*load_passes_strs, *pass_flags_strs,
"-S", str(src_file), "-o", str(target_file)
]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment