This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: condition DCE of partially dead calls
On Fri, May 30, 2008 at 10:21 AM, Xinliang David Li <davidxl@google.com> wrote:
> Andrew Pinski wrote:
>>
>> On Fri, May 30, 2008 at 12:11 AM, Xinliang David Li <davidxl@google.com>
>> wrote:
>>>
>>> 2) Enabled only when target float format is IEEE format.
>>
>> + /* The limit constants used in the implementation
>> + assume IEEE floating point format. Other formats
>> + can be supported in the future if needed. */
>> + return (flag_tree_builtin_call_dce != 0
>> + && TARGET_FLOAT_FORMAT == IEEE_FLOAT_FORMAT);
>>
>> This check is incorrect really as the float format might be different
>> from the double format which might be different from the long double
>> format.
>
> You mean format for each mode may be overridden to be non-ieee format
> when the TARGET_FLOAT_FORMAT is set to IEEE_FLOAT_FORMAT?
>
>> Plus REAL_MODE_FORMAT is what you should be checking as
>> TARGET_FLOAT_FORMAT just supplies the default but REAL_MODE_FORMAT can
>> be changed:
>> if (TARGET_LONG_DOUBLE_128 && !TARGET_IEEEQUAD)
>> REAL_MODE_FORMAT (TFmode) = &ibm_extended_format;
>
> So after this override of quad mode format, the TARGET_FLOAT_FORMAT can
> still remain to be IEEE_FLOAT_FORMAT instead of some other value?
Yes, TARGET_FLOAT_FORMAT is only setting the default format and nothing more.
> Basically, you are suggesting check format for individual mode. How
> about long double? It is mapped to double-extended mode (XF) on some
> targets (x86, ia64), quadMode on some target, while double mode on
> others. XF mode may not exist on some targets, how do I check it safely
> for all platforms?
On PowerPC, the format for long double can either be IEEE 128bit,
64bit IEEE or the IBM 128bit format (which is a double-double format
and still is related to IEEE format as it has two IEEE 64bit floats).
So you really should not be checking IEEE format. Also why are you
checking IEEE format rather than if the format supports infinites and
NaNs?
So you need check the mode when you decide if you are going to do the
DCE rather than just limiting the pass to where IEEE formats are used.
Also doing this optimization on more than IEEE formats seems correct
anyways.
>> Once the spu float format are submitted the spu port will be changed
>> such TARGET_FLOAT_FORMAT is defined to SPU_FLOAT_FORMAT but the double
>> format will be ieee.
>
> I don't see problem with this case, as the TARGET_FLOAT_FORMAT value
> does get changed to non IEEE.
Because the format for double is IEEE, just float is non IEEE. That
is my problem with it, the check is too restrictive and not correct.
Thanks,
Andrew Pinski