[LLVMdev] Vector logic regression in r73431

Nicolas Capens nicolas at capens.net
Fri Jul 31 02:21:00 PDT 2009


Now I see. Your patch does address this issue. It seemed so unrelated at
first, and I didn't look closer at it after I was unable to apply it to my
(slightly) older revision. Sorry about that.

Anyway, I can confirm that your patch fixed the asserts and crashes I was
seeing. So as far as I'm concerned go ahead and commit it if you haven't
done so already.



-----Original Message-----
From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On
Behalf Of Eli Friedman
Sent: donderdag 30 juli 2009 18:23
To: LLVM Developers Mailing List
Subject: Re: [LLVMdev] Vector logic regression in r73431

On Thu, Jul 30, 2009 at 5:57 AM, Nicolas Capens<nicolas at capens.net> wrote:
> No, that appears to be something unrelated. I'm currently using revision
> 75246, while that patch only seems to apply to some later revision.

I don't see the connection... anyway, I can't easily help you with an
old revision.

> Anyway, I actually located the real bug. Right at the end of
> InstCombiner::SimplifyDemandedUseBits, there's this piece of code:
>  // If the client is only demanding bits that we know, return the known
>  // constant.
>  if ((DemandedMask & (RHSKnownZero|RHSKnownOne)) == DemandedMask) {
>    Constant *C = Context->getConstantInt(RHSKnownOne);
>    if (isa<PointerType>(V->getType()))
>      C = Context->getConstantExprIntToPtr(C, V->getType());
>    return C;
>  }
>  return false;
> }
> Note that C is a scalar integer, and so when V is actually a vector the
> isn't preserved.

Right... my patch fixes that, I think.

> I'm not entirely sure how this function is supposed to work with vectors
> though. DemandedMask, KnownOne and KnownZero are APInt's (scalars) the
> of an element of the vector. So when, as the comment describes, only known
> bits are demanded, does that apply to just one element of the vector or

It applies to all elements of the vector.


LLVM Developers mailing list
LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu

More information about the llvm-dev mailing list