[PATCH] Support for address space casting in order to map these on the new 'addrspacecast' IR instruction

Michele Scandale michele.scandale at gmail.com
Mon Nov 25 15:00:25 PST 2013


  Hi pekka,

  I think the assertion you reported is related to the introduction of the 'addrspacecast' instruction: now the bitcast is illegal when you want to convert a pointer between different address space, you have to use addrspacecast instead.

  This patch do not prevent *explicit casts* between address space: for OpenCL this should be a semantic check that must be catched before code generation. The current patch just fix the codegen. As you suggest for OpenCL in those cases where pointer cast between address spaces is effectively just a reinterpretation a good solution is to use union.

  I agree with you that this patch should be pushed also on 3.4 branch. I do not know how to manage this. BTW, I have not commit rights so I would need someone that can commit the patch for me.

http://llvm-reviews.chandlerc.com/D2241



More information about the cfe-commits mailing list