[llvm] r178031 - Make InstCombineCasts.cpp:OptimizeIntToFloatBitCast endian safe.

Duncan Sands baldrick at free.fr
Tue Mar 26 10:00:50 PDT 2013


Hi Ulrich,

On 26/03/13 17:46, Ulrich Weigand wrote:
> Duncan Sands <baldrick at free.fr> wrote:
>
>>> Make InstCombineCasts.cpp:OptimizeIntToFloatBitCast endian safe.
>> ...
>>
>> the testcase seems to be missing.
>
> Hmm, it fixed an existing test case failure for me on PowerPC.
> But I can try and see if I manage to extract a .ll level test case.

yes please, that way people not on PowerPC will notice if they break this.

>
>>> +  // We need to know the target byte order to perform this
> optimization.
>>> +  if (!IC.getDataLayout()) return 0;
>>> +
>>
>> I think DataLayout is only needed in the vector case, so how about
> testing it
>> later when the code is treating the vector case, and do the bailing out
> there.
>> That way the non-vector case will still be optimized if there is no
>> target data.
>
> I'm sorry, but I don't see any non-vector case in this routine ...
> Could you elaborate?

Hrm, you are right.  Sorry about that, I was going by memory and I remembered
this routine wrong.

Ciao, Duncan.



More information about the llvm-commits mailing list