LLVM 22.0.0git
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"
#include "llvm/SandboxIR/Value.h"
#include "llvm/SandboxIR/Context.h"
#include "llvm/SandboxIR/User.h"
#include <sstream>

Go to the source code of this file.

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.
namespace  llvm::sandboxir

Macros

#define HANDLE_VALUE(Name)
#define HANDLE_MEMORY_VALUE(Name)
#define HANDLE_CONSTANT(Name)
#define HANDLE_INSTRUCTION(Name)
#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 debug record uses of MetadataAsValue(ValueAsMetadata(V)) outside BB with New.
static std::optional< int64_t > getOffsetFromIndex (const GEPOperator *GEP, unsigned Idx, const DataLayout &DL)

Variables

cl::opt< boolUseDerefAtPointSemantics ("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)
Value:
/* 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;

Function Documentation

◆ checkType()

Type * checkType ( Type * Ty)
inlinestatic

Definition at line 46 of file Value.cpp.

◆ contains() [1/2]

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

Definition at line 480 of file Value.cpp.

Referenced by llvm::X86Operand::addGR16orGR32orGR64Operands(), llvm::X86Operand::addGR32orGR64Operands(), llvm::RISCVRegisterInfo::adjustReg(), analyzeCompressibleUses(), llvm::PPCFrameLowering::assignCalleeSavedSpillSlots(), llvm::SystemZELFFrameLowering::assignCalleeSavedSpillSlots(), llvm::X86FrameLowering::assignCalleeSavedSpillSlots(), llvm::ARMBaseInstrInfo::breakPartialRegDependency(), llvm::X86InstrInfo::breakPartialRegDependency(), llvm::X86InstrInfo::buildClearRegister(), canSpillOnFrameIndexAccess(), CheckBaseRegAndIndexRegAndScale(), CompressEVEXImpl(), computeCalleeSaveRegisterPairs(), llvm::BaseIndexOffset::contains(), llvm::RegionBase< Tr >::contains(), llvm::AArch64InstrInfo::copyPhysReg(), llvm::ARCInstrInfo::copyPhysReg(), llvm::ARMBaseInstrInfo::copyPhysReg(), llvm::AVRInstrInfo::copyPhysReg(), llvm::BPFInstrInfo::copyPhysReg(), llvm::CSKYInstrInfo::copyPhysReg(), llvm::HexagonInstrInfo::copyPhysReg(), llvm::LanaiInstrInfo::copyPhysReg(), llvm::LoongArchInstrInfo::copyPhysReg(), llvm::M68kInstrInfo::copyPhysReg(), llvm::Mips16InstrInfo::copyPhysReg(), llvm::MipsSEInstrInfo::copyPhysReg(), llvm::MSP430InstrInfo::copyPhysReg(), llvm::PPCInstrInfo::copyPhysReg(), llvm::R600InstrInfo::copyPhysReg(), llvm::RISCVInstrInfo::copyPhysReg(), llvm::SIInstrInfo::copyPhysReg(), llvm::SparcInstrInfo::copyPhysReg(), llvm::SystemZInstrInfo::copyPhysReg(), llvm::Thumb1InstrInfo::copyPhysReg(), llvm::Thumb2InstrInfo::copyPhysReg(), llvm::VEInstrInfo::copyPhysReg(), llvm::X86InstrInfo::copyPhysReg(), llvm::XtensaInstrInfo::copyPhysReg(), CopyToFromAsymmetricReg(), llvm::StringMap< std::nullopt_t, AllocatorTy >::count(), llvm::X86InstrInfo::describeLoadedValue(), llvm::AArch64FrameLowering::determineCalleeSaves(), llvm::ARMFrameLowering::determineCalleeSaves(), llvm::CSKYFrameLowering::determineCalleeSaves(), llvm::RISCVFrameLowering::determineCalleeSaves(), llvm::SystemZELFFrameLowering::determineCalleeSaves(), llvm::RegionBase< RegionTraits< MachineFunction > >::dump(), llvm::ARCRegisterInfo::eliminateFrameIndex(), llvm::ThumbRegisterInfo::eliminateFrameIndex(), llvm::X86RegisterInfo::eliminateFrameIndex(), llvm::XCoreRegisterInfo::eliminateFrameIndex(), llvm::X86AsmPrinter::emitKCFITypeId(), emitLoad(), llvm::MipsSEFrameLowering::emitPrologue(), llvm::PPCFrameLowering::emitPrologue(), llvm::SystemZELFFrameLowering::emitPrologue(), llvm::X86FrameLowering::emitPrologue(), emitStore(), llvm::ARMBaseInstrInfo::expandPostRAPseudo(), llvm::PPCInstrInfo::expandPostRAPseudo(), llvm::R600InstrInfo::fitsConstReadLimitations(), 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::GenericCycle< ContextT >::getExitBlocks(), llvm::LoopBase< BlockT, LoopT >::getExitBlocks(), llvm::LoopBase< BlockT, LoopT >::getExitEdges(), llvm::LoopBase< BlockT, LoopT >::getExitingBlock(), llvm::RegionBase< Tr >::getExitingBlock(), llvm::GenericCycle< ContextT >::getExitingBlocks(), llvm::LoopBase< BlockT, LoopT >::getExitingBlocks(), llvm::RegionBase< Tr >::getExitingBlocks(), llvm::gsym::GsymReader::getFunctionInfoDataForAddress(), getHexagonRegisterPair(), llvm::LoopBase< BlockT, LoopT >::getLoopLatch(), llvm::LoopBase< BasicBlock, Loop >::getLoopLatch(), llvm::LoopBase< BlockT, LoopT >::getLoopPredecessor(), getMFHiLoOpc(), getNextRegister(), getPairedGPR(), llvm::ARMBaseInstrInfo::getPartialRegUpdateClearance(), getRC32(), llvm::RISCVRegisterInfo::getRegAllocationHints(), llvm::SIRegisterInfo::getRegAllocationHints(), getRegClassFromGRPhysReg(), getRegImmPairPreventingCompression(), llvm::SystemZELFFrameLowering::getRegSpillOffset(), llvm::RegionBase< Tr >::getSubRegionNode(), getSVECalleeSaveSlotRange(), llvm::LoopBase< BasicBlock, Loop >::getUniqueExitBlocks(), llvm::LoopBase< BlockT, LoopT >::getUniqueLatchExitBlock(), llvm::LoopBase< BlockT, LoopT >::hasDedicatedExits(), indirectCopyToAGPR(), llvm::AArch64TargetLowering::insertCopiesSplitCSR(), llvm::SITargetLowering::insertCopiesSplitCSR(), isEvenReg(), llvm::ErrataWorkaround::isFloat(), llvm::AArch64InstrInfo::isGPRCopy(), llvm::X86Operand::isGR16orGR32orGR64(), llvm::X86Operand::isGR32orGR64(), llvm::SystemZ::isHighReg(), isIncompatibleReg(), llvm::X86Operand::isMem512_GR16(), llvm::X86Operand::isMem512_GR32(), llvm::X86Operand::isMem512_GR64(), llvm::X86Operand::isVectorReg(), llvm::SITargetLowering::LowerFormalArguments(), llvm::SITargetLowering::LowerReturn(), lowerRISCVVMachineInstrToMCInst(), mapArgRegToOffsetAIX(), llvm::RISCVRegisterInfo::needsFrameBaseReg(), nextReg(), llvm::VGPRBlock2IndexFunctor::operator()(), llvm::RegionBase< Tr >::outermostLoopInRegion(), llvm::RISCVISAInfo::parseArchString(), parseFilePathFromURI(), printAsmMRegister(), llvm::ARMAsmPrinter::PrintAsmOperand(), llvm::HexagonAsmPrinter::PrintAsmOperand(), printAsmVRegister(), llvm::ARMAsmPrinter::printOperand(), llvm::MipsAsmPrinter::printSavedRegsBitmask(), llvm::PPCFrameLowering::processFunctionBeforeFrameFinalized(), llvm::AArch64RegisterInfo::regNeedsCFI(), RegSizeInBits(), llvm::LoopBase< BasicBlock, Loop >::replaceChildLoopWith(), 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(), llvm::PPCFrameLowering::updateCalleeSaves(), llvm::UpgradeDataLayoutString(), llvm::GenericCycle< ContextT >::verifyCycle(), llvm::GenericCycle< ContextT >::verifyCycleNest(), and llvm::Function::viewCFG().

◆ contains() [2/2]

bool contains ( Value * Expr,
Value * V )
static

Definition at line 497 of file Value.cpp.

◆ getOffsetFromIndex()

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

Definition at line 1022 of file Value.cpp.

◆ getSymTab()

◆ isUnDroppableUser()

bool isUnDroppableUser ( const User * U)
static

Definition at line 174 of file Value.cpp.

◆ replaceDbgUsesOutsideBlock()

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

Replace debug record uses of MetadataAsValue(ValueAsMetadata(V)) outside BB with New.

Definition at line 587 of file Value.cpp.

Variable Documentation

◆ UseDerefAtPointSemantics

cl::opt< bool > 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")  )