[PATCH] SelectionDAG: fold (fp_to_u/sint (u/sint_to_fp val)) when possible

Mehdi Amini mehdi.amini at apple.com
Tue Feb 10 21:11:25 PST 2015


The discussion ended up with: fptoui(), fptosi(), sitofp(), and uitofp() are all undefined if the value cannot fit in the destination type.

So I’d expect we go for the simple solution where we don’t care about getFPMantissaWidth().
We only check getScalarSizeInBits() to insert the appropriate trunc or s/zext if necessary.

I assume that ISD::FP_TO_SINT (same with the other) has the same semantic as the IR instruction, and thus is applies to the DAG as well.

— 
Mehdi



> On Feb 10, 2015, at 6:35 PM, Fiona Glaser <fglaser at apple.com> wrote:
> 
> Any comments on the rest of this?
> 
> Fiona
> 
>> On Feb 9, 2015, at 4:35 PM, Eric Christopher <echristo at gmail.com <mailto:echristo at gmail.com>> wrote:
>> 
>> Feel free to commit the change to port a test to FileCheck separately (and any time you'd like).
>> 
>> Thanks!
>> 
>> -eric
>> 
>> On Mon Feb 09 2015 at 2:53:45 PM Fiona Glaser <fglaser at apple.com <mailto:fglaser at apple.com>> wrote:
>> Ah, sorry, missed the comments about the tests. Updated the DAG patch with edited and improved test and minor code fixes.
>> 
>> Fiona
>> 
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu <mailto:llvm-commits at cs.uiuc.edu>
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits <http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits>
> 
> _______________________________________________
> 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/20150210/7d8483a0/attachment.html>


More information about the llvm-commits mailing list