[PATCH] Enable ExitValue rewrite only when expansion cost is low.

Wei Mi wmi at google.com
Wed May 20 16:09:59 PDT 2015


In http://reviews.llvm.org/D9800#176008, @hfinkel wrote:

> In http://reviews.llvm.org/D9800#175987, @wmi wrote:
>
> > > Does this only apply when the loop otherwise has side effects? If the loop can be removed once the exit value is unused, maybe we should do it anyway?
> >
> >
> > Yes, it makes sense, although it will increase the code complexity a little bit. I think it can be done like this: The loop can be removed only when all the phi nodes in exitBB with incoming values from the loop can be rewritten. We need to hold the transformations of all the phi in every ExitBB of the loop, get the information whether the loop can be removed, then do the transformation for all the phi in the end.
> >
> > I will get a new patch to implement it.
>
>
> Great! Do you also need to check the loops for instructions with side effects?


Yes, it is needed. Thanks for reminding. I will check the existing legality check logic to remove a loop when it is dead.


REPOSITORY
  rL LLVM

http://reviews.llvm.org/D9800

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list