[CodeGen] Refactor libcall lookups for RTLIB::POWI_*
authorBjorn Pettersson <bjorn.a.pettersson@ericsson.com>
Mon, 24 May 2021 21:17:18 +0000 (23:17 +0200)
committerBjorn Pettersson <bjorn.a.pettersson@ericsson.com>
Wed, 2 Jun 2021 09:40:34 +0000 (11:40 +0200)
commit536e02a23c6555403a844810a42d2f32b7e59d63
tree92076399544cd6aee70854ec278eeda6d5a4ba02
parentd1273d39d377dffeab684ca58176302dbad6c629
[CodeGen] Refactor libcall lookups for RTLIB::POWI_*

Use RuntimeLibcalls to get a common way to pick correct RTLIB::POWI_*
libcall for a given value type.

This includes a small refactoring of ExpandFPLibCall and
ExpandArgFPLibCall in SelectionDAGLegalize to share a bit of code,
plus adding an ExpandFPLibCall version that can be called directly
when expanding FPOWI/STRICT_FPOWI to ensure that we actually use
the same RTLIB::Libcall when expanding the libcall as we used when
checking the legality of such a call by doing a getLibcallName check.

Differential Revision: https://reviews.llvm.org/D103050
llvm/include/llvm/CodeGen/RuntimeLibcalls.h
llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
llvm/lib/CodeGen/TargetLoweringBase.cpp