LLVM 19.0.0git
Macros | Functions | Variables
Value.cpp File Reference
#include "llvm/IR/Value.h"
#include "LLVMContextImpl.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/IR/Constant.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/DebugInfo.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/DerivedUser.h"
#include "llvm/IR/GetElementPtrTypeIterator.h"
#include "llvm/IR/InstrTypes.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Operator.h"
#include "llvm/IR/TypedPointerType.h"
#include "llvm/IR/ValueHandle.h"
#include "llvm/IR/ValueSymbolTable.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include "llvm/IR/Value.def"
#include "llvm/IR/Instruction.def"

Go to the source code of this file.

Macros

#define HANDLE_VALUE(Name)
 
#define HANDLE_MEMORY_VALUE(Name)
 
#define HANDLE_CONSTANT(Name)
 
#define HANDLE_INSTRUCTION(Name)   /* nothing */
 
#define HANDLE_INST(N, OPC, CLASS)
 
#define HANDLE_USER_INST(N, OPC, CLASS)
 

Functions

static TypecheckType (Type *Ty)
 
static bool isUnDroppableUser (const User *U)
 
static bool getSymTab (Value *V, ValueSymbolTable *&ST)
 
static bool contains (SmallPtrSetImpl< ConstantExpr * > &Cache, ConstantExpr *Expr, Constant *C)
 
static bool contains (Value *Expr, Value *V)
 
static void replaceDbgUsesOutsideBlock (Value *V, Value *New, BasicBlock *BB)
 Replace llvm.dbg.
 
static std::optional< int64_t > getOffsetFromIndex (const GEPOperator *GEP, unsigned Idx, const DataLayout &DL)
 

Variables

static cl::opt< unsignedUseDerefAtPointSemantics ("use-dereferenceable-at-point-semantics", cl::Hidden, cl::init(false), cl::desc("Deref attributes and metadata infer facts at definition only"))
 

Macro Definition Documentation

◆ HANDLE_CONSTANT

#define HANDLE_CONSTANT (   Name)
Value:
case Value::Name##Val: \
llvm_unreachable("constants should be destroyed with destroyConstant"); \
break;

◆ HANDLE_INST

#define HANDLE_INST (   N,
  OPC,
  CLASS 
)
Value:
case Value::InstructionVal + Instruction::OPC: \
delete static_cast<CLASS *>(this); \
break;

◆ HANDLE_INSTRUCTION

#define HANDLE_INSTRUCTION (   Name)    /* nothing */

◆ HANDLE_MEMORY_VALUE

#define HANDLE_MEMORY_VALUE (   Name)
Value:
case Value::Name##Val: \
static_cast<DerivedUser *>(this)->DeleteValue( \
static_cast<DerivedUser *>(this)); \
break;
Extension point for the Value hierarchy.
Definition: DerivedUser.h:27

◆ HANDLE_USER_INST

#define HANDLE_USER_INST (   N,
  OPC,
  CLASS 
)

◆ HANDLE_VALUE

#define HANDLE_VALUE (   Name)
Value:
case Value::Name##Val: \
delete static_cast<Name *>(this); \
break;
std::string Name

Function Documentation

◆ checkType()

static Type * checkType ( Type Ty)
inlinestatic

Definition at line 46 of file Value.cpp.

References assert(), and llvm::Type::getScalarType().

◆ contains() [1/2]

static bool contains ( SmallPtrSetImpl< ConstantExpr * > &  Cache,
ConstantExpr Expr,
Constant C 
)
static

Definition at line 469 of file Value.cpp.

References llvm::CallingConv::C, contains(), llvm::SmallPtrSetImpl< PtrType >::insert(), and llvm::User::operands().

Referenced by llvm::X86Operand::addGR16orGR32orGR64Operands(), llvm::X86Operand::addGR32orGR64Operands(), analyzeCompressibleUses(), llvm::PPCFrameLowering::assignCalleeSavedSpillSlots(), llvm::SystemZELFFrameLowering::assignCalleeSavedSpillSlots(), llvm::X86FrameLowering::assignCalleeSavedSpillSlots(), llvm::ARMBaseInstrInfo::breakPartialRegDependency(), llvm::X86InstrInfo::breakPartialRegDependency(), llvm::X86InstrInfo::buildClearRegister(), canBeFeederToNewValueJump(), canSpillOnFrameIndexAccess(), CheckBaseRegAndIndexRegAndScale(), llvm::IRSimilarity::IRSimilarityCandidate::compareAssignmentMapping(), computeCalleeSaveRegisterPairs(), llvm::RegionBase< Tr >::contains(), llvm::BaseIndexOffset::contains(), contains(), llvm::ARCInstrInfo::copyPhysReg(), llvm::AArch64InstrInfo::copyPhysReg(), llvm::ARMBaseInstrInfo::copyPhysReg(), llvm::Thumb1InstrInfo::copyPhysReg(), llvm::Thumb2InstrInfo::copyPhysReg(), llvm::BPFInstrInfo::copyPhysReg(), llvm::HexagonInstrInfo::copyPhysReg(), llvm::MSP430InstrInfo::copyPhysReg(), llvm::PPCInstrInfo::copyPhysReg(), llvm::SparcInstrInfo::copyPhysReg(), llvm::VEInstrInfo::copyPhysReg(), llvm::SystemZInstrInfo::copyPhysReg(), llvm::LoongArchInstrInfo::copyPhysReg(), llvm::RISCVInstrInfo::copyPhysReg(), llvm::R600InstrInfo::copyPhysReg(), llvm::SIInstrInfo::copyPhysReg(), llvm::AVRInstrInfo::copyPhysReg(), llvm::CSKYInstrInfo::copyPhysReg(), llvm::M68kInstrInfo::copyPhysReg(), llvm::Mips16InstrInfo::copyPhysReg(), llvm::MipsSEInstrInfo::copyPhysReg(), llvm::X86InstrInfo::copyPhysReg(), llvm::LanaiInstrInfo::copyPhysReg(), CopyToFromAsymmetricReg(), llvm::StringMap< ValueTy, AllocatorTy >::count(), llvm::X86InstrInfo::describeLoadedValue(), llvm::AArch64FrameLowering::determineCalleeSaves(), llvm::ARMFrameLowering::determineCalleeSaves(), llvm::CSKYFrameLowering::determineCalleeSaves(), llvm::RISCVFrameLowering::determineCalleeSaves(), llvm::SystemZELFFrameLowering::determineCalleeSaves(), llvm::ARCRegisterInfo::eliminateFrameIndex(), llvm::ThumbRegisterInfo::eliminateFrameIndex(), llvm::XCoreRegisterInfo::eliminateFrameIndex(), llvm::X86RegisterInfo::eliminateFrameIndex(), emitLoad(), llvm::MipsSEFrameLowering::emitPrologue(), llvm::PPCFrameLowering::emitPrologue(), llvm::SystemZELFFrameLowering::emitPrologue(), llvm::X86FrameLowering::emitPrologue(), emitStore(), llvm::ARMBaseInstrInfo::expandPostRAPseudo(), llvm::PPCInstrInfo::expandPostRAPseudo(), llvm::R600InstrInfo::fitsConstReadLimitations(), flattenCommandLine(), llvm::SystemZInstrInfo::foldMemoryOperandImpl(), llvm::ARMAsmBackendDarwin::generateCompactUnwindEncoding(), llvm::RegionBase< Tr >::getBBNode(), llvm::HexagonInstrInfo::getCompoundCandidateGroup(), llvm::GenericCycle< ContextT >::getCyclePredecessor(), llvm::HexagonInstrInfo::getDuplexCandidateGroup(), llvm::RegionBase< Tr >::getEnteringBlock(), llvm::LoopBase< BlockT, LoopT >::getExitBlocks(), llvm::GenericCycle< ContextT >::getExitBlocks(), llvm::LoopBase< BlockT, LoopT >::getExitEdges(), llvm::RegionBase< Tr >::getExitingBlock(), llvm::LoopBase< BlockT, LoopT >::getExitingBlock(), llvm::LoopBase< BlockT, LoopT >::getExitingBlocks(), llvm::RegionBase< Tr >::getExitingBlocks(), llvm::gsym::GsymReader::getFunctionInfoDataForAddress(), getHexagonRegisterPair(), llvm::LoopBase< BlockT, LoopT >::getLoopLatch(), llvm::LoopBase< BlockT, LoopT >::getLoopPredecessor(), getMFHiLoOpc(), getNextRegister(), llvm::RegionBase< Tr >::getNode(), getPairedGPR(), llvm::ARMBaseInstrInfo::getPartialRegUpdateClearance(), getRC32(), llvm::RISCVRegisterInfo::getRegAllocationHints(), getRegClassFromGRPhysReg(), getRegImmPairPreventingCompression(), llvm::SystemZELFFrameLowering::getRegSpillOffset(), getSVECalleeSaveSlotRange(), llvm::LoopBase< BlockT, LoopT >::hasDedicatedExits(), indirectCopyToAGPR(), INITIALIZE_PASS(), llvm::AArch64TargetLowering::insertCopiesSplitCSR(), llvm::SITargetLowering::insertCopiesSplitCSR(), isEvenReg(), llvm::AArch64InstrInfo::isFpOrNEON(), llvm::AArch64InstrInfo::isGPRCopy(), llvm::AArch64InstrInfo::isHForm(), llvm::SystemZ::isHighReg(), llvm::X86Operand::isMem512_GR16(), llvm::X86Operand::isMem512_GR32(), llvm::X86Operand::isMem512_GR64(), llvm::AArch64InstrInfo::isQForm(), llvm::lookupBuiltin(), llvm::SITargetLowering::LowerFormalArguments(), llvm::SITargetLowering::LowerReturn(), lowerRISCVVMachineInstrToMCInst(), mapArgRegToOffsetAIX(), nextReg(), llvm::RegionBase< Tr >::outermostLoopInRegion(), printAsmMRegister(), llvm::HexagonAsmPrinter::PrintAsmOperand(), llvm::ARMAsmPrinter::PrintAsmOperand(), printAsmVRegister(), llvm::ARMAsmPrinter::printOperand(), llvm::MipsAsmPrinter::printSavedRegsBitmask(), llvm::PPCFrameLowering::processFunctionBeforeFrameFinalized(), llvm::R600InstrInfo::readsLDSSrcReg(), llvm::AArch64RegisterInfo::regNeedsCFI(), llvm::Value::replaceUsesOutsideBlock(), llvm::SystemZELFFrameLowering::restoreCalleeSavedRegisters(), llvm::SystemZXPLINKFrameLowering::restoreCalleeSavedRegisters(), llvm::Thumb1FrameLowering::restoreCalleeSavedRegisters(), llvm::X86FrameLowering::restoreCalleeSavedRegisters(), llvm::ThumbRegisterInfo::rewriteFrameIndex(), llvm::X86MachineFunctionInfo::setRestoreBasePointer(), llvm::SystemZELFFrameLowering::spillCalleeSavedRegisters(), llvm::SystemZXPLINKFrameLowering::spillCalleeSavedRegisters(), llvm::Thumb1FrameLowering::spillCalleeSavedRegisters(), llvm::X86FrameLowering::spillCalleeSavedRegisters(), splitLowAndHighRegs(), llvm::AVRRegisterInfo::splitReg(), and llvm::Function::viewCFG().

◆ contains() [2/2]

static bool contains ( Value Expr,
Value V 
)
static

Definition at line 486 of file Value.cpp.

References llvm::CallingConv::C, and contains().

◆ getOffsetFromIndex()

static std::optional< int64_t > getOffsetFromIndex ( const GEPOperator GEP,
unsigned  Idx,
const DataLayout DL 
)
static

◆ getSymTab()

static bool getSymTab ( Value V,
ValueSymbolTable *&  ST 
)
static

◆ isUnDroppableUser()

static bool isUnDroppableUser ( const User U)
static

◆ replaceDbgUsesOutsideBlock()

static void replaceDbgUsesOutsideBlock ( Value V,
Value New,
BasicBlock BB 
)
static

Replace llvm.dbg.

  • uses of MetadataAsValue(ValueAsMetadata(V)) outside BB with New.

Definition at line 575 of file Value.cpp.

References llvm::findDbgUsers(), and llvm::DbgMarker::getParent().

Referenced by llvm::Value::replaceUsesOutsideBlock().

Variable Documentation

◆ UseDerefAtPointSemantics

cl::opt< unsigned > UseDerefAtPointSemantics("use-dereferenceable-at-point-semantics", cl::Hidden, cl::init(false), cl::desc("Deref attributes and metadata infer facts at definition only")) ( "use-dereferenceable-at-point-semantics"  ,
cl::Hidden  ,
cl::init(false)  ,
cl::desc("Deref attributes and metadata infer facts at definition only")   
)
static