clang with host and accelerator bitcode

Hi,

How does one use clang to link a program with host and accelerator code
when the inputs are host and accelerate bitcode files. I tried using
clang-offload-bundler and feeding the output of that to clang but clang
doesn't like it. I tried feeding both bitcode files to clang:

clang -o test host.bc accel.bc

but I get this:

warning: overriding the module target triple with x86_64-unknown-linux-gnu [-Woverride-module]
Allocation instruction pointer not in the stack address space!
  %n.addr = alloca i64, align 8, addrspace(5)
Allocation instruction pointer not in the stack address space!
  %c_f.addr = alloca [100000 x float]*, align 8, addrspace(5)
Allocation instruction pointer not in the stack address space!
  %a_f.addr = alloca [100000 x float]*, align 8, addrspace(5)
Allocation instruction pointer not in the stack address space!
  %b_f.addr = alloca [100000 x float]*, align 8, addrspace(5)
in function __omp_offloading_fe05_4310cf57_main_l48
fatal error: error in backend: Broken function found, compilation aborted!

llc doesn't work either:

llc -o test host.bx accel.bc

llc: Too many positional arguments specified!
Can specify at most 1 positional arguments: See: llc --help

Is there a way to do this?

              -David

I think you need to add "-fopenmp -fopenmp-targets=..." to make clang to understand that bundler/unbundler is required.

Best regards,
Alexey Bataev

Alexey Bataev <a.bataev@hotmail.com> writes:

I think you need to add "-fopenmp -fopenmp-targets=..." to make clang to understand that bundler/unbundler is required.

Thanks! That helped. It turns out I needed a few other things for my
use-case but this got me unblocked and I was able to figure it out.

             -David

Glad it helped.

Best regards,
Alexey Bataev