[LLVMdev] SimplifyCFG vs loops
Dan Gohman
dan433584 at gmail.com
Wed Oct 17 09:09:13 PDT 2012
On Wed, Oct 17, 2012 at 8:41 AM, Krzysztof Parzyszek <
kparzysz at codeaurora.org> wrote:
> Hello All,
>
> The current implementation of the CFG simplification is loop-agnostic. In
> the past I have observed that it can perform transformations that can be
> detrimental to the loop structure. One example that I recall, is
> converting a loop like this:
> while (...) {
> ...
> if (cond) continue;
> ...
> }
> into two nested loops. Specifically, the "continue" branch would go back
> to the loop header making it appear as if there were two back edges.
>
Well, there really are two backedges there.
>
> What are your thoughts about either making the CFG simplification aware of
> loops in its entirety, or separating the "safe" transformations in a quick
> pass, and having a more aggressive pass that does preserve loop structure?
It's not clear what the problem is.
Dan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121017/756e0442/attachment.html>
More information about the llvm-dev
mailing list