[llvm] r180779 - Fix a bug in foldSelectICmpAndOr.

David Majnemer david.majnemer at gmail.com
Wed May 1 20:55:09 PDT 2013


Test case added in r180907.

-- 
David Majnemer


On Tue, Apr 30, 2013 at 4:32 AM, Eric Christopher <echristo at gmail.com>wrote:

> Testcase?
>
> -eric
>
> On Tue, Apr 30, 2013 at 11:36 AM, David Majnemer
> <david.majnemer at gmail.com> wrote:
> > Author: majnemer
> > Date: Tue Apr 30 05:36:33 2013
> > New Revision: 180779
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=180779&view=rev
> > Log:
> > Fix a bug in foldSelectICmpAndOr.
> >
> > Differences in bitwidth between X and Y could exist even if C1 and C2
> have
> > the same Log2 representation.
> >
> > Modified:
> >     llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp
> >
> > Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp
> > URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp?rev=180779&r1=180778&r2=180779&view=diff
> >
> ==============================================================================
> > --- llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp
> (original)
> > +++ llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp Tue Apr
> 30 05:36:33 2013
> > @@ -401,7 +401,8 @@ static Value *foldSelectICmpAndOr(const
> >    } else if (C1Log > C2Log) {
> >      V = Builder->CreateLShr(V, C1Log - C2Log);
> >      V = Builder->CreateZExtOrTrunc(V, Y->getType());
> > -  }
> > +  } else
> > +    V = Builder->CreateZExtOrTrunc(V, Y->getType());
> >
> >    ICmpInst::Predicate Pred = IC->getPredicate();
> >    if ((Pred == ICmpInst::ICMP_NE && OrOnFalseVal) ||
> >
> >
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130501/f30335ad/attachment.html>


More information about the llvm-commits mailing list