Hi, Is it fair to say that we require loops to be in canonical form with a single backedge to which we attach llvm.loop.parallel? Or is it the frontend's responsibility to attach the metadata to each backedge? Looking at the patch there is an assumption that there is a single loop latch. Clang, for example, generates loops with multiple backedges (e.g, while with continue.) How does pocl deal with this? paul On 2013-02-13, at 1:13 PM, Pekka Jääskeläinen wrote:> On 02/12/2013 11:59 PM, Nadav Rotem wrote: >> LGTM. Please commit. > > Committed in r175060. Thanks all for the feedback. > > Yes, let's see what evolves as the best way to keep the metadata > updated after "non-serializing optimizations". > > This metadata is produced by pocl for the "work-item loops" in > the work group functions. Perhaps the #pragma ivdep support in Clang is > going to be the next producer. > > -- > --Pekka > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Hi, On 02/15/2013 06:37 PM, Redmond, Paul wrote:> Is it fair to say that we require loops to be in canonical form with a > single backedge to which we attach llvm.loop.parallel? Or is it the > frontend's responsibility to attach the metadata to each backedge?I have assumed so far only a single backedge. I think we have to annotate all the backedges in Clang where the parallel pragmas etc. are handled, and ensure the loop canonicalizer and similar passes then retain the metadata in the latches. Otherwise it reduces the applicability too much.> How does pocl deal with this?It doesn't have to as it generates "perfect" parallel for-loops for the work-item loops where this metadata is used. -- Pekka
I just want to mention that I am working on handling this as well as starting work on maintaining the metadata in passes where it is currently lost (starting with LoopRotation) paul On 2013-02-15, at 11:59 AM, Pekka Jääskeläinen wrote:> Hi, > > On 02/15/2013 06:37 PM, Redmond, Paul wrote: >> Is it fair to say that we require loops to be in canonical form with a >> single backedge to which we attach llvm.loop.parallel? Or is it the >> frontend's responsibility to attach the metadata to each backedge? > > I have assumed so far only a single backedge. > > I think we have to annotate all the backedges in Clang where the > parallel pragmas etc. are handled, and ensure the loop canonicalizer > and similar passes then retain the metadata in the latches. Otherwise > it reduces the applicability too much. > >> How does pocl deal with this? > > It doesn't have to as it generates "perfect" parallel for-loops > for the work-item loops where this metadata is used. > > -- > Pekka