[PATCH] D21512: [InstSimplify] look through zexts of icmps to eliminate obviously false logic (PR27869)

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 20 09:21:00 PDT 2016


spatel added a comment.

In http://reviews.llvm.org/D21512#461912, @majnemer wrote:

> In http://reviews.llvm.org/D21512#461901, @spatel wrote:
>
> > In http://reviews.llvm.org/D21512#461900, @majnemer wrote:
> >
> > > Hmm.  More generally, how about having and of zexts get treated as zext of ands?
> >
> >
> > I think we already do that, but the case in the bug report shows an example where one of the zexts is gone before we reach the and.
>
>
> I don't believe so, what I imagined was something like the following: https://ghostbin.com/paste/fdc72


Ah - you meant here in InstSimplify; I was still thinking InstCombine. This looks nice. I was wondering how to make the cast without creating an instruction, and your paste answers that: use ConstantExpr::getCast().

Let me add more tests and update. Thanks!


http://reviews.llvm.org/D21512





More information about the llvm-commits mailing list