[PATCH] D79145: Allow gep (select) combine with non-constant operands

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 1 20:01:21 PDT 2020


rampitec added a comment.

In D79145#2014834 <https://reviews.llvm.org/D79145#2014834>, @spatel wrote:

> In D79145#2014188 <https://reviews.llvm.org/D79145#2014188>, @rampitec wrote:
>
> > In fact I have created two more changes: D79217 <https://reviews.llvm.org/D79217> and D79218 <https://reviews.llvm.org/D79218> to process select and phi with gep operands right in SROA. It is more code but looks cleaner:
> >
> > 1. It will only touch patterns already considered by SROA.
> > 2. It will give InstCombiner a chance to convert it back if SROA did not succeed.
> > 3. There is zero chance it will loop forever.
> > 4. It does not call expensive GetUnerlyingObject.
> >
> >   If those two look better I would prefer modifications in SROA and drop this.
>
>
> If we can deal with this in SROA directly, that would be better. We generally do not want to increase instruction count in InstCombine (as the 2nd test is showing here).


Right, I hope these two SROA patches can land instead of this.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79145/new/

https://reviews.llvm.org/D79145





More information about the llvm-commits mailing list