From: Yang Rong <rong.r.y...@intel.com> Casting from pointer of char to pointer of int breaks llvm TypeBasedAliasAnalysis. So we use may_alias attribute to explicitly tell the TBAA that it may alias other data type memory access.
Signed-off-by: Ruiling Song <ruiling.s...@intel.com> --- backend/src/libocl/src/ocl_memcpy.cl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/src/libocl/src/ocl_memcpy.cl b/backend/src/libocl/src/ocl_memcpy.cl index 131574d..8c0409a 100644 --- a/backend/src/libocl/src/ocl_memcpy.cl +++ b/backend/src/libocl/src/ocl_memcpy.cl @@ -16,12 +16,13 @@ * */ #include "ocl_memcpy.h" +typedef int __attribute__((may_alias)) AI; #define DECL_TWO_SPACE_MEMCOPY_FN(NAME, DST_SPACE, SRC_SPACE) \ void __gen_memcpy_ ##NAME## _align (DST_SPACE uchar* dst, SRC_SPACE uchar* src, size_t size) { \ size_t index = 0; \ while((index + 4) <= size) { \ - *((DST_SPACE uint *)(dst + index)) = *((SRC_SPACE uint *)(src + index)); \ + *((DST_SPACE AI *)(dst + index)) = *((SRC_SPACE AI *)(src + index)); \ index += 4; \ } \ while(index < size) { \ -- 2.7.4 _______________________________________________ Beignet mailing list Beignet@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/beignet