[LLVMdev] loop metdata instruction
Redmond, Paul
paul.redmond at intel.com
Tue Feb 26 12:08:59 PST 2013
Sorry, first reply had bad formatting..
On 2013-02-26, at 8:14 AM, Dmitry Babokin wrote:
> Hi Pekka,
>
> On Tue, Feb 26, 2013 at 11:08 AM, Pekka Jääskeläinen <pekka.jaaskelainen at tut.fi> wrote:
>
> Isn't it possible that multiple nested loops share the header and
> the pre-header in normalized loops? Thus, then adding metadata to the
> preheader's branch would make the MD ambiguous for nested loops.
>
> The header can't be shared, otherwise it's the same loop. Though strictly speaking it depends on definition of the loop, but in my experience, the most practical definition is "loop == header".
I think Pekka is correct and in general you can't assume the header belongs to a single loop. However, for reducible CFGs I believe this is true.
>
> Another observation is that pre-header is highly important for optimizations as a placeholder for hoisting the code out of the loop. So even if the pre-header doesn't exist, it makes sense to create it during optimization. But pre-header of the inner loop may make it more difficult to detect that loop-nest is perfect nest (i.e. the only real code of the outer loop is the inner loop).
>
> -Dmitry.
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
More information about the llvm-dev
mailing list