Sanjay Patel
3ffb751f3d
[InstCombine] fold copysign with fabs/fneg operand
...
We already get this in the backend, but we need to do
it in IR too to consistently get yet more copysign
transforms.
2020-08-16 08:53:47 -04:00
Sanjay Patel
4d5fdff434
[InstCombine] add tests for copysign; NFC
2020-08-16 08:53:47 -04:00
Sanjay Patel
34d35d4a42
[ValueTracking] fix miscompile in maxnum case of cannotBeOrderedLessThanZeroImpl (PR46627)
...
A miscompile with -0.0 is shown in:
http://bugs.llvm.org/PR46627
This is because maxnum(-0.0, +0.0) does not specify a fixed result:
http://llvm.org/docs/LangRef.html#llvm-maxnum-intrinsic
So we need to tighten the constraints for when it is ok to say the
result of maxnum is positive (including +0.0).
Differential Revision: https://reviews.llvm.org/D83601
2020-07-14 08:08:09 -04:00
Sanjay Patel
9cc669d22d
[InstCombine][InstSimplify] add tests for sign of maxnum; NFC
...
More coverage for D83601.
2020-07-14 08:08:09 -04:00
Sanjay Patel
ee3eebba0d
[InstCombine] remove stale comment on test; NFC
2019-12-30 12:39:10 -05:00
Sanjay Patel
987eb8e26c
[InstCombine] propagate sign argument through nested copysigns
...
This is another optimization suggested in PR44153:
https://bugs.llvm.org/show_bug.cgi?id=44153
2019-12-30 11:06:02 -05:00
Sanjay Patel
25cf5d97ac
[InstCombine] add test for copysign; NFC
2019-12-23 17:54:31 -05:00
Sanjay Patel
9cdcd81d3f
[InstCombine] enhance fold for copysign with known sign arg
...
This is another optimization suggested in PRPR44153:
https://bugs.llvm.org/show_bug.cgi?id=44153
2019-12-22 10:07:01 -05:00
Sanjay Patel
c7492fbd4e
[InstCombine] add tests for copysign; NFC
2019-12-18 07:56:36 -05:00
Sanjay Patel
af0babc90a
[InstCombine] fold copysign with constant sign argument to (fneg+)fabs
...
If the sign of the sign argument is known (this could be extended to use ValueTracking),
then we can use fneg+fabs to clear/set the sign bit of the magnitude argument.
http://llvm.org/docs/LangRef.html#llvm-copysign-intrinsic
This transform is already done in DAGCombiner, but we can do it sooner in IR as
suggested in PR44153:
https://bugs.llvm.org/show_bug.cgi?id=44153
We have effectively no analysis for copysign in IR, so we are taking the unusual step
of increasing the number of IR instructions for the negative constant case.
Differential Revision: https://reviews.llvm.org/D70792
2019-12-02 09:23:12 -05:00
Sanjay Patel
5e6b728763
[InstCombine] add tests for copysign; NFC
2019-11-27 11:32:23 -05:00
Sanjay Patel
8d20dd0b06
[ConstFolding] move tests for copysign; NFC
...
InstCombine doesn't have any transforms for copysign currently.
2019-11-26 16:54:46 -05:00
Eric Christopher
cee313d288
Revert "Temporarily Revert "Add basic loop fusion pass.""
...
The reversion apparently deleted the test/Transforms directory.
Will be re-reverting again.
llvm-svn: 358552
2019-04-17 04:52:47 +00:00
Eric Christopher
a863435128
Temporarily Revert "Add basic loop fusion pass."
...
As it's causing some bot failures (and per request from kbarton).
This reverts commit r358543/ab70da07286e618016e78247e4a24fcb84077fda.
llvm-svn: 358546
2019-04-17 02:12:23 +00:00
Karthik Bhat
daa8cd10d9
Allow constant folding of copysign
...
llvm-svn: 203076
2014-03-06 05:32:52 +00:00