This is an archive of the discontinued LLVM Phabricator instance.

[flang] Remove blank from NaN string representation
ClosedPublic

Authored by vdonaldson on Sep 1 2021, 10:16 AM.

Details

Summary

Flang front end function DumpHexadecimal generates a string representation of a REAL value. When the value is a NaN, the string contains a blank, as in "NaN 0x7fc00000". This function is used by lowering to generate a string that is then passed to llvm Support function ConvertFromStringSpecials, which does not expect a blank in the string. Remove the blank to allow correct recognition of a NaN by this llvm function.

Note that function DumpHexadecimal is not exercised by the front end itself. This functionality is only exercised by code that is not yet present in llvm.

Diff Detail

Event Timeline

vdonaldson created this revision.Sep 1 2021, 10:16 AM
vdonaldson requested review of this revision.Sep 1 2021, 10:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 1 2021, 10:16 AM
klausler accepted this revision.Sep 1 2021, 10:22 AM
This revision is now accepted and ready to land.Sep 1 2021, 10:22 AM
vdonaldson retitled this revision from Remove blank from NaN string representation to [flang] Remove blank from NaN string representation.Sep 1 2021, 10:30 AM
vdonaldson updated this revision to Diff 370124.EditedSep 1 2021, 5:46 PM

Flang front end function DumpHexadecimal generates a string representation of a REAL value. When the value is a NaN, the string contains a blank, as in "NaN 0x7fc00000". This function is used by lowering to generate a string that is then passed to llvm Support function ConvertFromStringSpecials, which does not expect a blank in the string. Remove the blank to allow correct recognition of a NaN by this llvm function.

PeteSteinfeld accepted this revision.Sep 1 2021, 7:09 PM

All build, tests, and looks good.

vdonaldson closed this revision.Sep 3 2021, 1:16 PM