[PATCH] D11918: Constant propagation after hiting assume(icmp)

Piotr Padlewski via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 10 16:55:01 PDT 2015


Oh I see, that's insanely smart.

I still have to make some specific things for ICMP_EQ (adding things to
ReplaceWithConstMap), so I can also do the same thing for fcmp.

On Mon, Aug 10, 2015 at 3:50 PM, Daniel Berlin <dberlin at dberlin.org> wrote:

> Not just that.
> llvm.assume asserts whatever the condition is, is true.
> PropagateEquality will propagate equalities like (A < B) == true as
> well, by replacing all dominated instances of A>= B == false.
>
> So you should be able to "propagate" basically all the ICMP variants.
>
>
> On Mon, Aug 10, 2015 at 3:43 PM, Piotr Padlewski <prazek at google.com>
> wrote:
> > Prazek marked an inline comment as done.
> >
> > ================
> > Comment at: lib/Transforms/Scalar/GVN.cpp:2231
> > @@ +2230,3 @@
> > +      if (ICmpInst *ICmpI = dyn_cast<ICmpInst>(V)) {
> > +        if (ICmpI->getSignedPredicate() ==
> ICmpInst::Predicate::ICMP_EQ) {
> > +
> > ----------------
> > dberlin wrote:
> >> Why only ICMP_EQ?
> > You mean to add fcmp also?
> >
> >
> > http://reviews.llvm.org/D11918
> >
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150810/891c2b16/attachment.html>


More information about the llvm-commits mailing list