[LLVMdev] Address space extension

Michele Scandale michele.scandale at gmail.com
Sun Aug 11 02:49:25 PDT 2013


On 08/11/2013 08:41 AM, Micah Villmow wrote:
> How about this as a solution.
> 
> Add one hook into TargetInstrInfo, and one into TargetISelLowering.
> 
> 1) getAddressSpaceRelation(unsigned AS1, unsigned AS2) - Returns either disjoint, subset, superset, equal. Function defaults to equal.
> 2) isAddressSpaceSupported(unsigned AS) - Returns true if supported, false otherwise. Function defaults to false for all non-zero AS.
> 
> These could be used by IR passes to optimized(#1) and legalization(#2). It requires no changes by backends that do not want to support multiple address spaces and extremely minimal and reasonable support by backends that do. On a plus side, it also requires no IR/Module changes.

To know if two address spaces are disjoint for alias analysis purpose, it's more
effective to know if in the source language the property holds or not, because
as said two disjoint address spaces in the abstract model (like the one defined
by OpenCL) can be implemented in the same physical address space in separated
regions, so asking to the target wont produce the correct answer for all the
targets (see X86 or whatever 'classical' processor with one address space)!

-Michele




More information about the llvm-dev mailing list