LLVM 20.0.0git
Namespaces | 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"
#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)   /* 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.

◆ contains() [1/2]

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

Definition at line 469 of file Value.cpp.

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(), 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::XtensaInstrInfo::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::SystemZELFFrameLowering::determineCalleeSaves(), llvm::RegionBase< RegionTraits< MachineFunction > >::dump(), 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(), 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::GenericCycle< ContextT >::getExitingBlocks(), llvm::gsym::GsymReader::getFunctionInfoDataForAddress(), getHexagonRegisterPair(), llvm::LoopBase< BasicBlock, Loop >::getLoopLatch(), llvm::LoopBase< BlockT, LoopT >::getLoopLatch(), llvm::LoopBase< BlockT, LoopT >::getLoopPredecessor(), getMFHiLoOpc(), getNextRegister(), getPairedGPR(), llvm::ARMBaseInstrInfo::getPartialRegUpdateClearance(), getRC32(), llvm::RISCVRegisterInfo::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(), INITIALIZE_PASS(), llvm::AArch64TargetLowering::insertCopiesSplitCSR(), llvm::SITargetLowering::insertCopiesSplitCSR(), isEvenReg(), llvm::ErrataWorkaround::isFloat(), 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::SITargetLowering::LowerFormalArguments(), llvm::SITargetLowering::LowerReturn(), lowerRISCVVMachineInstrToMCInst(), mapArgRegToOffsetAIX(), llvm::RISCVRegisterInfo::needsFrameBaseReg(), nextReg(), llvm::RegionBase< Tr >::outermostLoopInRegion(), llvm::RISCVISAInfo::parseArchString(), printAsmMRegister(), llvm::HexagonAsmPrinter::PrintAsmOperand(), llvm::ARMAsmPrinter::PrintAsmOperand(), printAsmVRegister(), llvm::ARMAsmPrinter::printOperand(), llvm::MipsAsmPrinter::printSavedRegsBitmask(), llvm::PPCFrameLowering::processFunctionBeforeFrameFinalized(), llvm::AArch64RegisterInfo::regNeedsCFI(), 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]

static bool contains ( Value Expr,
Value V 
)
static

Definition at line 486 of file Value.cpp.

◆ getOffsetFromIndex()

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

Definition at line 996 of file Value.cpp.

◆ getSymTab()

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

◆ isUnDroppableUser()

static bool isUnDroppableUser ( const User U)
static

Definition at line 165 of file Value.cpp.

◆ 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.

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