llvm-project/llvm
Sanjay Patel 3eaf500a6d [DAGCombiner] try to convert pow(x, 1/3) to cbrt(x)
This is a follow-up suggested in D51630 and originally proposed as an IR transform in D49040.

Copying the motivational statement by @evandro from that patch:
"This transformation helps some benchmarks in SPEC CPU2000 and CPU2006, such as 188.ammp, 
447.dealII, 453.povray, and especially 300.twolf, as well as some proprietary benchmarks. 
Otherwise, no regressions on x86-64 or A64."

I'm proposing to add only the minimum support for a DAG node here. Since we don't have an 
LLVM IR intrinsic for cbrt, and there are no other DAG ways to create a FCBRT node yet, I 
don't think we need to worry about DAG builder, legalization, a strict variant, etc. We 
should be able to expand as needed when adding more functionality/transforms. For reference, 
these are transform suggestions currently listed in SimplifyLibCalls.cpp:

//   * cbrt(expN(X))  -> expN(x/3)
//   * cbrt(sqrt(x))  -> pow(x,1/6)
//   * cbrt(cbrt(x))  -> pow(x,1/9)

Also, given that we bail out on long double for now, there should not be any logical 
differences between platforms (unless there's some platform out there that has pow()
but not cbrt()).

Differential Revision: https://reviews.llvm.org/D51753

llvm-svn: 342348
2018-09-16 16:50:26 +00:00
..
benchmarks Pull google/benchmark library to the LLVM tree 2018-08-28 09:42:41 +00:00
bindings [bindings/go] Add DebugLoc parameter to InsertXXXAtEnd() 2018-09-13 21:16:39 +00:00
cmake Test commit access 2018-09-14 19:43:11 +00:00
docs Add flag to llvm-profdata to allow symbols in profile data to be remapped, and 2018-09-13 20:22:02 +00:00
examples
include [DAGCombiner] try to convert pow(x, 1/3) to cbrt(x) 2018-09-16 16:50:26 +00:00
lib [DAGCombiner] try to convert pow(x, 1/3) to cbrt(x) 2018-09-16 16:50:26 +00:00
projects
resources
runtimes
test [DAGCombiner] try to convert pow(x, 1/3) to cbrt(x) 2018-09-16 16:50:26 +00:00
tools [llvm-readobj] Make some commonly used short options visibile in -help 2018-09-15 21:27:46 +00:00
unittests Fix -Wdangling-else gcc warning. NFCI. 2018-09-16 12:30:41 +00:00
utils Fix lit/example/many-tests pickling issue 2018-09-14 19:44:09 +00:00
.arcconfig
.clang-format
.clang-tidy
.gitattributes
.gitignore
CMakeLists.txt [benchmark] Re-enable benchmarks on all platforms including Windows 2018-09-07 21:47:00 +00:00
CODE_OWNERS.TXT Add owner for llvm-objcopy 2018-08-09 22:05:19 +00:00
CREDITS.TXT
LICENSE.TXT
LLVMBuild.txt
README.txt
RELEASE_TESTERS.TXT
configure
llvm.spec.in

README.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.