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-timeIn 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?
On Mon, Jun 21, 2010 at 10:27 AM, Daniel Berlin <dberlin at dberlin.org> wrote:> 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.May be he is thinking about the cases where dependencies can not be fully resolved until the loop is run ?> As you say, this is the standard approach, why would you need to run > Poly at runtime?- Devang
>> >> Then the JIT can simply eliminate the branches it proves are live/dead >> and you are left with either the parallelized or not version. > > May be he is thinking about the cases where dependencies can not be > fully resolved until the loop is run ?What percent of loops is this, and how often do they occur? Also, most of these models can insert all the guards, even for things that cannot be resolved until the loop is run, they just end up generating a lot more guards, no? It's like runtime alias checks.>> As you say, this is the standard approach, why would you need to run >> Poly at runtime? > > - > Devang >
Apparently Analagous Threads
- [LLVMdev] Speculative Loop Parallelization on LLVM IR
- [LLVMdev] Speculative Loop Parallelization on LLVM IR
- [LLVMdev] Speculative Loop Parallelization on LLVM IR
- [LLVMdev] Speculative Loop Parallelization on LLVM IR
- [LLVMdev] Speculative Loop Parallelization on LLVM IR