[llvm-bugs] [Bug 47610] New: Trying to compile an OpenCL through LLVM IR triggers "Cannot cast between two non-generic address spaces"

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Sep 22 06:34:32 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=47610

            Bug ID: 47610
           Summary: Trying to compile an OpenCL through LLVM IR triggers
                    "Cannot cast between two non-generic address spaces"
           Product: libraries
           Version: 11.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: PTX
          Assignee: unassignedbugs at nondot.org
          Reporter: emmanuel.attia at philips.com
                CC: llvm-bugs at lists.llvm.org

Hi all,

* I try to compile this simple test.cl file:
--------
kernel void toto(global float * output, local int * param)
{
    output[*param] = 0;
}
-------
Note: "local" can be replaced by constant

* Using these command line:

clang -emit-llvm -S -target nvptx test.cl -o test.ll
llvm-link test.ll -o test.bc
clang -target nvptx test.bc -S -o test.ptx

(Obviously later to link with libclc .bc files)

* I have this error:

fatal error: error in backend: Cannot cast between two non-generic address
spaces
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash
backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: clang -target nvptx test.bc -S -o test.ptx
1.      Code generation
2.      Running pass 'Function Pass Manager' on module 'test.bc'.
3.      Running pass 'NVPTX DAG->DAG Pattern Instruction Selection' on function
'@toto'


* Tested with:

clang-9 from Ubuntu 18.04
clang-10.0.1 build from llvm-project git
clang-11-rc2 build from llvm-project git
clang-12-sycl build from intel's llvm git

Note that:
clang -S -target nvptx test.cl -o test.ptx
works perfectly (but doesn't allow to link with nvptx--nvidiacl.bc from libclc)

Am I doing something wrong ?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200922/dda4bdf2/attachment.html>


More information about the llvm-bugs mailing list