OSDN Git Service

[DAGCombine] Optimize pow(X, 0.75) to sqrt(X) * sqrt(sqrt(X))
authorNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Fri, 8 Feb 2019 19:50:58 +0000 (19:50 +0000)
committerNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Fri, 8 Feb 2019 19:50:58 +0000 (19:50 +0000)
commit5f3121a8b0ee1fdd28b7d4dab880cecd5ea513a5
treef2c91fcf489f0d844e69fdf7a7672104ed0de626
parent05a2d7fcc159bed9366069f7c8caa6283ea1e3c6
[DAGCombine] Optimize pow(X, 0.75) to sqrt(X) * sqrt(sqrt(X))

The sqrt case is faster and we already do this for the case where
the exponent is 0.25. This adds the 0.75 case which is also not
sensitive to signed zeros.

Patch by Whitney Tsang (Whitney)

Differential revision: https://reviews.llvm.org/D57434

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353557 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
test/CodeGen/AArch64/pow.75.ll [new file with mode: 0644]
test/CodeGen/ARM/pow.75.ll [new file with mode: 0644]
test/CodeGen/PowerPC/pow.75.ll [new file with mode: 0644]
test/CodeGen/X86/pow.75.ll [new file with mode: 0644]