[LLVMdev] [llvm-commits] Vectors of Pointers and Vector-GEP

dag at cray.com dag at cray.com
Fri Apr 20 11:02:29 PDT 2012


Hal Finkel <hfinkel at anl.gov> writes:

>> Vector-geps on the other hand are only useful in very specific
>> cases.

> At the moment, the only cases where I've seen these vectorized in the
> current implementation is where some vectorizable integer calculation
> was done and then converted into pointers used by GEPs. I am not sure
> how common this is in real code.

It is quite common in HPC codes.  It gets used for loops like this:

   for(...) {
     a[i] = b[x[i]] + c[y[i]];
   }

> Do you think we should also add vector scatter/gather loads and stores?

I'm not sure about this.  Intrisics might be good enough.  The question
comes down to how much the LLVM optimizer needs to know about them.
Alias and dependence analysis can often figure quite a bit out if they
try hard enough but that would require native IR instructions, I think.

In addition, I suspect more and more architectures are going to start
supporting G/S so a generic instruction would make the IR more portable
and we wouldn't have to reinvent the wheel for each target.

                                 -Dave



More information about the llvm-dev mailing list