LLVM 24.0.0git
llvm::LastSubtargetCache< SubtargetT, AttrsT > Class Template Reference

Cache of the last subtarget returned by getSubtargetImpl. More...

#include "llvm/Target/LastSubtargetCache.h"

Inheritance diagram for llvm::LastSubtargetCache< SubtargetT, AttrsT >:
[legend]

Public Member Functions

const SubtargetT * lookup (AttributeSet NewFnAttrs, const Module *NewM) const
 Return the last subtarget if the function attributes and module match.
const SubtargetT * lookup (AttributeSet NewFnAttrs, const Module *NewM, const AttrsT &NewAttrs)
 Return the last subtarget if NewAttrs match, and remember NewFnAttrs and NewM for it.
void set (AttributeSet NewFnAttrs, const Module *NewM, const AttrsT &NewAttrs, const SubtargetT *NewSubtarget)
 Remember NewSubtarget for these attributes.
void clear ()

Detailed Description

template<typename SubtargetT, typename AttrsT>
class llvm::LastSubtargetCache< SubtargetT, AttrsT >

Cache of the last subtarget returned by getSubtargetImpl.

A query hits if the function has the same function attributes and module as the last one, or else the same AttrsT, which must hold every input to the subtarget key, including module-level ones.

Attributes are compared by their uniqued pointers, so the cache must be cleared before it sees functions from a different LLVMContext.

Definition at line 31 of file LastSubtargetCache.h.

Member Function Documentation

◆ clear()

template<typename SubtargetT, typename AttrsT>
void llvm::LastSubtargetCache< SubtargetT, AttrsT >::clear ( )
inline

Definition at line 64 of file LastSubtargetCache.h.

◆ lookup() [1/2]

template<typename SubtargetT, typename AttrsT>
const SubtargetT * llvm::LastSubtargetCache< SubtargetT, AttrsT >::lookup ( AttributeSet NewFnAttrs,
const Module * NewM ) const
inline

Return the last subtarget if the function attributes and module match.

Definition at line 39 of file LastSubtargetCache.h.

◆ lookup() [2/2]

template<typename SubtargetT, typename AttrsT>
const SubtargetT * llvm::LastSubtargetCache< SubtargetT, AttrsT >::lookup ( AttributeSet NewFnAttrs,
const Module * NewM,
const AttrsT & NewAttrs )
inline

Return the last subtarget if NewAttrs match, and remember NewFnAttrs and NewM for it.

Definition at line 46 of file LastSubtargetCache.h.

◆ set()

template<typename SubtargetT, typename AttrsT>
void llvm::LastSubtargetCache< SubtargetT, AttrsT >::set ( AttributeSet NewFnAttrs,
const Module * NewM,
const AttrsT & NewAttrs,
const SubtargetT * NewSubtarget )
inline

Remember NewSubtarget for these attributes.

Definition at line 56 of file LastSubtargetCache.h.


The documentation for this class was generated from the following file: