[LLVMdev] LLVMdev Digest, Vol 80, Issue 13

Andrew Clinton andrew at sidefx.com
Mon Feb 14 16:32:10 PST 2011


I'm just suggesting that from the perspective of the LLVM IR there 
doesn't seem to be a necessary semantic difference between arrays and 
vectors.  Arrays provide a superset of the functionality available for 
vectors.  I would be happy if the code generator used 4x32bit vectors 
for basic math on [4xfloat] arrays, and fell back to something less 
efficient if the user decided to dynamically index it.  However, maybe 
this is more work for the code generator than is currently feasible.

On 02/14/2011 06:44 PM, Villmow, Micah wrote:
> Andrew,
>   This is one area of LLVM that maps very nicely to our GPU architecture. A vector is a native data type on these architectures. For example, on AMD's GPUs, the native type is 4x32bit vector with sub-components. Each of the individual 32bits can be indexed separately, but not dynamically. This is a big difference from an array of 32bit values. So there are cases where the meaning of the two are different on modern hardware.
>
> Micah
>




More information about the llvm-dev mailing list