LLVM 23.0.0git
llvm::instrumentor::LoadIO Struct Reference

The instrumentation opportunity for load instructions. More...

#include "llvm/Transforms/IPO/Instrumentor.h"

Inheritance diagram for llvm::instrumentor::LoadIO:
[legend]

Public Types

enum  ConfigKind {
  PassPointer = 0 , ReplacePointer , PassPointerAS , PassValue ,
  ReplaceValue , PassValueSize , PassAlignment , PassValueTypeId ,
  PassAtomicityOrdering , PassSyncScopeId , PassIsVolatile , PassId ,
  NumConfig
}
 The selector of arguments for load opportunities. More...
using ConfigTy = BaseConfigTy<ConfigKind>
Public Types inherited from llvm::instrumentor::InstrumentationOpportunity
using CallbackTy = std::function<bool(Value &)>
 An optional callback that takes the value that is about to be instrumented and can return false if it should be skipped.

Public Member Functions

virtual ~LoadIO ()
 LoadIO (bool IsPRE)
 Construct a load opportunity.
virtual TypegetValueType (InstrumentorIRBuilderTy &IIRB) const
 }
void init (InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB, ConfigTy *UserConfig=nullptr)
 Initialize the load opportunity using the instrumentation config IConf and the user config UserConfig.
Public Member Functions inherited from llvm::instrumentor::InstructionIO< Instruction::Load >
virtual ~InstructionIO ()
 InstructionIO (bool IsPRE)
 Construct an instruction opportunity.
StringRef getName () const override
 Get the name of the instruction.
Public Member Functions inherited from llvm::instrumentor::InstrumentationOpportunity
virtual ~InstrumentationOpportunity ()
 InstrumentationOpportunity (const InstrumentationLocation IP)
 Construct an opportunity with location IP.
virtual Valueinstrument (Value *&V, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB, InstrumentationCaches &ICaches)
 }
virtual TypegetRetTy (LLVMContext &Ctx) const
 Get the return type for the instrumentation runtime function.
unsigned getOpcode () const
 Get the opcode of the instruction instrumentation opportunity.
InstrumentationLocation::KindTy getLocationKind () const
 Get the location kind of the instrumentation opportunity.
void addCommonArgs (InstrumentationConfig &IConf, LLVMContext &Ctx, bool PassId)
 }

Static Public Member Functions

static ValuegetPointer (Value &V, Type &Ty, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
 Getters and setters for the arguments of the instrumentation function for the load opportunity.
static ValuesetPointer (Value &V, Value &NewV, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
static ValuegetPointerAS (Value &V, Type &Ty, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
static ValuegetValue (Value &V, Type &Ty, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
static ValuegetValueSize (Value &V, Type &Ty, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
static ValuegetAlignment (Value &V, Type &Ty, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
static ValuegetValueTypeId (Value &V, Type &Ty, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
static ValuegetAtomicityOrdering (Value &V, Type &Ty, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
static ValuegetSyncScopeId (Value &V, Type &Ty, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
static ValueisVolatile (Value &V, Type &Ty, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
static void populate (InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
 }
Static Public Member Functions inherited from llvm::instrumentor::InstrumentationOpportunity
static ValueforceCast (Value &V, Type &Ty, InstrumentorIRBuilderTy &IIRB)
 Helpers to cast values, pass them to the runtime, and replace them.
static ValuegetValue (Value &V, Type &Ty, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
static ValuereplaceValue (Value &V, Value &NewV, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
static ValuegetIdPre (Value &V, Type &Ty, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
 Get the opportunity identifier for the pre and post positions.
static ValuegetIdPost (Value &V, Type &Ty, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
static int32_t getIdFromEpoch (uint32_t CurrentEpoch)
 }

Public Attributes

ConfigTy Config
Public Attributes inherited from llvm::instrumentor::InstrumentationOpportunity
InstrumentationLocation IP
 The instrumentation location of the opportunity.
SmallVector< IRTArgIRTArgs
 The list of possible arguments for the instrumentation runtime function.
bool Enabled = true
 Whether the opportunity is enabled.
CallbackTy CB = nullptr

Detailed Description

The instrumentation opportunity for load instructions.

Definition at line 604 of file Instrumentor.h.

Member Typedef Documentation

◆ ConfigTy

Member Enumeration Documentation

◆ ConfigKind

The selector of arguments for load opportunities.

{

Enumerator
PassPointer 
ReplacePointer 
PassPointerAS 
PassValue 
ReplaceValue 
PassValueSize 
PassAlignment 
PassValueTypeId 
PassAtomicityOrdering 
PassSyncScopeId 
PassIsVolatile 
PassId 
NumConfig 

Definition at line 612 of file Instrumentor.h.

Constructor & Destructor Documentation

◆ ~LoadIO()

virtual llvm::instrumentor::LoadIO::~LoadIO ( )
inlinevirtual

Definition at line 605 of file Instrumentor.h.

◆ LoadIO()

llvm::instrumentor::LoadIO::LoadIO ( bool IsPRE)
inline

Construct a load opportunity.

Definition at line 608 of file Instrumentor.h.

References llvm::instrumentor::InstructionIO< Instruction::Load >::InstructionIO().

Referenced by populate().

Member Function Documentation

◆ getAlignment()

Value * LoadIO::getAlignment ( Value & V,
Type & Ty,
InstrumentationConfig & IConf,
InstrumentorIRBuilderTy & IIRB )
static

Definition at line 738 of file Instrumentor.cpp.

References llvm::cast().

Referenced by init().

◆ getAtomicityOrdering()

Value * LoadIO::getAtomicityOrdering ( Value & V,
Type & Ty,
InstrumentationConfig & IConf,
InstrumentorIRBuilderTy & IIRB )
static

Definition at line 750 of file Instrumentor.cpp.

References llvm::cast().

Referenced by init().

◆ getPointer()

Value * LoadIO::getPointer ( Value & V,
Type & Ty,
InstrumentationConfig & IConf,
InstrumentorIRBuilderTy & IIRB )
static

Getters and setters for the arguments of the instrumentation function for the load opportunity.

{

Definition at line 707 of file Instrumentor.cpp.

References llvm::cast().

Referenced by init().

◆ getPointerAS()

Value * LoadIO::getPointerAS ( Value & V,
Type & Ty,
InstrumentationConfig & IConf,
InstrumentorIRBuilderTy & IIRB )
static

Definition at line 720 of file Instrumentor.cpp.

References llvm::cast().

Referenced by init().

◆ getSyncScopeId()

Value * LoadIO::getSyncScopeId ( Value & V,
Type & Ty,
InstrumentationConfig & IConf,
InstrumentorIRBuilderTy & IIRB )
static

Definition at line 757 of file Instrumentor.cpp.

References llvm::cast().

Referenced by init().

◆ getValue()

Value * LoadIO::getValue ( Value & V,
Type & Ty,
InstrumentationConfig & IConf,
InstrumentorIRBuilderTy & IIRB )
static

Definition at line 726 of file Instrumentor.cpp.

Referenced by init().

◆ getValueSize()

Value * LoadIO::getValueSize ( Value & V,
Type & Ty,
InstrumentationConfig & IConf,
InstrumentorIRBuilderTy & IIRB )
static

Definition at line 731 of file Instrumentor.cpp.

References llvm::cast(), and DL.

Referenced by init().

◆ getValueType()

virtual Type * llvm::instrumentor::LoadIO::getValueType ( InstrumentorIRBuilderTy & IIRB) const
inlinevirtual

}

Get the type of the loaded value.

Definition at line 633 of file Instrumentor.h.

References llvm::instrumentor::InstrumentorIRBuilderTy::Int64Ty.

Referenced by init().

◆ getValueTypeId()

Value * LoadIO::getValueTypeId ( Value & V,
Type & Ty,
InstrumentationConfig & IConf,
InstrumentorIRBuilderTy & IIRB )
static

Definition at line 744 of file Instrumentor.cpp.

References llvm::cast().

Referenced by init().

◆ init()

◆ isVolatile()

Value * LoadIO::isVolatile ( Value & V,
Type & Ty,
InstrumentationConfig & IConf,
InstrumentorIRBuilderTy & IIRB )
static

Definition at line 763 of file Instrumentor.cpp.

References llvm::cast().

Referenced by init().

◆ populate()

void llvm::instrumentor::LoadIO::populate ( InstrumentationConfig & IConf,
InstrumentorIRBuilderTy & IIRB )
inlinestatic

}

Create the store opportunities for PRE and POST positions.

Definition at line 669 of file Instrumentor.h.

References llvm::instrumentor::InstrumentationConfig::allocate(), and LoadIO().

Referenced by llvm::instrumentor::InstrumentationConfig::populate().

◆ setPointer()

Value * LoadIO::setPointer ( Value & V,
Value & NewV,
InstrumentationConfig & IConf,
InstrumentorIRBuilderTy & IIRB )
static

Definition at line 713 of file Instrumentor.cpp.

References llvm::cast().

Referenced by init().

Member Data Documentation

◆ Config

ConfigTy llvm::instrumentor::LoadIO::Config

Definition at line 629 of file Instrumentor.h.

Referenced by init().


The documentation for this struct was generated from the following files: