<div dir="ltr">Hi Adam,<div><br></div><div>> <span style="font-size:13.1999998092651px;line-height:19.7999992370605px">Do you mean LoopVersioning or is this something different?</span></div><div><span style="font-size:13.1999998092651px;line-height:19.7999992370605px"><br></span></div><div><span style="font-size:13.1999998092651px;line-height:19.7999992370605px">Yes, sorry, I do mean LoopVersioning. It's a good start, but the API isn't flexible enough at the moment to build on. My proposed LoopEditor API would provide some of the features of LoopVersioning but not all - for example it wouldn't know about LoopAccessAnalysis and runtime pointer checks. So LoopVersioning could be trivially bolted on to this API.</span></div><div><span style="font-size:13.1999998092651px;line-height:19.7999992370605px"><br></span></div><div><span style="font-size:13.1999998092651px;line-height:19.7999992370605px">James</span></div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, 27 Jul 2015 at 18:27 Adam Nemet <<a href="mailto:anemet@apple.com">anemet@apple.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><blockquote type="cite"><div>On Jul 27, 2015, at 10:04 AM, James Molloy <<a href="mailto:james@jamesmolloy.co.uk" target="_blank">james@jamesmolloy.co.uk</a>> wrote:</div><br><div><div dir="ltr">Hi all,<div><br></div><div>LLVM currently lacks a single coherent way to edit, modify and transform loops. We have the Loop abstraction that provides some functionality, and we have a cluster of functions and abstractions in LoopUtils, but each is fairly cumbersome to use. There's also VersionedLoop, but that's quite specific and not really extendable/composable.</div></div></div></blockquote><div><br></div></div></div><div style="word-wrap:break-word"><div><div>Hi James,</div><div><br></div><div>I haven’t read this in detail yet but  but I have a quick question.  What do you mean by VersionedLoop here?  Do you mean LoopVersioning or is this something different?</div><div><br></div><div>Adam</div><div><br></div><blockquote type="cite"><div><div dir="ltr"></div></div></blockquote></div></div><div style="word-wrap:break-word"><div><blockquote type="cite"><div><div dir="ltr"><div><br></div><div>I've recently been trying to do some prototyping of a high level loop optimization (unroll-and-jam) and ended up with quite a bit of spaghetti code doing what should be simple transforms (as another example, look at LoopVectorize::createEmptyBlock()!)</div><div><br></div><div>So I decided to prototype an API for performing more high level operations on LLVM Loops - cloning, widening, interleaving, stitching the output of one loop into another loop, setting loop trip counts, peeling... and all while keeping loopinfo, domtree and SCEV updated.</div><div><br></div></div></div></blockquote></div></div><div style="word-wrap:break-word"><div><blockquote type="cite"><div><div dir="ltr"><div>I've uploaded my current prototype to Phab here: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D11530&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=3t7gCOgkqnA-65i6cez_eslTon3hxx5XJKhMBw98kv0&s=yCaxJfCogeqwUH-wlsdHFPHktniLwG3-cZnq1yciR04&e=" target="_blank">http://reviews.llvm.org/D11530</a></div></div></div></blockquote></div></div><div style="word-wrap:break-word"><div><blockquote type="cite"><div><div dir="ltr"><div><br></div><div>It's still at the prototype stage so there are lots of things that need fixing - sorting out the testing story being top of my list. But I'm looking for feedback on:</div><div>  * Is this a useful abstraction? Is it something the community would like to see in-tree (eventually)?</div><div>  * Does the API design make sense? Are there obvious things I've missed that people need?</div><div><br></div><div>I've thought about the use cases of the loop vectorizer, loop distribution, loop unrolling, loop versioning, and I think the current design can solve their use cases fairly elegantly. I've used this API to write a fairly sophisticated unroll-and-jam transform in very few lines too.</div><div><br></div><div>Any feedback would be gratefully appreciated!</div><div><br></div><div>Cheers,</div><div><br></div><div>James</div></div></div></blockquote></div></div><div style="word-wrap:break-word"><div><blockquote type="cite"><div><div dir="ltr"></div>
_______________________________________________<br>llvm-commits mailing list<br><a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br></div></blockquote></div><br></div></blockquote></div>