1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00
Go to file
Sanjay Patel 8380959612 [DAGCombiner] reassociate reciprocal sqrt expression to eliminate FP division
X / (fabs(A) * sqrt(Z)) --> X / sqrt(A*A*Z) --> X * rsqrt(A*A*Z)

In the motivating case from PR46406:
https://bugs.llvm.org/show_bug.cgi?id=46406
...this is restoring the sequence that was originally in the source code.
We extracted a term from within the sqrt because we do not know in
instcombine whether a target will expand a sqrt call.
Note: we could say that the transform in IR should be restricted, but
that would not solve the problem if the source was originally in the
pattern shown here.

This is a gray area for fast-math-flag requirements. I think we should at
least check fast-math-flags on the fdiv and fmul because I view this
transform as 2 pieces: reassociate the fmul operands and form reciprocal
from the fdiv (as with the existing transform). We could argue that the
sqrt also needs FMF, but that was not required before, so we should change
that in a follow-up patch if that seems better.

We don't currently have a way to check that the target will produce a sqrt
or recip estimate without actually creating nodes (the APIs are SDValue
getSqrtEstimate() and SDValue getRecipEstimate()), so we clean up
speculatively created nodes if we are not able to create an estimate.
The x86 test with doubles verifies that we are not changing a test with
no estimate sequence.

Differential Revision: https://reviews.llvm.org/D82716
2020-07-06 19:12:21 -04:00
benchmarks
bindings Fix go bindings after FixedVectorType -> VectorType change. 2020-05-15 16:37:57 -07:00
cmake Fix missing build dependencies on omp_gen 2020-07-02 07:55:20 -06:00
docs [XCOFF][AIX] Use 'L..' instead of '.L' for getPrivateGlobalPrefix in DataLayout 2020-07-03 18:25:14 +00:00
examples [docs/examples] As part of using inclusive language within the llvm 2020-06-20 00:51:18 -07:00
include [NFC] change getLimitedCodeGenPipelineReason to static function 2020-07-06 15:39:27 -07:00
lib [DAGCombiner] reassociate reciprocal sqrt expression to eliminate FP division 2020-07-06 19:12:21 -04:00
projects
resources
runtimes [libc++] Fix the runtimes build after making __config_site mandatory 2020-06-26 01:26:34 -04:00
test [DAGCombiner] reassociate reciprocal sqrt expression to eliminate FP division 2020-07-06 19:12:21 -04:00
tools Temporarily Revert "[llvm-install-name-tool] Merge install-name options" as it breaks the objcopy build. 2020-07-06 15:40:14 -07:00
unittests Fix [-Werror,-Wsign-compare] in dominator unit test. 2020-07-06 14:50:13 -07:00
utils [llvm-reduce] Reducing call operand bundles 2020-07-07 01:16:37 +03:00
.clang-format
.clang-tidy
.gitattributes
.gitignore Continue removing llgo. 2020-02-10 10:33:58 -08:00
CMakeLists.txt Fix missing build dependencies on omp_gen 2020-07-02 07:55:20 -06:00
CODE_OWNERS.TXT Make myself code owner of InferAddressSpaces 2020-06-08 21:26:01 -04:00
configure
CREDITS.TXT
LICENSE.TXT
llvm.spec.in
LLVMBuild.txt
README.txt Test commit. 2020-03-14 18:08:26 -07:00
RELEASE_TESTERS.TXT

The LLVM Compiler Infrastructure
================================

This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.