[LLVMdev] speculative parallelization in LLVM

Renato Golin rengolin at systemcall.org
Mon Jul 18 13:11:12 PDT 2011


On 18 July 2011 18:03, Jimborean Alexandra <xinfinity_a at yahoo.com> wrote:
> 2) for each pointer
>         3) delete the alloca instruction
>         4) create a new alloca instruction for the new array
>         5) replace all uses of the pointer with the new array

Hi,

I'm no expert in auto-vectorization, but I guess you'll be restricted
to pointers that are guaranteed not to overlap, which depending on how
you structure your code, are not many.

You can't just transform *any* pointer access to array access by
replacing them by allocas (that, afaik, cannot overlap).

Also, the allocas inside functions with pointer arguments store a
pointer to the original pointer, so you'd have to go back to the
caller and change *that* alloca, only you can't do that because you're
not sure the callee will always be called, unless you want to make a
whole refactoring of all pointer allocas in all functions in all
modules, and even so, you'll be restricted to the accesses that don't
overlap.

I could be talking non-sense (please let me know if I am), but I feel
that if it were that simple, we'd see much more mainstream
auto-vectorizing compilers...

cheers,
--renato




More information about the llvm-dev mailing list