[LLVMdev] loop metdata instruction

Dmitry Babokin babokin at gmail.com
Tue Feb 26 05:14:23 PST 2013


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".

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130226/ee32bb10/attachment.html>


More information about the llvm-dev mailing list