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

Modifying hpvm-clang to skip CPU backend and link steps

parent 5a80468b
No related branches found
No related tags found
No related merge requests found
......@@ -75,8 +75,11 @@ def compile_hpvm_c(
if opencl:
passes += ["LLVMDFG2LLVM_OpenCL"]
pass_flags += ["dfg2llvm-opencl"]
passes += ["LLVMDFG2LLVM_CPU", "LLVMClearDFG"]
pass_flags += ["dfg2llvm-cpu", "clearDFG"]
if tensor_target != "nvdla":
pass_flags += ["dfg2llvm-cpu", "clearDFG"]
working_dir = Path(working_dir or ".")
if not working_dir.is_dir():
......@@ -89,15 +92,20 @@ def compile_hpvm_c(
llvm_ll_file = working_dir / f"{name_stem}.llvm.ll"
hpvm_rt_linked_file = working_dir / f"{name_stem}.linked.bc"
link_bitcode_ = [Path(bc) for bc in (link_bitcode or [])]
commands = [
hpvm_c_to_ll(hpvm_src, ll_file, include, macro, flags, optim_level, is_cpp, std),
opt_codegen_hpvm(ll_file, hpvm_ll_file),
_run_opt(hpvm_ll_file, llvm_ll_file, passes, pass_flags),
link_hpvm_rt(link_bitcode_ + [llvm_ll_file], hpvm_rt_linked_file),
]
commands.append(
link_binary(hpvm_rt_linked_file, output_file, link_dirs, link_libs)
)
if tensor_target != "nvdla":
commands.append(
link_binary(hpvm_rt_linked_file, output_file, link_dirs, link_libs)
)
for command in commands:
if verbose:
print(" ".join(command))
......
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