[DAGCombine] Add hook to allow target specific test for sqrt input
authorQingShan Zhang <qshanz@cn.ibm.com>
Wed, 25 Nov 2020 05:37:15 +0000 (05:37 +0000)
committerQingShan Zhang <qshanz@cn.ibm.com>
Wed, 25 Nov 2020 05:37:15 +0000 (05:37 +0000)
commit9c588f53fc423dd0ed69250fbc93b37b40c0ef44
tree44477c842305d355d7af0ded7a9b1e678116036c
parent2c7870dccaf31167b7d7b422ed51d1f0b3e343d3
[DAGCombine] Add hook to allow target specific test for sqrt input

PowerPC has instruction ftsqrt/xstsqrtdp etc to do the input test for software square root.
LLVM now tests it with smallest normalized value using abs + setcc. We should add hook to
target that has test instructions.

Reviewed By: Spatel, Chen Zheng, Qiu Chao Fang

Differential Revision: https://reviews.llvm.org/D80706
llvm/include/llvm/CodeGen/TargetLowering.h
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/lib/Target/PowerPC/PPCISelLowering.cpp
llvm/lib/Target/PowerPC/PPCISelLowering.h
llvm/lib/Target/PowerPC/PPCInstrFormats.td
llvm/lib/Target/PowerPC/PPCInstrInfo.td
llvm/lib/Target/PowerPC/PPCInstrVSX.td
llvm/test/CodeGen/PowerPC/fma-mutate.ll
llvm/test/CodeGen/PowerPC/recipest.ll