[LLVMdev] speculative parallelization in LLVM

Renato Golin rengolin at systemcall.org
Tue Jul 19 03:13:24 PDT 2011


On 19 July 2011 10:46, Jimborean Alexandra <xinfinity_a at yahoo.com> wrote:
> No, I cannot, but in case it is, I want to take advantage of this. In case
> it is not, the instrumentation code will detect this at runtime and simply
> roll back to the original version. I will always keep an original version
> available, in addition to the ones I modify with Polly. However, initially I
> will speculate that it is allocated contiguously.

Sorry, I got it wrong, let me rephrase my question...

How are you going to find out in compile time that the objects are in
contiguous memory?

In a pointer access such as:

int foo(int* a, int* b) { ... }

if a and b point to an list (or if the code in foo() assume they do),
at least you know that the elements of a and b are in contiguous
memory.

But in the case of:

int foo(llist a, llist b) { ... }

since the next element is in the elm->next pointer, it could be
pointing anywhere in the memory space.

I mean, in some cases you could have them in contiguous memory, but
how will you identify such cases in compile time?

Depending on the caller, and depending on the run time path the
program takes, the outcome could be different. For instance, even if
there is only one caller, and that caller iterates through a list to
allocate objects on the heap for the linked list, there is no
guarantee that the OS (or the run-time library) will give you
contiguous memory blocks.

cheers,
--renato



More information about the llvm-dev mailing list