This is an archive of the discontinued LLVM Phabricator instance.

DAG: Remove hasBitPreservingFPLogic
ClosedPublic

Authored by arsenm on Jan 25 2023, 10:25 AM.

Details

Summary

This doesn't make sense as an option. fneg and fabs are bit
preserving by definition. If a target has some fneg or fabs
instruction that are not bitpreserving it's incorrect to lower
fneg/fabs to use it.

Diff Detail

Event Timeline

arsenm created this revision.Jan 25 2023, 10:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 25 2023, 10:25 AM
arsenm requested review of this revision.Jan 25 2023, 10:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 25 2023, 10:25 AM
efriedma accepted this revision.Jan 25 2023, 10:54 AM

I think hasBitPreservingFPLogic() is an artifact of the old days when FNEG/FABS would sometimes get expanded using FSUB etc. If we don't do that anymore, then sure, let's kill the hook off. LGTM.

llvm/lib/Target/SystemZ/SystemZISelLowering.h
1

Accidental whitespace?

This revision is now accepted and ready to land.Jan 25 2023, 10:54 AM

For reference, I added this hook with:
https://reviews.llvm.org/D19391
...which was responding to:
https://lists.llvm.org/pipermail/llvm-dev/2016-April/098098.html
and:
https://bugs.llvm.org/show_bug.cgi?id=24886#c4

So there were problems before we had fneg/fabs in IR/SDAG, but it seems there were also problems with denorms and other edge cases.
I'm not opposed to this patch, but I think we should notify a wider audience about the change (since the hook defaulted to "off"). Out-of-tree targets may need to make adjustments. Post a message on discourse?

For reference, I added this hook with:
https://reviews.llvm.org/D19391
...which was responding to:
https://lists.llvm.org/pipermail/llvm-dev/2016-April/098098.html
and:
https://bugs.llvm.org/show_bug.cgi?id=24886#c4

So there were problems before we had fneg/fabs in IR/SDAG, but it seems there were also problems with denorms and other edge cases.
I'm not opposed to this patch, but I think we should notify a wider audience about the change (since the hook defaulted to "off"). Out-of-tree targets may need to make adjustments. Post a message on discourse?

I don't think anyone notices those kinds of notices, but I posted https://discourse.llvm.org/t/notice-to-out-of-tree-targets-targetlowering-hasbitpreservingfplogic-is-being-removed/67975

asb added a comment.Jan 30 2023, 7:29 AM

For reference, I added this hook with:
https://reviews.llvm.org/D19391
...which was responding to:
https://lists.llvm.org/pipermail/llvm-dev/2016-April/098098.html
and:
https://bugs.llvm.org/show_bug.cgi?id=24886#c4

So there were problems before we had fneg/fabs in IR/SDAG, but it seems there were also problems with denorms and other edge cases.
I'm not opposed to this patch, but I think we should notify a wider audience about the change (since the hook defaulted to "off"). Out-of-tree targets may need to make adjustments. Post a message on discourse?

I don't think anyone notices those kinds of notices, but I posted https://discourse.llvm.org/t/notice-to-out-of-tree-targets-targetlowering-hasbitpreservingfplogic-is-being-removed/67975

I included it in today's LLVM Weekly, so it hopefully gets an audience (not sure what the bar should be for posting such notices though - there are plenty of things that may break out-of-tree targets and maintainers are presumably used to looking up the commit that removed whatever hook they had been calling to find out why it was removed/changed).