summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2016-06-16 16:58:54 +0000
committerSanjay Patel <spatel@rotateright.com>2016-06-16 16:58:54 +0000
commitf664f3a5786545e73e2d99ddb3ca1ce1d8049c83 (patch)
tree43d736ce0b4684ef2d48cd303a60e0a3574415ad /llvm/lib/Transforms/Scalar
parentab3d91b8f1d322782a00eb4200c7e4381eebe105 (diff)
downloadbcm5719-llvm-f664f3a5786545e73e2d99ddb3ca1ce1d8049c83.tar.gz
bcm5719-llvm-f664f3a5786545e73e2d99ddb3ca1ce1d8049c83.zip
[DAG] Remove redundant FMUL in Newton-Raphson SQRT code
When calculating a square root using Newton-Raphson with two constants, a naive implementation is to use five multiplications (four muls to calculate reciprocal square root and another one to calculate the square root itself). However, after some reassociation and CSE the same result can be obtained with only four multiplications. Unfortunately, there's no reliable way to do such a reassociation in the back-end. So, the patch modifies NR code itself so that it directly builds optimal code for SQRT and doesn't rely on any further reassociation. Patch by Nikolai Bozhenov! Differential Revision: http://reviews.llvm.org/D21127 llvm-svn: 272920
Diffstat (limited to 'llvm/lib/Transforms/Scalar')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud