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
11
12using namespace llvm;
13
15 const RTLIB::RuntimeLibcallsInfo &RTLCI,
16 const TargetSubtargetInfo &Subtarget)
17 : RTLCI(RTLCI) {
18 // TODO: This should be generated with lowering predicates, and assert the
19 // call is available.
20 for (RTLIB::LibcallImpl Impl : RTLIB::libcall_impls()) {
21 if (RTLCI.isAvailable(Impl)) {
22 RTLIB::Libcall LC = RTLIB::RuntimeLibcallsInfo::getLibcallFromImpl(Impl);
23 // FIXME: Hack, assume the first available libcall wins.
24 if (LibcallImpls[LC] == RTLIB::Unsupported)
25 LibcallImpls[LC] = Impl;
26 }
27 }
28
29 Subtarget.initLibcallLoweringInfo(*this);
30}
LLVM_ABI LibcallLoweringInfo(const RTLIB::RuntimeLibcallsInfo &RTLCI, const TargetSubtargetInfo &Subtarget)
TargetSubtargetInfo - Generic base class for all target subtargets.
virtual void initLibcallLoweringInfo(LibcallLoweringInfo &Info) const
Configure the LibcallLoweringInfo for this subtarget.
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.