Hi Alex, Sanjoy,
exposing the internal IRBuilder to users of SCEVExpander violates
information hiding, and encourages the tight coupling that makes code bases
such as Polly so hard to maintain. SCEVExpander::expandCodeFor returns a
Value that (if it's an instruction) can be used to update the insert point
of the client's IRBuilder. Is that not enough?
No hidden state, no hidden state transitions, so it's locally clear to a
reader how the IRBuilder moves.
Cheers,
Philip
2018-04-29 20:50 GMT+02:00 Sanjoy Das via llvm-dev <llvm-dev at
lists.llvm.org>
:
> Hi Alexandre,
>
> Sorry I missed this -- I was on vacation when you sent this.
>
> SCEVExpander already has an IRBuilder in it but AFAICT it isn't
> exposed as a public interface. I'd be fine if you wanted to expose a
> public `GetIRBuilder()` accessor that let a SCEVExpander client use
> the same IRBuilder as SCEVExpander.
>
> -- Sanjoy
>
> On Fri, Apr 6, 2018 at 10:55 AM, Alexandre Isoard via llvm-dev
> <llvm-dev at lists.llvm.org> wrote:
> > Hello,
> >
> > I use SCEVExpander and IRBuilder to generate some code and I
frequently
> > end-up breaking dominance because the SCEVExpander insertion point and
> the
> > IRBuilder insertion point do not advance in synchrony.
> >
> > Ideally, I could build a SCEVExpander based on an existing IRBuilder
(so
> > that they move each other). Or even better, SCEVExpander inherit from
> > IRBuilder and basically extend it with SCEV expander capabilities
(then I
> > don't need to use a separate IRBuilder).
> >
> > Or maybe I am using them wrong? What is the intended way to use those?
> >
> > --
> > Alexandre Isoard
> >
> > _______________________________________________
> > LLVM Developers mailing list
> > llvm-dev at lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
> >
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20180503/dcae1d47/attachment.html>