[llvm-commits] [PATCH] KNRPromotion fix when FLOAT_TYPE_SIZE is not smaller than DOUBLE_TYPE_SIZE

Dale Johannesen dalej at apple.com
Tue Jun 9 11:29:02 PDT 2009


On Jun 9, 2009, at 5:56 AMPDT, Mikael Lepistö wrote:

> Hi,
>
> I found out that
>
> void function(value)
> float value; {}
>
> generated following bitcode
>
> define void @function(double %value1)
>
> In IRC channel this was though to be correct for platforms where  
> DOUBLE_TYPE_SIZE is bigger than float size e.g. x86. However in our  
> tce-llvm-gcc cross-compiler DOUBLE_TYPE_SIZE is set to be 32 bits as  
> FLOAT_TYPE_SIZE. So in this case correct bitcode should have been
>
> define void @function(float %value1)
>
> So here's patch attached for fixing the problem.

LLVM IR defines "float" and "double" to be 32 and 64 bits  
respectively.  So I think a patch that checks for those magic numbers  
would be better.

> Mikael Lepistö
-------------- next part --------------
A non-text attachment was scrubbed...
Name: KNRPromotion_when_double_is_same_size_with_float.patch
Type: text/x-diff
Size: 606 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20090609/c1c0c7dc/attachment.patch>
-------------- next part --------------
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list