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

            Bug ID: 24004
           Summary: [OpenCL] Produces illegal address space conversions
                    for automatic local struct arrays
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

Related pocl bug: https://github.com/pocl/pocl/issues/195

Reproduce with a scan.cl:

typedef struct {
  int c00;
  int c01;
} scan_t;

scan_t add(scan_t a, scan_t b)
{
  return b;
}

kernel
void scan_scan_intervals_lev1()
{
  local scan_t psc_ldata[2];

  psc_ldata[0] = add(psc_ldata[0], psc_ldata[1]);
}

clang -Xclang -ffake-address-space-map -x cl scan.cl -emit-llvm  -c -S -o -

This either crashes with an assertion (in case Clang built with assertions) or
generates an illegal bitcast between address spaceslike this:

%1 = load i64* bitcast (%struct.scan_t addrspace(2)* getelementptr inbounds ([2
x %struct.scan_t] addrspace(2)* @scan_scan_intervals_lev1.psc_ldata, i64 0, i64
1) to i6

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to