1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 12:12:47 +01:00
llvm-mirror/lib/CodeGen/SelectionDAG
Sanjay Patel 3ea496a526 [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
..
CMakeLists.txt
DAGCombiner.cpp [DAGCombiner] try to convert pow(x, 1/3) to cbrt(x) 2018-09-16 16:50:26 +00:00
FastISel.cpp [IR] Replace isa<TerminatorInst> with isTerminator(). 2018-08-26 09:51:22 +00:00
FunctionLoweringInfo.cpp DAG: Add calling convention argument to calling convention funcs 2018-07-28 13:25:19 +00:00
InstrEmitter.cpp [MI] Change the array of MachineMemOperand pointers to be 2018-08-16 21:30:05 +00:00
InstrEmitter.h
LegalizeDAG.cpp [DAGCombiner] try to convert pow(x, 1/3) to cbrt(x) 2018-09-16 16:50:26 +00:00
LegalizeFloatTypes.cpp DAG: Try to custom lower when promoting float operands 2018-08-15 20:34:54 +00:00
LegalizeIntegerTypes.cpp [SelectionDAG] Remove some code from PromoteIntOp_MGATHER that handles UpdateNodeOperands returning an existing node instead of updating. 2018-09-12 05:25:41 +00:00
LegalizeTypes.cpp
LegalizeTypes.h [X86] Support v2i32 gather/scatter indices with -x86-experimental-vector-widening-legalization 2018-08-29 02:12:49 +00:00
LegalizeTypesGeneric.cpp
LegalizeVectorOps.cpp [FPEnv] Support constrained FREM intrinsic 2018-08-20 19:28:56 +00:00
LegalizeVectorTypes.cpp [X86] Support v2i32 gather/scatter indices with -x86-experimental-vector-widening-legalization 2018-08-29 02:12:49 +00:00
LLVMBuild.txt
ResourcePriorityQueue.cpp
ScheduleDAGFast.cpp
ScheduleDAGRRList.cpp
ScheduleDAGSDNodes.cpp [SDAG] Remove the reliance on MI's allocation strategy for 2018-08-14 23:30:32 +00:00
ScheduleDAGSDNodes.h
ScheduleDAGVLIW.cpp
SDNodeDbgValue.h SelectionDAG: Add compact SDDbgValue representation to -dag-dump-verbose output 2018-09-14 17:08:02 +00:00
SelectionDAG.cpp Fix debug info for SelectionDAG legalization of DAG nodes with two results. 2018-09-14 19:38:45 +00:00
SelectionDAGAddressAnalysis.cpp
SelectionDAGBuilder.cpp DAG: Handle odd vector sizes in calling conv splitting 2018-09-10 11:49:23 +00:00
SelectionDAGBuilder.h DAG: Add calling convention argument to calling convention funcs 2018-07-28 13:25:19 +00:00
SelectionDAGDumper.cpp [DAGCombiner] try to convert pow(x, 1/3) to cbrt(x) 2018-09-16 16:50:26 +00:00
SelectionDAGISel.cpp [NFC] Rename the DivergenceAnalysis to LegacyDivergenceAnalysis 2018-08-30 14:21:36 +00:00
SelectionDAGPrinter.cpp
SelectionDAGTargetInfo.cpp
StatepointLowering.cpp Remove trailing space 2018-07-30 19:41:25 +00:00
StatepointLowering.h
TargetLowering.cpp DAG: Fix expansion of unaligned FP loads and stores 2018-09-13 12:14:23 +00:00