LLVM 22.0.0git
RuntimeLibcallInfo.cpp
Go to the documentation of this file.
1//===- RuntimeLibcallInfo.cpp ---------------------------------------------===//
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
14AnalysisKey RuntimeLibraryAnalysis::Key;
15
17 ExceptionHandling ExceptionModel,
19 EABI EABIVersion,
20 StringRef ABIName,
21 VectorLibrary VecLib)
22 : LibcallsInfo(std::in_place, TT, ExceptionModel, FloatABI, EABIVersion,
23 ABIName, VecLib) {}
24
27 if (!LibcallsInfo)
28 LibcallsInfo = RTLIB::RuntimeLibcallsInfo(M);
29 return *LibcallsInfo;
30}
31
33 "Runtime Library Function Analysis", false, true)
34
36 : ImmutablePass(ID), RTLA(RTLIB::RuntimeLibcallsInfo(Triple())) {}
37
39 const Triple &TT, ExceptionHandling ExceptionModel,
40 FloatABI::ABIType FloatABI, EABI EABIVersion, StringRef ABIName,
41 VectorLibrary VecLib)
42 : ImmutablePass(ID), RTLCI(std::in_place, TT, ExceptionModel, FloatABI,
43 EABIVersion, ABIName, VecLib) {}
44
46
50
54
55// Assume this is stable unless explicitly invalidated.
57 Module &M, const PreservedAnalyses &PA,
58 ModuleAnalysisManager::Invalidator &) {
59 auto PAC = PA.getChecker<RuntimeLibraryAnalysis>();
60 return !PAC.preservedWhenStateless();
61}
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
Definition PassSupport.h:56
Represent the analysis usage information of a pass.
void setPreservesAll()
Set by analyses that do not transform their input at all.
ImmutablePass class - This class is used to provide information that does not need to be run.
Definition Pass.h:285
ImmutablePass(char &pid)
Definition Pass.h:287
ModulePass class - This class is used to implement unstructured interprocedural optimizations and ana...
Definition Pass.h:255
A Module instance is used to store all the information related to an LLVM module.
Definition Module.h:67
A set of analyses that are preserved following a run of a transformation pass.
Definition Analysis.h:112
PreservedAnalysisChecker getChecker() const
Build a checker for this PreservedAnalyses and the specified analysis type.
Definition Analysis.h:275
LLVM_ABI RTLIB::RuntimeLibcallsInfo run(const Module &M, ModuleAnalysisManager &)
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
StringRef - Represent a constant reference to a string, i.e.
Definition StringRef.h:55
Triple - Helper class for working with autoconf configuration names.
Definition Triple.h:47
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
Definition CallingConv.h:24
This is an optimization pass for GlobalISel generic memory operations.
ExceptionHandling
Definition CodeGen.h:53
LLVM_ABI ModulePass * createRuntimeLibraryInfoWrapperPass()
VectorLibrary
List of known vector-functions libraries.
EABI
Definition CodeGen.h:73
AnalysisManager< Module > ModuleAnalysisManager
Convenience typedef for the Module analysis manager.
Definition MIRParser.h:39
Implement std::hash so that hash_code can be used in STL containers.
Definition BitVector.h:867
A special type used by analysis passes to provide an address that identifies that particular analysis...
Definition Analysis.h:29
A simple container for information about the supported runtime calls.
bool invalidate(Module &M, const PreservedAnalyses &PA, ModuleAnalysisManager::Invalidator &)