LLVM 23.0.0git
Instrumentor.cpp File Reference
#include "llvm/Transforms/IPO/Instrumentor.h"
#include "llvm/Transforms/IPO/InstrumentorConfigFile.h"
#include "llvm/Transforms/IPO/InstrumentorStubPrinter.h"
#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/iterator.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/Demangle/Demangle.h"
#include "llvm/IR/Constant.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/DebugInfoMetadata.h"
#include "llvm/IR/DiagnosticInfo.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/InstrTypes.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Metadata.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/PassManager.h"
#include "llvm/IR/Verifier.h"
#include "llvm/IRReader/IRReader.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/Regex.h"
#include "llvm/Support/VirtualFileSystem.h"
#include "llvm/Transforms/IPO/InstrumentorUtils.h"
#include "llvm/Transforms/Utils/ModuleUtils.h"
#include <cassert>
#include <cstdint>
#include <functional>
#include <iterator>
#include <memory>
#include <string>
#include <system_error>
#include <type_traits>

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "instrumentor"

Functions

static Regex createRegex (StringRef Str, StringRef Name, LLVMContext &Ctx)
template<typename Ty>
static constexpr ValuegetValue (Ty &ValueOrUse)
template<typename Range>
static ValuecreateValuePack (const Range &R, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
template<typename Range>
static void readValuePack (const Range &R, Value &Pack, InstrumentorIRBuilderTy &IIRB, function_ref< void(int, Value *)> SetterCB)
static ValuegetOpcode (Value &V, Type &Ty, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
static ValuegetTypeId (Value &V, Type &Ty, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)
static ValuegetSize (Value &V, Type &Ty, InstrumentationConfig &IConf, InstrumentorIRBuilderTy &IIRB)

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "instrumentor"

Definition at line 64 of file Instrumentor.cpp.

Function Documentation

◆ createRegex()

Regex createRegex ( StringRef Str,
StringRef Name,
LLVMContext & Ctx )
static

Definition at line 214 of file Instrumentor.cpp.

References llvm::DS_Error, and llvm::Regex::isValid().

◆ createValuePack()

◆ getOpcode()

Value * getOpcode ( Value & V,
Type & Ty,
InstrumentationConfig & IConf,
InstrumentorIRBuilderTy & IIRB )
static

Definition at line 1003 of file Instrumentor.cpp.

References llvm::cast(), and I.

Referenced by llvm::R600InstrInfo::analyzeBranch(), llvm::CanonicalLoopInfo::assertOK(), buildNew(), canonicalHeaderAndLatch(), canSplitIdx(), combineExtractWithShuffle(), combineINSERT_SUBVECTOR(), combineSelect(), combineToHorizontalAddSub(), llvm::VPWidenCastRecipe::computeCost(), llvm::VPWidenRecipe::computeCost(), slpvectorizer::BoUpSLP::computeMinimumValueSizes(), llvm::ConstantExprKeyType::ConstantExprKeyType(), llvm::ConstantExprKeyType::ConstantExprKeyType(), llvm::ConstantFoldBinaryInstruction(), llvm::GVNExpression::BasicExpression::equals(), FoldBUILD_VECTOR(), llvm::SelectionDAG::FoldConstantArithmetic(), llvm::InstCombinerImpl::freelyInvertAllUsersOf(), llvm::RISCVMatInt::generateInstSeq(), getAltInstrMask(), getFauxShuffleMask(), llvm::GVNExpression::Expression::getHashValue(), llvm::Instruction::getOpcodeName(), llvm::VPCostContext::getScalarizationOverhead(), llvm::vputils::getVFScaleFactor(), llvm::VPInstruction::hasResult(), llvm::instrumentor::CastIO::init(), llvm::instrumentor::NumericIO::init(), llvm::Instruction::isArithmeticShift(), llvm::Instruction::isBinaryOp(), llvm::Instruction::isBitwiseLogicOp(), llvm::Instruction::isCast(), llvm::Instruction::isEHPad(), llvm::Instruction::isFenceLike(), llvm::Instruction::isFPDivRem(), llvm::Instruction::isFuncletPad(), llvm::Instruction::isIdempotent(), llvm::Instruction::isIntDivRem(), llvm::Instruction::isLogicalShift(), llvm::Instruction::isNilpotent(), llvm::Instruction::isShift(), isSignedMinMaxClamp(), llvm::Instruction::isSpecialTerminator(), llvm::Instruction::isTerminator(), llvm::Instruction::isUnaryOp(), LinearizeExprTree(), LLVMGetConstOpcode(), lowerV8I16Shuffle(), llvm::GVNExpression::Expression::operator==(), llvm::GVNExpression::Expression::printInternal(), slpvectorizer::BoUpSLP::reorderTopToBottom(), ReorganizeVector(), llvm::VPlanTransforms::replicateByVF(), llvm::InstCombinerImpl::visitCallInst(), and llvm::InstCombinerImpl::visitShl().

◆ getSize()

Value * getSize ( Value & V,
Type & Ty,
InstrumentationConfig & IConf,
InstrumentorIRBuilderTy & IIRB )
static

Definition at line 1014 of file Instrumentor.cpp.

References llvm::cast(), DL, and I.

◆ getTypeId()

Value * getTypeId ( Value & V,
Type & Ty,
InstrumentationConfig & IConf,
InstrumentorIRBuilderTy & IIRB )
static

Definition at line 1009 of file Instrumentor.cpp.

Referenced by llvm::instrumentor::NumericIO::init().

◆ getValue()

◆ readValuePack()