[LLVMdev] Bug in InsertElement constant propagation?

Jonathan Roelofs jonathan at codesourcery.com
Thu Jan 15 06:36:09 PST 2015


I'm not sure what the right fix is. I don't see a way to get the float 
out of APFloat without a copy happening. The usual trick to copy a float 
somewhere else but preserve the NaN bits is to use memcpy.

Jon

On 1/15/15 2:29 AM, Raoux, Thomas F wrote:
> I don't see a way to create a ConstantDataVector from Constant or form APFloat though. Did I oversee that?
> Is the solution to had a new get function in ConstantDataVector to allow that? Any hint on what would be the right fix otherwise?
>
> Thomas
>
> -----Original Message-----
> From: Jonathan Roelofs [mailto:jonathan at codesourcery.com]
> Sent: Wednesday, January 14, 2015 10:30 AM
> To: Raoux, Thomas F; LLVM Developers Mailing List
> Subject: Re: [LLVMdev] Bug in InsertElement constant propagation?
>
>
>
> On 1/14/15 11:12 AM, Raoux, Thomas F wrote:
>> Ha here is what I was missing. Thanks Jon. It still seems to me that the transformation of LLVM IR is invalid is that right?
> I don't know if IR is required to preserve NaN bit patterns, but ISTM that it would be better if it did.
>> I assume we shouldn't be converting APFloat to float in order to avoid such problems?
> Yes, I think that's the correct fix.
>
> Jon
>
> --
> Jon Roelofs
> jonathan at codesourcery.com
> CodeSourcery / Mentor Embedded
>

-- 
Jon Roelofs
jonathan at codesourcery.com
CodeSourcery / Mentor Embedded



More information about the llvm-dev mailing list