1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00
llvm-mirror/lib
Sanjay Patel 42bcf8cc7b [DAGCombiner] try to convert pow(x, 0.25) to sqrt(sqrt(x))
This was proposed as an IR transform in D49306, but it was not clearly justifiable as a canonicalization. 
Here, we only do the transform when the target tells us that sqrt can be lowered with inline code.

This is the basic case. Some potential enhancements are in the TODO comments:

1. Generalize the transform for other exponents (allow more than 2 sqrt calcs if that's really cheaper).
2. If we have less fast-math-flags, generate code to avoid -0.0 and/or INF.
3. Allow the transform when optimizing/minimizing size (might require a target hook to get that right).

Note that by default, x86 converts single-precision sqrt calcs into sqrt reciprocal estimate with 
refinement. That codegen is controlled by CPU attributes and can be manually overridden. We have plenty 
of test coverage for that already, so I didn't bother to include extra testing for that here. AArch uses 
its full-precision ops in all cases (not sure if that's the intended behavior or not, but that should 
also be covered by existing tests).

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

llvm-svn: 341481
2018-09-05 17:01:56 +00:00
..
Analysis [NFC] Optionally pass a function to emitInstrCountChangedRemark 2018-08-31 20:54:37 +00:00
AsmParser [x86/SLH] Add a real Clang flag and LLVM IR attribute for Speculative 2018-09-04 12:38:00 +00:00
BinaryFormat [WebAssembly] clang-format (NFC) 2018-09-05 01:27:38 +00:00
Bitcode [x86/SLH] Add a real Clang flag and LLVM IR attribute for Speculative 2018-09-04 12:38:00 +00:00
CodeGen [DAGCombiner] try to convert pow(x, 0.25) to sqrt(sqrt(x)) 2018-09-05 17:01:56 +00:00
DebugInfo [dwarfdump] Improve -diff option by hiding more data. 2018-09-04 16:21:37 +00:00
Demangle Remove some debugging code that was accidentally left in. 2018-08-30 21:00:57 +00:00
ExecutionEngine clang-format r341282. 2018-09-02 01:29:29 +00:00
Fuzzer
FuzzMutate [IR] Replace isa<TerminatorInst> with isTerminator(). 2018-08-26 09:51:22 +00:00
IR [NFC] Improve clarity in emitInstrCountChangedRemark 2018-09-04 21:03:43 +00:00
IRReader
LineEditor
Linker
LTO [ThinLTO] Fix memory corruption in ThinLTOCodeGenerator when CodeGenOnly was specified 2018-09-04 22:54:17 +00:00
MC [WebAssembly] clang-format (NFC) 2018-09-05 01:27:38 +00:00
Object [WebAssembly] clang-format (NFC) 2018-09-05 01:27:38 +00:00
ObjectYAML [WebAssembly] clang-format (NFC) 2018-09-05 01:27:38 +00:00
Option Revert r341329 due to MSAN error 2018-09-03 18:13:46 +00:00
Passes [PGO] Control Height Reduction 2018-09-04 17:19:13 +00:00
ProfileData
Support [Windows] Convert from UTF-8 to UTF-16 when writing to a Windows console 2018-09-05 00:08:56 +00:00
TableGen
Target [Hexagon] Ignore unnamed globals in HexagonConstExtenders 2018-09-05 15:54:44 +00:00
Testing
ToolDrivers
Transforms [ControlHeightReduction] Remove unused includes 2018-09-05 13:51:05 +00:00
WindowsManifest
XRay [XRay] Add a RecordPrinter visitor for FDR Records 2018-09-05 06:57:23 +00:00
CMakeLists.txt
LLVMBuild.txt