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.
Details
Diff Detail
Event Timeline
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? |
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).
Accidental whitespace?