Page MenuHomePhabricator

[FPEnv] Lower STRICT_FP_EXTEND and STRICT_FP_ROUND nodes in preprocess phase of ISelLowering to mirror non-strict nodes on x86.
ClosedPublic

Authored by ajwock on Jun 13 2019, 7:42 AM.

Details

Summary

I recently discovered a bug on the x86 platform: The fp80 type was not handled well by x86 for constrained floating point nodes, as their regular counterparts are replaced by extending loads and truncating stores during the preprocess phase. Normally, platforms don't have this issue, as they don't typically attempt to perform such legalizations during instruction selection preprocessing. Before this change, strict_fp nodes survived until they were mutated to normal nodes, which happened shortly after preprocessing on other platforms. This modification lowers these nodes at the same phase while properly utilizing the chain.

Diff Detail

Repository
rL LLVM

Event Timeline

ajwock created this revision.Jun 13 2019, 7:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 13 2019, 7:42 AM
ajwock edited the summary of this revision. (Show Details)Jun 13 2019, 10:14 AM
ajwock edited the summary of this revision. (Show Details)Jun 13 2019, 10:17 AM
craig.topper added inline comments.Jun 13 2019, 10:23 AM
lib/Target/X86/X86ISelDAGToDAG.cpp
1047 ↗(On Diff #204535)

Can we just use ReplaceAllUsesWith(SDNode *From, SDNode *To) here and get both in one shot?

ajwock updated this revision to Diff 204585.Jun 13 2019, 11:07 AM

That is a good observation, Craig. Changed.

craig.topper accepted this revision.Jun 13 2019, 11:16 AM

LGTM with that typo fixed.

lib/Target/X86/X86ISelDAGToDAG.cpp
1036 ↗(On Diff #204585)

th -> the

This revision is now accepted and ready to land.Jun 13 2019, 11:16 AM
This revision was automatically updated to reflect the committed changes.