support const indexed global constant array
authorHomer Hsing <homer.xing@intel.com>
Mon, 8 Jul 2013 07:50:39 +0000 (15:50 +0800)
committerZhigang Gong <zhigang.gong@linux.intel.com>
Mon, 8 Jul 2013 08:21:31 +0000 (16:21 +0800)
commit0928f6ef7ee8cd55c0d35a9de186534939b02e0b
tree6fe4d3e6db88f428bb40c4c5e45a6f0960ee8e80
parent3c288a86fe261d157e16a7ea9290b2f97d62a1a7
support const indexed global constant array

support reading global constant arrays by CONST index.

example:
  constant int o[3] = {71, 72, 73};

  kernel void f(global int *dst) {
    dst[get_global_id(0)] = o[2]; // const index: 2
  }

in llvm converting phase, calculate offset from const index,
then add the offset to array head

Signed-off-by: Homer Hsing <homer.xing@intel.com>
Reviewed-by: Yang, Rong R <rong.r.yang@intel.com>
backend/src/llvm/llvm_gen_backend.cpp