sycl icon indicating copy to clipboard operation
sycl copied to clipboard

[SYCL] hls's libspir contains unoptimized IR and some buggy IR

Open Ralender opened this issue 5 years ago • 4 comments

This is an HLS bug not a trisycl bug

the library is located at $XILINX_ROOT/Vitis/2020.1/lnx64/lib/libspir64-39-hls.bc and is shipped as part of Vitis it isn't optimized, which increases build time and it contains some buggy functions like

; Function Attrs: alwaysinline nounwind
define spir_func float @erfc_impl(float %x) #29 {
  %retval = alloca float, align 4
  %x.addr = alloca float, align 4
  store float %x, float* %x.addr, align 4
  call void @llvm.trap()
  unreachable

1:                                                ; No predecessors!
  %2 = load float, float* %retval, align 4
  ret float %2
}

Ralender avatar Sep 14 '20 18:09 Ralender

@aisoard @yu810226 any idea about how this code is generated? It looks like rubbish code...

keryell avatar Sep 14 '20 23:09 keryell

Seems to be completely useless code.

yu810226 avatar Sep 22 '20 21:09 yu810226

Any code coverage tools? :-)

keryell avatar Sep 23 '20 00:09 keryell

@yu810226 I am curious about how this got generated. I let you fix this in HLS?

keryell avatar Sep 23 '20 00:09 keryell