[LLVMdev] Speculative Loop Parallelization on LLVM IR

Daniel Berlin dberlin at dberlin.org
Mon Jun 21 10:27:45 PDT 2010

On Mon, Jun 21, 2010 at 1:12 AM, Javed Absar <javed.absar at gmail.com> wrote:
> Hi Tobias:
> Thanks for replying . So if I understand correctly,  in LLVM currently, the
> Polyhedral model is being built ( LLVM IR -------> Poly Model ---------->
> LLVM IR ).
> This is for compile-time optimizations of loop-nests [e.g.
> loop-transformations to expose parallelism or improve locality etc]. Yes,
> thats great for optimizing loop-nests.
> As an additional, since the real value of LLVM to me is run-time
> optimizations possibilities, some loop-nest optimizations "needs" to be done
> at run-time.
> I say "needs" because many loops have unresolvable data-dependencies at
> compile-time

In cases where it matters, most compilers will perform function
versioning and include data dependence if checks to check at runtime
which version (parallel or non) can be run.

Then the JIT can simply eliminate the branches it proves are live/dead
and you are left with either the parallelized or not version.
As you say, this is the standard approach, why would you need to run
Poly at runtime?

More information about the llvm-dev mailing list