[llvm] r344610 - [InstCombine] make sure type is integer before calling ComputeNumSignBits

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 16 15:45:01 PDT 2018


This one is a bit trickier than I remembered. We may have FP here because
we peeked through bitcasts in the caller. It might be better to make the
signbits call there in the caller, but I have to see if that’s feasible. I
reverted this + r344609 at r344612.

On Tue, Oct 16, 2018 at 11:20 AM Friedman, Eli <efriedma at codeaurora.org>
wrote:

> On 10/16/2018 7:44 AM, Sanjay Patel via llvm-commits wrote:
> > Author: spatel
> > Date: Tue Oct 16 07:44:50 2018
> > New Revision: 344610
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=344610&view=rev
> > Log:
> > [InstCombine] make sure type is integer before calling ComputeNumSignBits
> >
> > Modified:
> >      llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
> >
> > Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
> > URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp?rev=344610&r1=344609&r2=344610&view=diff
> >
> ==============================================================================
> > --- llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
> (original)
> > +++ llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp Tue
> Oct 16 07:44:50 2018
> > @@ -1834,7 +1834,8 @@ static bool areInverseVectorBitmasks(Con
> >   Value *InstCombiner::getSelectCondition(Value *A, Value *B) {
> >     // Step 1: We need 0 or all-1's bitmasks.
> >     Type *Ty = A->getType();
> > -  if (ComputeNumSignBits(A) != Ty->getScalarSizeInBits())
> > +  if (Ty->isIntOrIntVectorTy() &&
> > +      ComputeNumSignBits(A) != Ty->getScalarSizeInBits())
>
> "&&"?  Don't we need to exit early if the type isn't an integer type?
>
> -Eli
>
> --
> Employee of Qualcomm Innovation Center, Inc.
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux
> Foundation Collaborative Project
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181016/563f181a/attachment.html>


More information about the llvm-commits mailing list