[PATCH] Reject bitcasts between address spaces with different sizes

Matt Arsenault arsenm2 at gmail.com
Tue Jul 2 23:15:18 PDT 2013


On Jul 2, 2013, at 21:38 , Eli Friedman <eli.friedman at gmail.com> wrote:
> 
> High-level issues:
> 
> 1. The way this is written, adding a data layout string to a module can turn a valid module into an invalid module.  We should consider introducing some sort of safe invariant here (either ban modules without data layouts outright, or don't allow them to use non-zero address spaces).

Option 2 would work. I don't know know what the use case is for not having a datalayout is, and think it should be required although changing that sounds like more effort.

> 2. What are your long-term plans here?  I'm particularly worried about how you're planning on testing this.


I'm picking up the patches that were started here: http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-August/052799.html

This is to support using smaller pointer types on some address spaces. Currently when using any 64-bit pointers, all calculations end up as 64-bit even though that's excessive for many pointer calculations that are useful on the GPU. 32-bit operations are faster, and 64-bit requires additional registers on AMD GPUs.  It will be useful / stressed by the AMDIL and R600 targets.



More information about the llvm-commits mailing list