Unifying natural loops with multiple exits.

Hi Fellows,

Is there an LLVM pass that does the unification of natural loop exits? I.e., when multiple exits are detected in a natural loop, a unified BB will be inserted to join all the old exiting edges etc. My goal is to make multiple-exit natural loops more recognizable to RegionInfo class. Thanks.

Best Regards,
Paul

-mergereturn does this, but for functions. Maybe it could point you in the right direction?

http://llvm.org/docs/Passes.html#mergereturn-unify-function-exit-nodes

Cheers,
Jevin

On 2/21/14, 4:07 PM, Paul Vario wrote:> Hi Fellows,
>
> Is there an LLVM pass that does the unification of natural loop
> exits? I.e., when multiple exits are detected in a natural loop, a
> unified BB will be inserted to join all the old exiting edges etc. My
> goal is to make multiple-exit natural loops more recognizable to
> RegionInfo class. Thanks.
>
> Best Regards,
> Paul

-mergereturn does this, but for functions. Maybe it could point you in the right direction?

http://llvm.org/docs/Passes.html#mergereturn-unify-function-exit-nodes

Cheers,
Jevin