LLVM 22.0.0git
LibcallLoweringInfo.cpp
Go to the documentation of this file.
1//===- LibcallLoweringInfo.cpp - Interface for runtime libcalls -----------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
10
11using namespace llvm;
12
14 const RTLIB::RuntimeLibcallsInfo &RTLCI)
15 : RTLCI(RTLCI) {
16 // TODO: This should be generated with lowering predicates, and assert the
17 // call is available.
18 for (RTLIB::LibcallImpl Impl : RTLIB::libcall_impls()) {
19 if (RTLCI.isAvailable(Impl)) {
20 RTLIB::Libcall LC = RTLIB::RuntimeLibcallsInfo::getLibcallFromImpl(Impl);
21 // FIXME: Hack, assume the first available libcall wins.
22 if (LibcallImpls[LC] == RTLIB::Unsupported)
23 LibcallImpls[LC] = Impl;
24 }
25 }
26}
LLVM_ABI LibcallLoweringInfo(const RTLIB::RuntimeLibcallsInfo &RTLCI)
static auto libcall_impls()
This is an optimization pass for GlobalISel generic memory operations.
A simple container for information about the supported runtime calls.
static RTLIB::Libcall getLibcallFromImpl(RTLIB::LibcallImpl Impl)
Return the libcall provided by Impl.