LLVM  10.0.0svn
TypeMetadataUtils.h
Go to the documentation of this file.
1 //===- TypeMetadataUtils.h - Utilities related to type metadata --*- C++ -*-==//
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 //
9 // This file contains functions that make it easier to manipulate type metadata
10 // for devirtualization.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_ANALYSIS_TYPEMETADATAUTILS_H
15 #define LLVM_ANALYSIS_TYPEMETADATAUTILS_H
16 
17 #include "llvm/ADT/SmallVector.h"
18 #include "llvm/IR/CallSite.h"
19 
20 namespace llvm {
21 
22 class DominatorTree;
23 
24 /// The type of CFI jumptable needed for a function.
29 };
30 
31 /// A call site that could be devirtualized.
33  /// The offset from the address point to the virtual function.
34  uint64_t Offset;
35  /// The call site itself.
37 };
38 
39 /// Given a call to the intrinsic \@llvm.type.test, find all devirtualizable
40 /// call sites based on the call and return them in DevirtCalls.
43  SmallVectorImpl<CallInst *> &Assumes, const CallInst *CI,
44  DominatorTree &DT);
45 
46 /// Given a call to the intrinsic \@llvm.type.checked.load, find all
47 /// devirtualizable call sites based on the call and return them in DevirtCalls.
51  SmallVectorImpl<Instruction *> &Preds, bool &HasNonCallUses,
52  const CallInst *CI, DominatorTree &DT);
53 
55 }
56 
57 #endif
This class represents lattice values for constants.
Definition: AllocatorList.h:23
A Module instance is used to store all the information related to an LLVM module. ...
Definition: Module.h:66
void findDevirtualizableCallsForTypeTest(SmallVectorImpl< DevirtCallSite > &DevirtCalls, SmallVectorImpl< CallInst *> &Assumes, const CallInst *CI, DominatorTree &DT)
Given a call to the intrinsic @llvm.type.test, find all devirtualizable call sites based on the call ...
CallSite CS
The call site itself.
This class represents a function call, abstracting a target machine&#39;s calling convention.
CfiFunctionLinkage
The type of CFI jumptable needed for a function.
uint64_t Offset
The offset from the address point to the virtual function.
void findDevirtualizableCallsForTypeCheckedLoad(SmallVectorImpl< DevirtCallSite > &DevirtCalls, SmallVectorImpl< Instruction *> &LoadedPtrs, SmallVectorImpl< Instruction *> &Preds, bool &HasNonCallUses, const CallInst *CI, DominatorTree &DT)
Given a call to the intrinsic @llvm.type.checked.load, find all devirtualizable call sites based on t...
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: APFloat.h:41
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree...
Definition: Dominators.h:144
A call site that could be devirtualized.
This is an important base class in LLVM.
Definition: Constant.h:41
#define I(x, y, z)
Definition: MD5.cpp:58
Constant * getPointerAtOffset(Constant *I, uint64_t Offset, Module &M)