summaryrefslogtreecommitdiff
path: root/kernels
diff options
context:
space:
mode:
authorRuiling Song <ruiling.song@intel.com>2016-04-07 14:39:57 +0800
committerYang Rong <rong.r.yang@intel.com>2016-11-08 20:38:23 +0800
commitf72aaa365ecee7490edcce45d667bb59a82b4d33 (patch)
tree1c48c65bd76650a06b8fac59b8c6cab69f796d67 /kernels
parent6f4b37a70356ea2cb4a12a7c43407697ac71233c (diff)
GBE: handle ConstantExpr in program-scope variable handling.
although we have eliminate ConstantExpr in llvm instructions, but in program scope variable, we still meet ConstantExpr. So, we handle it here. also enhance the test case to hit it. Signed-off-by: Ruiling Song <ruiling.song@intel.com> Reviewed-by: Pan Xiuli <xiuli.pan@intel.com>
Diffstat (limited to 'kernels')
-rw-r--r--kernels/compiler_program_global.cl11
1 files changed, 10 insertions, 1 deletions
diff --git a/kernels/compiler_program_global.cl b/kernels/compiler_program_global.cl
index 405c53f5..fbe030fe 100644
--- a/kernels/compiler_program_global.cl
+++ b/kernels/compiler_program_global.cl
@@ -31,6 +31,9 @@ global int a = 1;
global int b = 2;
global int * constant gArr[2]= {&a, &b};
+global int a_var[1] = {0};
+global int *p_var = a_var;
+
__kernel void compiler_program_global0(const global int *src, int dynamic) {
size_t gid = get_global_id(0);
/* global read/write */
@@ -60,9 +63,15 @@ __kernel void compiler_program_global1(global int *dst, int dynamic) {
dst[12] = *p;
dst[13] = s;
dst[14] = l;
- dst[15] = *gArr[dynamic];
+ if (p_var == a_var)
+ dst[15] = *gArr[dynamic];
if (gid < 11)
dst[gid] = ba[gid];
}
+__kernel void nouse(int dynamic) {
+ c[0].s1 = &s2;
+ p_var = a+dynamic;
+}
+