This is an archive of the discontinued LLVM Phabricator instance.

[LegalizeTypes] Remove untested code from ExpandIntOp_UINT_TO_FP
ClosedPublic

Authored by craig.topper on Jan 14 2020, 11:54 AM.

Details

Summary

This code is untested in tree because the "APFloat::semanticsPrecision(sem) >= SrcVT.getSizeInBits() - 1" check is false for most combinations for int and fp types except maybe i32 and f64. For that you would need i32 to be an illegal type, but f64 to be legal and have custom handling for legalizing the split sint_to_fp. The precision check itself was added in 2010 to fix a double rounding issue in the algorithm that would occur if the sint_to_fp was not able to do the conversion without rounding.

Diff Detail

Event Timeline

craig.topper created this revision.Jan 14 2020, 11:54 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 14 2020, 11:54 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
efriedma accepted this revision.Jan 14 2020, 12:22 PM

LGTM

check is false for most combinations for int and fp types except maybe i32 and f64

From http://reviews.llvm.org/rL103883, I think the intended target was i64 -> x86_fp80 conversions. But I guess we handle that with target-specific code now.

This revision is now accepted and ready to land.Jan 14 2020, 12:22 PM
This revision was automatically updated to reflect the committed changes.