This is an archive of the discontinued LLVM Phabricator instance.

[GlobalISel] Don't transform FSUB(-0, X) -> FNEG(X) in GlobalISel.
ClosedPublic

Authored by cameron.mcinally on Aug 3 2020, 8:52 AM.

Details

Summary

This patch stops unconditionally transforming FSUB(-0, X) into an FNEG(X) while building the MIR.

This corresponds with the old ISel change in D84056.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptAug 3 2020, 8:52 AM
cameron.mcinally requested review of this revision.Aug 3 2020, 8:52 AM
cameron.mcinally retitled this revision from [GlobalISel] Don't transform FSUB(-0, X) -> FNEG(X) in SelectionDAGBuilder. to [GlobalISel] Don't transform FSUB(-0, X) -> FNEG(X) in GlobalISel..Aug 3 2020, 8:52 AM
cameron.mcinally edited the summary of this revision. (Show Details)Aug 3 2020, 8:54 AM
arsenm accepted this revision.Aug 4 2020, 5:28 AM

I think this leaves behind a redundant test_fneg/test_fneg_fmf case elsewhere

This revision is now accepted and ready to land.Aug 4 2020, 5:28 AM

I think this leaves behind a redundant test_fneg/test_fneg_fmf case elsewhere

You're probably right. Just took a look and I don't see anything obvious though. Did you have a particular set of tests in mind?

I do see some tests that transform an illegal G_FNEG into an G_FSUB. I don't fully understand the motivation yet, but that's probably worth attention.

arsenm added a comment.Aug 4 2020, 9:27 AM

I think this leaves behind a redundant test_fneg/test_fneg_fmf case elsewhere

You're probably right. Just took a look and I don't see anything obvious though. Did you have a particular set of tests in mind?

I do see some tests that transform an illegal G_FNEG into an G_FSUB. I don't fully understand the motivation yet, but that's probably worth attention.

No, I mean you changed these cases using fsub in the irtranslator test, when there were already tests for fneg here already. LegalizerHelper still does have an incorrect expansion of fneg into fsub, but that's another story

Ah, ok. Tests removed with:

commit 724b035fe4df89e807f85ee202da8b0bc227895b (HEAD -> master, origin/master, origin/HEAD)
Author: Cameron McInally <mcinally@cray.com>
Date: Tue Aug 4 11:32:15 2020 -0500

[GlobalISel] Remove redundant FNEG tests.

These tests were made redundant by D85139.